What ASCII is
ASCII, the American Standard Code for Information Interchange, gives a number to each of 128 characters: the letters A to Z in both cases, the digits, punctuation, the space and 33 control codes. It was first published in 1963, revised in 1967 and last updated in 1986, and Unicode, which most text uses today, starts with the same 128 codes.
The codes run from 0 to 127, which fits in seven bits. Computers store each one in an eight-bit byte, so the table shows eight binary digits with a leading 0.
How to read the table
- Dec is the code as an ordinary number.
- Hex is the same number in hexadecimal, often written 0x41 or 41h.
- Binary is how the byte is stored: 01000001 for A.
- Char is the character. The shaded rows are control characters, which have no symbol and are shown by their short name.
Type in the Find box to jump to a character, a code in decimal, hex (0x41) or binary, or a control character's name such as tab. To turn whole words into these codes, use the binary translator.
Patterns worth knowing
- Digits are 48 to 57, so a digit's value is its code minus 48, and in hex 0x30 to 0x39.
- Uppercase letters are 65 to 90 and lowercase 97 to 122. Each lowercase letter is its capital plus 32, one bit (00100000), so changing case flips a single bit.
- Space is 32, the first printable character, and ~ at 126 is the last. That makes 95 printable characters, space included.
- Control key combinations follow the letters: holding Ctrl takes 64 off the letter's code, so Ctrl+G is 7 (bell), Ctrl+H is 8 (backspace), Ctrl+I is 9 (tab) and Ctrl+M is 13 (carriage return).
- DEL is 127, all seven bits set. On paper tape it was used to punch out every hole over a mistake, so the reader would skip it.
Control characters
Codes 0 to 31 and 127 were made to control teleprinters and terminals rather than to print. Most are rarely used now, but a few are everywhere: tab (9), line feed (10), carriage return (13) and escape (27). Windows ends a line of text with a carriage return and a line feed, while macOS and Linux use the line feed alone.
| Dec | Name | Meaning |
|---|---|---|
| 0 | NUL | Null |
| 1 | SOH | Start of heading |
| 2 | STX | Start of text |
| 3 | ETX | End of text |
| 4 | EOT | End of transmission |
| 5 | ENQ | Enquiry |
| 6 | ACK | Acknowledge |
| 7 | BEL | Bell |
| 8 | BS | Backspace |
| 9 | HT | Horizontal tab |
| 10 | LF | Line feed |
| 11 | VT | Vertical tab |
| 12 | FF | Form feed |
| 13 | CR | Carriage return |
| 14 | SO | Shift out |
| 15 | SI | Shift in |
| 16 | DLE | Data link escape |
| 17 | DC1 | Device control 1 (XON) |
| 18 | DC2 | Device control 2 |
| 19 | DC3 | Device control 3 (XOFF) |
| 20 | DC4 | Device control 4 |
| 21 | NAK | Negative acknowledge |
| 22 | SYN | Synchronous idle |
| 23 | ETB | End of transmission block |
| 24 | CAN | Cancel |
| 25 | EM | End of medium |
| 26 | SUB | Substitute |
| 27 | ESC | Escape |
| 28 | FS | File separator |
| 29 | GS | Group separator |
| 30 | RS | Record separator |
| 31 | US | Unit separator |
| 127 | DEL | Delete |
What about codes 128 to 255?
ASCII stops at 127. The “extended ASCII” charts that fill 128 to 255 are other standards that added their own characters there, and they do not agree: ISO 8859-1 (Latin-1), Windows-1252 and the original IBM PC's code page 437 all put different characters on the same numbers. Today most text is Unicode, written as UTF-8, where 128 to 255 are not characters on their own but parts of the two- to four-byte codes for everything beyond ASCII. Because UTF-8 keeps ASCII's single bytes unchanged, plain ASCII text is also valid UTF-8.
Printing the ASCII table
Press Print the table for the whole chart on one page, four columns of 32 codes. Choose Save as PDF in the print window to keep a copy.
Frequently asked questions
How many characters are in ASCII?
128, numbered 0 to 127. 95 of them are printable (letters, digits, punctuation and the space) and 33 are control characters.
What is the ASCII code for A?
65 in decimal, 41 in hex and 01000001 in binary. Lowercase a is 97, hex 61, binary 01100001.
What is the ASCII code for a space?
32, hex 20, binary 00100000.
Is ASCII 7-bit or 8-bit?
ASCII is a 7-bit code: 128 characters need seven bits. Computers keep each character in an 8-bit byte with the first bit set to 0.
What is the difference between ASCII and Unicode?
ASCII has 128 characters, enough for English. Unicode covers the world's writing systems and emoji, and its first 128 characters are ASCII with the same numbers. In UTF-8, the usual way to store Unicode, those 128 still take one byte each.
What is extended ASCII?
A name for 8-bit character sets that use codes 128 to 255 for extra characters. There are several, such as Latin-1, Windows-1252 and code page 437, and they disagree about which character goes where, so there is no single extended ASCII table.
Can I print the ASCII table?
Yes. Press Print the table to get all 128 codes on one page.