ASCII Table
Full ASCII code table from 0 to 127 in decimal, hexadecimal, octal and binary. Search by character or code, UTF-8 mapping explained, with practical examples.
Why an ASCII code table still matters
The ASCII table is a reference of 128 codes mapping each number from 0 to 127 to a character: Latin letters, digits, punctuation marks and 33 control commands such as newline. The standard first appeared in 1963 and still underlies everything a screen prints. It saves you when a log shows an odd symbol and you need to know what code 10 or 27 means, when you write escape sequences in C and forget which letter has which number, or when a programming exercise asks you to break a string into codes. Search works both ways here: find the code from a character, or the character from a code.
What the reference offers
- Shows all 128 codes at once in four notations: DEC, HEX, OCT and BIN, grouped into control and printable ranges
- Searches by character, decimal code, hexadecimal 0x41, octal 101, or by name such as LF and ESC
- Clicking any table row copies the decimal code to the clipboard
- Converts any typed character to DEC, HEX, OCT and BIN, including code points outside ASCII
- Explains separately how ASCII codes become UTF-8 bytes
How to find the code you need
- Type a code or a character into the search field — the table filters immediately
- Write the code any way you like: 65, 0x41, octal 0101, or just the letter A
- Click the matching row to copy the decimal code
- For an arbitrary character use the top field — it shows every notation including binary
How the table is built
ASCII encodes characters in seven bits: two to the seventh power gives 128 values, enough for the whole Latin alphabet in both cases, ten digits, punctuation and service commands. The range 0–31 plus code 127 belongs to control characters — they have no glyph, only a short name like NUL, LF or ESC. The range 32–126 holds the printable part, from space at code 32 to tilde at 126. Every code appears in decimal, hexadecimal, octal and binary: hexadecimal is convenient because one byte is exactly two hex digits, octal survives in C syntax, and binary shows what each individual bit is responsible for.
The ASCII codes you meet most often
| Code DEC and HEX | Character | What it means |
|---|---|---|
| 9, 0x09 | HT | horizontal tab, \t in code |
| 10, 0x0A | LF | line feed, \n on most systems |
| 13, 0x0D | CR | carriage return, \r; Windows ends lines with CR+LF |
| 27, 0x1B | ESC | start of a terminal escape sequence |
| 32, 0x20 | space | the most frequent printable character in text |
| 48–57, 0x30–0x39 | 0–9 | digits run in order; subtract 48 from the code |
| 65–90, 0x41–0x5A | A–Z | uppercase Latin letters in order |
| 97–122, 0x61–0x7A | a–z | lowercase: uppercase code plus 32 |
| 34, 0x22 | " | double quote, delimits strings in JSON |
| 92, 0x5C | \ | backslash, starts an escape sequence |
| 126, 0x7E | ~ | the last printable character of the table |
| 127, 0x7F | DEL | delete, the only control code after 31 |
Ranges 48–57, 65–90 and 97–122 are shown by their boundaries: inside each one the codes run without gaps, so between A and C there are always exactly two steps.
Where the ASCII table actually helps
The first mass of tasks is logs and protocols. In HTTP every header line ends with the byte pair 13 and 10, and until you know that, traffic between a client and a server looks like a pile of random symbols. In telemetry and exchanges with microcontroller devices, data often arrives as raw bytes: without the table you cannot tell whether 0x0A inside the stream is a separator or whether 0x1B opens a terminal command. Even parsing a CSV with an odd delimiter boils down to the question "what is the character with code 9", and the answer takes one search.
The second mass of tasks lives in programming. Escape sequences in C, Python and JavaScript are codes from this table: \n, \t, \r, \0. Comparing characters by code drives sorting: digits come before uppercase letters, uppercase before lowercase, and that is not a whim but a direct consequence of code order. Character-by-character parsing, input validation, hunting for unprintable characters in data — all of it leans on the ranges 0–31 and 32–126. Computer science exercises that ask you to turn a word into codes and back use the same table, and the underlying theory pairs well with the article on binary code.
- Log analysis: what the byte 0x0A or 0x1B inside a stream means
- Protocols: CR+LF in HTTP, delimiters on serial ports
- Code: escape sequences \n, \t, \r and the NUL that ends C strings
- Sorting: why digits sort before letters and uppercase before lowercase
- Study tasks: convert a word to codes and rebuild it
- Debugging: finding unprintable characters that break string comparison
Typical mistakes when working with codes
The most common mistake is mixing number systems. The numbers 65, 0x41 and 101 describe the same code, but read differently: 65 is decimal, 41 after 0x is hexadecimal, 101 is octal. Someone who sees byte 0x41 in a log sometimes looks up row 41 in the table and finds the wrong character: code 41 in decimal is a closing parenthesis. The rule is simple: determine the base first, then search. Hex is always recognizable by the letters A–F in the notation or by the 0x prefix.
The second mistake is extending the table to Cyrillic. The Russian capital А looks like the Latin A, but its Unicode code is U+0410, and in UTF-8 it takes the two bytes D0 90. String comparisons fail for exactly this reason when one letter is typed on a Latin layout and the other on a Cyrillic one, even though the text looks identical on screen. The related confusion is "a character equals a byte": in UTF-8 that holds only for the ASCII range, and a single emoji can take four bytes. To check what a file actually contains, start with the encoding detector.
- 65, 0x41 and 101 are one code in three bases, not three different codes
- Cyrillic is outside 0–127: the Russian А is U+0410, not 65
- In UTF-8 a character above 127 takes two or more bytes
- Space has code 32, not 0, and it is a printable character too
- CR and LF are two different codes: Windows pairs them, Unix uses LF alone
- DEL is 127, not 8: code 8 is backspace, moving one character left
Worked example: the letter A from code to byte
Take the uppercase Latin A and follow it through the table. The decimal code is 65, hexadecimal 0x41, octal 101, binary 01000001. All four notations describe the same byte content. In binary, two bits are set: the one weighted 64 and the one weighted 1, and 64 plus 1 gives exactly 65. The highest bit is zero — the code falls into the first 128 values, so the character is guaranteed to be in the table. The bit-level view also explains case switching: lowercase a is written 01100001, differing from the uppercase by the single bit weighted 32, which is why 65 plus 32 equals 97.
The same method works for any character in the table. Lowercase a differs from uppercase by exactly one bit: 01100001 versus 01000001. The digit 0 is 00110000, so all digits occupy 48–57 in a row. Space is 00100000: the only set bit is weighted 32, and the code of space really is 32. Below is a summary for the characters people come back to most.
Codes of frequent characters in every notation
| Character | DEC | HEX and OCT |
|---|---|---|
| A | 65 | 0x41, octal 101 |
| a | 97 | 0x61, octal 141 |
| 0 | 48 | 0x30, octal 060 |
| space | 32 | 0x20, octal 040 |
| LF (\n) | 10 | 0x0A, octal 012 |
| CR (\r) | 13 | 0x0D, octal 015 |
| ESC | 27 | 0x1B, octal 033 |
| DEL | 127 | 0x7F, octal 177 |
ASCII uses seven of the eight bits in a byte, so in pure ASCII the highest bit of every byte is zero; the eighth bit was historically reserved for parity checking.
ASCII among other ways of writing data
A code table is the bridge between text and numbers. From there numbers move freely between bases: 0x41 becomes 65 and 01000001, and every step of that is handled by the base converter. For long byte sequences, a binary translator works better than a table — it breaks a string into ones and zeros character by character, covered in more detail in the article on binary code. When bytes need to travel inside text, they get packed into Base64, where every three bytes become four characters; the mechanics are explained in the plain-language guide to Base64.
It helps to keep the limits in view too. ASCII covers only Latin letters with digits and signs: every other language needs other Unicode codes, arbitrary byte sequences need hex dumps, and files of unknown origin need an encoding check first. But because UTF-8 preserved all 128 codes as they were, the table remains a working tool rather than a museum piece: any byte below 128 you will decode from it as confidently as in 1963.
- ASCII codes are the first 128 Unicode code points, with no deviations
- A hex dump reads in digit pairs: each pair is one byte
- A separate converter handles numbers between any bases
- Base64 is not a character encoding but a way to pack bytes into text
- Mojibake usually means a re-encoding mismatch, not broken data
Frequently asked questions
What is ASCII and how many characters does it have
How do control characters differ from printable ones
Why is A 65 while a is 97
How do ASCII and UTF-8 relate
What do NUL, LF, CR and ESC mean
How do I convert a code from HEX to a character
Why does the table include octal codes
When does the ASCII table stop helping
Related articles
Related tools
Regex Tester & Debugger
Test regular expressions with match highlighting, groups, and common patterns
HTML Meta Tag Generator
Generate SEO-optimized HTML meta tags for your website
cURL to Code Converter
Convert cURL commands to JavaScript, Python, and PHP code
QR Code Generator
Generate QR codes from text or URLs with customizable colors and size
Cron Expression Parser
Parse cron expressions into human-readable descriptions and see next execution dates
Invoice Generator
Fill in the invoice, then print it or save as PDF — everything stays in your browser.
Aspect Ratio Calculator
Simplify width and height to a ratio and resize keeping proportions.
A4 Aspect Ratio Calculator
A4 aspect ratio, print pixel sizes at any DPI, and pixels back to centimeters