Free tool · no sign-up
ASCII table
All 128 characters with their decimal, hex, octal and binary values — searchable, so you can go straight from 0x1b or ^C to the answer.
Type what you have — a decimal like 27, a hex value like 0x1b, an octal like 033, eight binary digits, the character itself, a caret form like ^C, or part of a name like “tab” — and the table narrows to the row you want.
Every row carries all four bases plus, for the control characters, the abbreviation, the C escape, the key combination that sends it and what it actually does. That last column is the part a reference table usually leaves out and the part you were probably looking for.
What ASCII is, and what it is not
ASCII defines 128 characters, numbered 0 to 127, using 7 bits. 33 of them are control characters that do something rather than print something; the other 95 are the space, the digits, the unaccented Latin letters and the punctuation on a US keyboard. That is the whole set — there is no ASCII for é, £ or €.
What people usually mean by “extended ASCII” is one of many incompatible 8-bit sets that fill in 128-255 differently: Latin-1, Windows-1252, KOI8-R, the old DOS code pages. The same byte means different characters in each, which is the original source of garbled text. UTF-8 replaced all of them and was deliberately built so that the bytes 0-127 are still exactly ASCII — which is why every ASCII file is already a valid UTF-8 file.
The control characters still in daily use
Most of the 33 control codes were for teleprinters and tape and are now historical. About a dozen are not, and they are the ones you meet at a terminal.
- 9 (HT, \t) and 32 (space) — the distinction that breaks Makefiles and YAML files.
- 10 (LF, \n) and 13 (CR, \r) — Unix ends a line with LF alone, Windows with CR then LF. A stray \r is what puts ^M at the end of every line.
- 27 (ESC, \e) — begins every ANSI sequence, so every colour, every cursor move and every progress bar in a terminal starts with byte 27.
- 3 (ETX, ^C) and 26 (SUB, ^Z) — interrupt and suspend. 4 (EOT, ^D) is not a character your program reads; it closes the input stream.
- 19 and 17 (XOFF ^S, XON ^Q) — flow control. Pressing Ctrl-S in a terminal freezes it, and Ctrl-Q unfreezes it, which has looked like a hung session to everyone at least once.
- 0 (NUL, \0) — ends a string in C, and is one of only two bytes a Unix filename may not contain. The other is 47, the slash.
The arithmetic worth remembering
The layout is not arbitrary, and a few relationships save you a lookup. The digits 0-9 are 48-57, so subtracting 48 from a digit's code gives its value. Capitals are 65-90 and lower case is 97-122, exactly 32 apart — one bit — so changing case is flipping bit 6, which is how toupper worked before locales.
Control characters are their printable partner with bit 7 cleared: ^C is C (67) minus 64, which is 3. That is what the caret notation means, and it is why Ctrl-[ and Escape are the same byte, and why Ctrl-I and Tab are the same byte.
Common questions
How many characters are in ASCII?
128, numbered 0-127 and fitting in 7 bits. 95 are printable (including the space) and 33 are control characters. Anything above 127 is not ASCII — it belongs to UTF-8 or to one of the older 8-bit code pages.
What is the ASCII value of A?
65 decimal, 0x41 hex, 0101 octal, 01000001 binary. Lower-case a is 97, exactly 32 higher, and the same holds for every letter.
What character is 0x1b or decimal 27?
Escape (ESC), written \e in a shell and ^[ as a key combination. It starts every ANSI escape sequence, so if you are looking at colour codes or cursor movement in a terminal, byte 27 is the first byte of each one.
Is ASCII the same as UTF-8?
For the first 128 characters, yes — identically the same bytes, by design. Above that UTF-8 uses two to four bytes per character while ASCII simply has nothing. So every ASCII file is valid UTF-8, but not the reverse.
What is the difference between ASCII and Unicode?
ASCII is a 128-character set. Unicode is a catalogue of more than 150,000 characters covering essentially every script, and UTF-8 is the usual way of writing Unicode as bytes. Unicode's first 128 code points are ASCII's characters in the same order.