Developer FIELD NOTES · 4 MIN READ
ASCII Codes Explained: Turning Characters into Numbers
How each character maps to a number: the ASCII layout, converting text to codes and back, decimal vs hex, and where Unicode takes over.
A computer never stores the letter H. It stores the number 72, and it only draws the letter H because some table — agreed decades before you were born — says that 72 means H. An ASCII converter is that table made interactive: hand it text and it hands back the numbers, or hand it numbers and it hands back the text. It is the smallest possible window into how machines represent text, and everything from serial protocols to C string handling still runs on it.
One letter, one number
ASCII assigns every character a code from 0 to 127. The blocks are memorably laid out: space is 32, punctuation runs from 33 (!) through 47 (/), digits occupy 48–57 (so 0 is 48), uppercase letters sit at 65–90 (A is 65), and lowercase at 97–122 (a is 97). That layout is why Hi! becomes 72 105 33 — H is the eighth uppercase letter (64 + 8 = 72), i is the ninth lowercase letter (96 + 9 = 105), and ! is the first printable punctuation mark (32 + 1 = 33). If you want the whole map at a glance rather than one character at a time, the ASCII Table lays out all 128 codes.
Text to codes, and back again
Converting forward takes each character and reports its code point. Hi! yields 72 105 33 — and alongside the decimal form you get hexadecimal, 0x48 0x69 0x21, which is the form debuggers, memory dumps, and protocol documentation prefer. Going the other direction is the same table read backwards: feed in 72 101 108 108 111 and out comes Hello, because 72 is H, 101 is e, and 108 is l — twice. Numbers can be separated by spaces or commas, so 72,101,108 works just as well.
Decimal or hex: the 0x prefix
The same number has two everyday spellings, and the converter accepts both by looking at the prefix. A token starting with 0x is read as hexadecimal — 0x48 0x65 becomes He — while anything else is read as decimal. This matters because 0x48 (72 in decimal) and plain 48 are different characters: 72 is H, but 48 is the digit 0. Mixing notation in one input is fine, since each token is parsed independently. When in doubt, remember that hex is just decimal in base 16, a relationship How Text Encoding Works builds on when it explains why one character can cost one byte or four.
Where ASCII ends and Unicode begins
Strictly speaking, ASCII stops at 127. Type é and you get 233; type an emoji and you get a number in the tens of thousands. Those are Unicode code points, not ASCII codes — ASCII is simply the first 128 entries of the much larger Unicode catalog, unchanged, which is exactly why this converter's output stays meaningful past the ASCII range. The conversion itself uses code points rather than the 16-bit units JavaScript strings are made of, so characters outside the "astral plane gap" still come out as one clean number instead of two confusing halves.
Why anyone still does this by hand
Because the numbers keep leaking into real work. Serial devices and embedded hardware log bytes, not letters; wire protocols specify fields in numeric codes; escape sequences in terminals are written as hex; and a corrupted file that shows 48 65 6C 6C 6F only becomes readable once someone decodes it. Being able to flip between the character view and the number view — in either direction, in either base — turns opaque hex dumps into sentences and turns "why does my device send 72?" into "oh, it's saying H".
Try it yourself
Type your name into the ASCII Text Converter and check the result against your intuition — your uppercase initials should land in the 60s, lowercase in the 90s. Then reverse it: paste the codes back and watch the text reappear. For browsing rather than converting, the ASCII Table shows every code with its character and hex form, and the Binary Converter takes the next step down, showing how those same numbers look as raw bits.