ASCII Table
Browse all 128 ASCII characters with their codes
| Dec | Hex | Oct | Bin | Char | Name |
|---|
Character Details
The ASCII Table is an interactive reference for all 128 characters in the 7-bit American Standard Code for Information Interchange. Every row shows the decimal, hexadecimal, octal, and binary value of a character, along with its name. It is designed for the moments when you need to know that a space is 32, that A is 65, or which code is quietly breaking your parser, without opening a language runtime to check.
How to Use
The full table of 128 rows is scrollable, and category filters narrow it to control characters, digits, uppercase letters, lowercase letters, or punctuation. The search box accepts a value in any of the displayed bases, a control-character name such as ESC, or a literal character such as A.
- Type
65to jump to the capitalA. - Type
41to find the same character by hex. - Type
NLorLFto find the line feed. - Pick the control filter to see only codes 0-31 and 127.
Results keep the table’s original order, so a search is a highlight rather than a re-sort.
Reading a Row
Each row has six columns. Take the capital letter A:
| Field | Value |
|---|---|
| Character | A |
| Decimal | 65 |
| Hex | 41 |
| Octal | 101 |
| Binary | 1000001 |
| Category | uppercase |
Three more useful rows:
| Char | Dec | Hex | Oct | Binary |
|---|---|---|---|---|
| (space) | 32 | 20 | 040 | 0100000 |
a | 97 | 61 | 141 | 1100001 |
| LF | 10 | 0A | 012 | 0001010 |
The relationship between the cases is worth memorising: lowercase letters are exactly 32 above their uppercase counterparts, so a (97) minus A (65) is 32, and converting case is a matter of adding or subtracting that offset.
The Four Ranges of the Table
The 128 codes are not uniform. The categories the tool uses are:
- Control, 0-31 and 127 — historically drove teletypes and printers; today used for line endings, tabs, and escape sequences.
- Punctuation and symbols, 32-47, 58-64, 91-96, 123-126 — the space plus everything that is not a letter or digit.
- Digits, 48-57 —
0through9in order, so'7' - '0'gives the integer 7 in C-like languages. - Uppercase 65-90, lowercase 97-122 — two contiguous alphabetic blocks.
The grouping is a historical design choice rather than a strict rule, which is why the punctuation codes are scattered in gaps between the letter and digit blocks.
Control Characters You Still Use
Most of the control block is obsolete, but a handful appear in real files and configs every day:
| Code | Hex | Name | Modern use |
|---|---|---|---|
| 0 | 00 | NULL | String terminators in C, padding |
| 7 | 07 | BEL | Terminal bell |
| 8 | 08 | BS | Backspace |
| 9 | 09 | TAB | Indentation, TSV files |
| 10 | 0A | LF | Unix/macOS line ending |
| 12 | 0C | FF | Form feed, page breaks |
| 13 | 0D | CR | Part of Windows CRLF |
| 27 | 1B | ESC | ANSI escape sequences |
| 127 | 7F | DEL | Delete |
If you have ever opened a CSV and seen ^M at the end of each line, that is a CR (13) left over from a Windows-produced file.
How ASCII Fits Inside UTF-8
The reason this table stops at 127 is that everything above it belongs to a different encoding. UTF-8 was designed so that its first 128 code points are byte-for-byte identical to ASCII: U+0041 A is the single byte 0x41, exactly as shown here. Above that range, UTF-8 uses two, three, or four bytes per character, and the first byte always has its high bit set.
A concrete example: the character é is U+00E9, which UTF-8 stores as the two bytes 0xC3 0xA9. Neither byte is an ASCII code, even though the sequence renders as one letter. That distinction matters when you are scanning a file for control bytes. In valid UTF-8, every byte from 0x00 to 0x7F is exactly the ASCII character listed in this table, while any byte of 0x80 or higher is part of a multi-byte sequence or an invalid byte.
Older single-byte encodings such as ISO-8859-1 (Latin-1) do map bytes 128-255 directly to accented characters, which is why a file can look correct in one editor and garbled in another. This table deliberately covers only the 7-bit range, so a value of 130 or higher tells you the data is not plain ASCII.
Common Mistakes
- Confusing a byte with a code point. An ASCII code is a number from 0 to 127. The fact that it is often padded into an 8-bit byte does not mean bit 8 is part of ASCII.
- Assuming octal has no leading zero. The
printfescape\101means octal 101 = decimal 65 =A. The table pads octal values to three digits for exactly this reason. - Mixing up CR and LF when generating line endings. Writing only CR, or LF where CRLF is expected, can break Windows tools and produce text that all appears on one line.
- Treating code-page characters as ASCII. Bytes 128-255 (accented letters, smart quotes) are not ASCII; they belong to extensions such as Latin-1 or Windows-1252 and require a different lookup.
Use Cases
- Debugging text where an invisible control character is breaking a parser or a diff.
- Learning how character codes relate to their integer values, and why
'A'is 65. - Writing shell
printforecho -eescape sequences and needing the octal or hex form. - Checking the exact byte that separates columns in TSV (TAB, 9) versus CSV (comma, 44).
- Verifying that a file is plain ASCII before shipping it to a system that cannot handle Unicode.
Related Tools
Frequently Asked Questions
Why does the binary column show seven digits instead of eight?
Because ASCII is a 7-bit encoding. Codes 0 through 127 fit in seven bits, so the binary column pads to seven digits: A is 1000001, not 01000001. When ASCII text is stored in 8-bit bytes, the leading bit is left at 0, which is why you sometimes see the 8-digit form 01000001.
What is the difference between CR (13) and LF (10)?
CR (carriage return) moves the cursor to the start of the line; LF (line feed) moves it down one line. Unix and modern macOS use LF alone to end a line, Windows uses the pair CRLF, and classic Mac OS used CR alone. A stray CR is a common cause of text that looks like one long line or shows odd characters when parsed.
Why is DEL at code 127 and not next to the other control characters?
DEL sits at the top of the 7-bit range because it was designed to erase a character punched into paper tape by punching out every hole. That is also why it is grouped as a control character even though its numeric value is separated from the 0-31 block.
How do I look up a character by its hex or decimal code?
Use the search box. Exact matches are prioritised in this order: hex value, decimal value, control name, then the literal character, with substring matches returned afterwards. Typing 41 returns A, and typing 0A returns the line feed character.
Is ASCII the same thing as UTF-8?
No, but they overlap exactly for the first 128 characters. ASCII maps codes 0-127 to single values; UTF-8 is a variable-length Unicode encoding that uses the same byte values for those 128 code points and then uses multiple bytes for everything above them. This is why an ASCII file is always valid UTF-8, but not the reverse.
Which ASCII codes produce a visible character?
Codes 32 through 126 are printable, which is 95 characters: the space at 32, digits 48-57, uppercase letters 65-90, lowercase letters 97-122, and the punctuation and symbol characters in between. Codes 0-31 and 127 are control characters that do not print a glyph.
Reviewed by the HandyTools Hub team · Last updated