Skip to content
ToolkitHub

ASCII ↔ Text Converter

Convert between ASCII codes and text

Guide

ASCII codes and the characters behind them

By Logappradeep · ServiceNow developer

ASCII, the American Standard Code for Information Interchange, was first published in 1963 and still forms the foundation of nearly every modern text encoding. It assigns numbers from 0 to 127 to English letters, digits, punctuation, and control characters. UTF-8 was designed so that those 128 characters keep exactly the same values, which is why plain English text is byte-for-byte identical in ASCII and UTF-8.

How the table is laid out

  • 0–31: control characters, originally commands for teletypes. The ones you still meet are 9 (tab), 10 (line feed), 13 (carriage return), and 0 (null, the C string terminator).
  • 32: space, the first printable character.
  • 48–57: digits 0–9. Subtracting 48 from a digit's code gives its numeric value, a trick used in countless parsers.
  • 65–90: uppercase A–Z.
  • 97–122: lowercase a–z.
  • 127: DEL, another control character.

Converting Hi! produces 72 105 33, and decoding 72 105 33 gives the text back.

The case bit

Uppercase and lowercase letters are exactly 32 apart: A is 65 and a is 97. In binary, 32 is a single bit, so switching case is just flipping that bit. This is also why simple byte-order sorting places every uppercase letter before every lowercase one: Zebra (Z = 90) sorts ahead of apple (a = 97). If a list sorts in a surprising order, ASCII values are often the reason.

Practical uses

  • Working with functions like charCodeAt and String.fromCharCode in JavaScript, ord and chr in Python, or CHAR() and ASCII() in SQL.
  • Identifying unprintable characters in input: a code of 13 at the end of each line means Windows line endings, and 9 means a tab, not spaces.
  • Building keyboard handlers, simple ciphers, checksums, and protocol messages that work on character codes.
  • Solving puzzles and CTF challenges that hide messages as lists of numbers.

Things that trip people up

  • There is no single "extended ASCII". Codes 128–255 mean different things in Windows-1252, ISO-8859-1, and old DOS code pages. Any value above 127 is not ASCII at all; for characters such as é you are looking at a Unicode code point, and the bytes on disk depend on the encoding used. This converter shows such characters by their Unicode code point, such as 233 for é.
  • Decimal, not hex. This converter uses decimal codes. A table showing 41 for A is using hexadecimal; the decimal value is 65.
  • Separators matter when decoding. Codes must be separated by spaces or commas, because 72105 cannot be split unambiguously.

Conversion runs instantly in your browser, and nothing is uploaded.

Frequently asked questions

What is the ASCII code for a space?

32. The newline (line feed) is 10, the carriage return is 13, and the tab is 9.

Why are uppercase letters sorted before lowercase?

Uppercase letters have codes 65 to 90 and lowercase letters 97 to 122, so a plain code-based sort puts all capitals first.

Is ASCII the same as UTF-8?

For the first 128 characters, yes: UTF-8 encodes them with the same single-byte values. UTF-8 then extends far beyond ASCII to cover all of Unicode.

What does a code above 127 mean?

It is not ASCII. It is a Unicode code point or a value from a legacy code page, so its meaning depends on the encoding in use.