ASCII table
All 128 codes, with the control characters explained rather than left as blank cells.
To see a whole string in binary, hex and UTF-8 bytes at once, use the text to binary converter.
Control characters (0–31)
| Dec | Hex | Binary | Abbr | Name |
|---|---|---|---|---|
| 0 | 0x00 | 00000000 | NUL | Null |
| 1 | 0x01 | 00000001 | SOH | Start of Heading |
| 2 | 0x02 | 00000010 | STX | Start of Text |
| 3 | 0x03 | 00000011 | ETX | End of Text |
| 4 | 0x04 | 00000100 | EOT | End of Transmission |
| 5 | 0x05 | 00000101 | ENQ | Enquiry |
| 6 | 0x06 | 00000110 | ACK | Acknowledge |
| 7 | 0x07 | 00000111 | BEL | Bell |
| 8 | 0x08 | 00001000 | BS | Backspace |
| 9 | 0x09 | 00001001 | HT | Horizontal Tab |
| 10 | 0x0A | 00001010 | LF | Line Feed |
| 11 | 0x0B | 00001011 | VT | Vertical Tab |
| 12 | 0x0C | 00001100 | FF | Form Feed |
| 13 | 0x0D | 00001101 | CR | Carriage Return |
| 14 | 0x0E | 00001110 | SO | Shift Out |
| 15 | 0x0F | 00001111 | SI | Shift In |
| 16 | 0x10 | 00010000 | DLE | Data Link Escape |
| 17 | 0x11 | 00010001 | DC1 | Device Control 1 (XON) |
| 18 | 0x12 | 00010010 | DC2 | Device Control 2 |
| 19 | 0x13 | 00010011 | DC3 | Device Control 3 (XOFF) |
| 20 | 0x14 | 00010100 | DC4 | Device Control 4 |
| 21 | 0x15 | 00010101 | NAK | Negative Acknowledge |
| 22 | 0x16 | 00010110 | SYN | Synchronous Idle |
| 23 | 0x17 | 00010111 | ETB | End of Transmission Block |
| 24 | 0x18 | 00011000 | CAN | Cancel |
| 25 | 0x19 | 00011001 | EM | End of Medium |
| 26 | 0x1A | 00011010 | SUB | Substitute |
| 27 | 0x1B | 00011011 | ESC | Escape |
| 28 | 0x1C | 00011100 | FS | File Separator |
| 29 | 0x1D | 00011101 | GS | Group Separator |
| 30 | 0x1E | 00011110 | RS | Record Separator |
| 31 | 0x1F | 00011111 | US | Unit Separator |
Printable characters (32–126)
Delete (127)
| 127 | 0x7F | 01111111 | DEL | Delete |
Why the table is laid out this way
ASCII is seven bits, giving 128 codes, and almost none of the arrangement is arbitrary. Three decisions are worth knowing because they are still exploited in code today.
Digits start at 48. The low four bits of each digit code are the digit's own value, so c - '0' converts a character to a number, and c & 0x0F does the same with a mask. Every parser ever written relies on this.
Capitals and lowercase are 32 apart. A is 65 and a is 97; Z is 90 and z is 122. Thirty-two is a single bit, so c ^ 32 flips case and c | 32 forces lowercase. This is why case-insensitive comparison used to be free.
Control characters map to Ctrl plus a letter. The Ctrl key originally cleared the top two bits of the keyboard code. C is 67, so Ctrl+C sends 3, which is ETX, end-of-text. That is the entire reason Ctrl+C interrupts a program, Ctrl+D signals end-of-file, and Ctrl+G makes the terminal beep.
The control characters that still matter
| Code | Name | Why you still meet it |
|---|---|---|
| 0 | NUL | Ends a C string. A NUL in your data truncates it silently. |
| 9 | Tab | Its width is a display convention, not a property of the character. |
| 10 | LF | The Unix line ending, and half of the Windows one. |
| 13 | CR | The other half. CR alone lets a progress bar overwrite its own line. |
| 27 | ESC | Starts every ANSI escape sequence — all terminal colour and cursor movement. |
| 127 | DEL | What most terminals actually send for the Backspace key. |
ASCII, Latin-1 and UTF-8
ASCII defines only 0–127. Everything above that — accented letters, currency symbols, anything non-English — belongs to some other encoding, and the confusion between them is where mojibake comes from.
UTF-8 was designed so that its first 128 code points are byte-for-byte identical to ASCII. Any ASCII file is already valid UTF-8, which is the single reason UTF-8 won: existing files and existing C code kept working unchanged. Characters above 127 become two to four bytes, each with its high bit set, so they can never be mistaken for an ASCII character.
That is why a UTF-8 file read as Latin-1 shows é where é should be: the two bytes of the UTF-8 encoding are being displayed as two separate Latin-1 characters. The bytes are correct; the interpretation is not.