By Maya Chen, lettering designer and type educator · Checked by Jordan Hale · · How we review content
Key facts
- ASCII has 128 characters, numbered 0 to 127, which fit in 7 bits: 95 printable (codes 32 to 126) and 33 control codes (0 to 31 and 127).
- ASCII was first published by the American Standards Association in 1963 as X3.4-1963, and revised in 1967 and 1986 (ANSI X3.4-1986).
- Capital letters sit at codes 65 to 90 and small letters at 97 to 122, exactly 32 higher, so changing case flips a single bit.
- Digits 0 to 9 are codes 48 to 57, so subtracting 48 gives the digit's value.
- Code 3 is what Ctrl+C sends, shown as ^C in terminals, because Ctrl plus the letter 64 higher gives the control code.
- The first 128 Unicode code points (U+0000 to U+007F) are exactly ASCII, so ASCII text is also valid UTF-8.
Which part of the table do I need?
Jump to the printable characters (codes 32 to 126) to copy a symbol or look up a letter, and to the control characters (0 to 31 and 127) for Ctrl combinations and line endings.
How do I read the ASCII table?
Each row is one code. Dec is the number in decimal, Hex in hexadecimal (base 16, as in 0x41 or \x41), Oct in octal (base 8, still used in some Unix tools) and Binary as the 7 bits ASCII uses. The HTML column shows the named entity where HTML has one, such as & for &, otherwise the numeric form A, which works for any character.
For control characters, Escape is the backslash sequence used in C, JavaScript, Python and many other languages, and Caret is how terminals show them: ^C is code 3, which is what Ctrl+C sends.
Which patterns in the table are worth knowing?
| Range | What | Trick |
|---|---|---|
| 48–57 | Digits 0–9 | Subtract 48 to get the digit’s value |
| 65–90 | Capital letters | Add 32 for the lowercase letter |
| 97–122 | Small letters | Subtract 32 for the capital |
| 0–31, 127 | Control codes | Ctrl plus the letter 64 higher, so Ctrl+G is 7, the bell |
How does ASCII relate to ASCII art and other codes?
Every piece of ASCII art, with its galleries of pieces to copy, in the strict sense uses only the 95 printable characters in the first table, which is why it works in any terminal and any plain text file. Lines and boxes beyond -, | and + come from Unicode’s box drawing characters. Windows Alt codes are a different system, based on old code pages rather than ASCII alone; the alt codes page searches them by symbol and shows how to type them on a numpad or a Mac.
Sources: ASCII was first published by the American Standards Association in 1963 as X3.4-1963 and revised in 1967 and 1986 (ANSI X3.4-1986). Character names in the ASCII table come from the Unicode Character Database, which uses ASCII’s 128 characters for its first 128 code points.
Frequently asked questions
Basics
How many characters are in ASCII?
What is extended ASCII?
What is the difference between ASCII and Unicode?
What is the ASCII code for a space?
What do the control characters do?
When was ASCII published?
Where it works
How do I type an ASCII character that is not on my keyboard?
Is ASCII art made from this table?
How it works
How do I find the ASCII code for a character?
What is the HTML code for an ASCII character?
& for the ampersand. Every other character has the numeric form A, where 65 is the decimal code, and it works for any character. The numeric form is the one to rely on when you are unsure whether a name exists.