ASCII Table
Type a character or a code — get every representation, with the full 0-127 chart below.
One character (A), a decimal code (65), or hex (0x41 / U+0041).
Full ASCII table (0-127)
Control characters (0-31, 127)
Printable characters (32-126)
How to read an ASCII table
ASCII assigns a number to 128 characters, and every row above shows the same character in the notations you actually meet in code: decimal (65), hexadecimal (0x41), octal (101), binary (01000001) and the HTML entity (A). All of them fit in a single byte, because 127 needs only seven bits with one to spare. The table splits into two halves for a reason: codes 0 to 31 plus 127 are control characters that tell a device to do something, while 32 to 126 are the printable glyphs on your keyboard.
The case bit: why A is 65 and a is 97
Look at the binary column. A is 01000001 and a is 01100001. Exactly one bit differs — the one worth 32. That was deliberate: the 1963 committee placed the uppercase block at 65-90 and the lowercase block at 97-122 so that hardware could change case by flipping a single bit. It still shows up in working code: c | 32 lower-cases an ASCII letter, c & 0xDF upper-cases it, and c ^ 32 toggles it. Digits got the same treatment at 48-57, where the low four bits are the digit value, so c - 48 turns a digit character into its number with no lookup table at all.
Control characters and the line-endings war
Codes 10 and 13 are the two most consequential numbers in the chart. Line feed (LF, 10) moves down one line; carriage return (CR, 13) returns to the left margin. Teletypes needed both, so Windows kept CRLF while Unix, macOS and the web settled on a bare LF. That is why a file edited on two platforms shows every line as changed in a diff, why a shell script dies with "bad interpreter: /bin/bash^M", and why Git ships core.autocrlf. Other survivors: NUL (0) terminates strings in C, tab is 9, bell (7) still beeps some terminals, and escape (27) opens the ANSI sequences that colour CLI output.
Lookup workflows this chart is for
Three come up constantly. First, reading a hex dump: you see 48 65 6C 6C 6F and want to confirm it says Hello — 0x48 is H, 0x65 is e, 0x6C is l twice, 0x6F is o. Second, writing a validator: "letters and digits only" becomes the ranges 48-57, 65-90 and 97-122, and it is far easier to get right when you can see the gaps at 58-64 and 91-96 sitting between them. Third, sanitising input: you strip everything below 32 except tab, LF and CR, because those are the bytes that quietly break CSV files, log lines and database columns.
A worked debugging example
A CSV import keeps failing on one row. You paste the offending cell here and find code 160 where you expected 32 — a non-breaking space pasted from a web page, not the space bar. Because it is above 127 the tool flags it as outside ASCII and shows U+00A0. In Latin-1 and Windows-1252 that single byte is NBSP, but in UTF-8 the same character is two bytes (0xC2 0xA0), which is exactly why the parser saw junk. The fix is a targeted replace of U+00A0, not a looser delimiter rule. That is the shape of nearly every encoding bug: an ordinary-looking character carrying a code point that two parts of the pipeline disagree about.
Quick reference points worth memorising
Space is 32, the lowest printable code. Digit 0 is 48, so 7 is 55. Uppercase A is 65 and Z is 90; lowercase a is 97 and z is 122. The at sign is 64, just below A, and the backtick is 96, just below a — the same 32 offset again. DEL is 127, the last code, and it was 127 rather than 0 because on punched tape you erased a character by punching every hole, which is 1111111 in binary.
Where ASCII stops
Codes 128 to 255 are not ASCII. They belong to whichever code page a file assumes, and Latin-1, Windows-1252 and CP437 disagree about the same byte — which is how one system's document becomes another's mojibake. Unicode ended the argument by giving every character a permanent code point, and UTF-8 encodes the first 128 of them as the identical single bytes ASCII always used. So this chart stays exactly right for 0-127 forever. Past that, ask for the Unicode code point rather than an "extended ASCII" code: paste any character above 127 into the lookup and you get U+XXXX, which is the value that means the same thing on every machine you will ever send it to.
Sources & further reading
- RFC Editor, RFC 20 — the ASCII character set as standardised for network use
- Unicode Consortium — code charts covering U+0000-U+007F and every character beyond ASCII
- MDN Web Docs — ASCII, character encodings and HTML entity references for developers
- ISO — ISO/IEC 646, the international standard aligned with 7-bit ASCII
Frequently asked questions
Is ASCII the same as Unicode or UTF-8?
No, but they line up at the start. ASCII defines 128 codes (0-127), and the first 128 Unicode code points are identical to them, which is why UTF-8 stores every ASCII character as the exact same single byte. Above 127 they part company: ASCII stops there, Unicode continues to 1,114,111.
What are ASCII control characters used for?
Codes 0-31 and 127 are commands, not glyphs. Line feed (10) and carriage return (13) still end lines today — Unix uses LF, Windows uses CRLF, and mixing them is the classic diff-noise bug. NUL (0) terminates strings in C, tab is 9, and escape (27) opens the colour sequences your terminal prints.
Why is A 65 and a 97?
The alphabet blocks were placed exactly 32 apart: uppercase at 65-90, lowercase at 97-122. That gap is a single bit, so flipping the value 32 switches case — 'A' | 32 gives 'a' and 'a' & ~32 gives 'A'. Digits sit at 48-57 for the same kind of reason: their low four bits are the digit value.
When do I need an HTML entity instead of the character?
Only a few characters must be escaped in HTML: less-than (<), greater-than (>) and ampersand (&), plus the double quote (") and apostrophe (') inside attribute values. Everything else can be typed literally as long as the page is served as UTF-8. The numeric form A works for any code point you cannot type.