An ASCII table lists the numeric codes that computers use for basic English letters, digits, punctuation and control signals. Whether you're debugging data, learning about character sets or writing low-level code, it's handy to have the value of a character at your fingertips. This ASCII table shows all 128 codes in decimal, hexadecimal, octal and binary. Type a character, a number or a word such as tab into the search box to narrow the list, or switch between printable characters and control codes. Everything is on one page and it updates instantly.
How to use the ASCII table
- Scroll the full table, or type in the search box.
- Search by character, such as A.
- Search by value, in decimal or hexadecimal.
- Search by name, such as carriage.
- Switch between All, Printable and Control.
What is ASCII?
ASCII is an acronym for American Standard Code for Information Interchange. It's a character encoding standard for representing a particular set of 95 printable characters and 33 control characters, for a total of 128 code points. It hugely influenced the design of the character sets used by modern computers. For example, the first 128 code points of Unicode are the same as ASCII.
How the codes are organized
| Range (decimal) | Contents |
|---|---|
| 0–31 | Control characters |
| 32 | Space |
| 33–47 | Punctuation and symbols |
| 48–57 | Digits 0 to 9 |
| 58–64 | More punctuation |
| 65–90 | Uppercase letters |
| 91–96 | More symbols |
| 97–122 | Lowercase letters |
| 123–126 | Final symbols |
| 127 | Delete |
A worked example
Look up the capital letter A. Its decimal value is 65, which is 41 in hexadecimal, 101 in octal and 1000001 in binary. The lowercase a is 97, which is exactly 32 higher. That difference isn't an accident. In binary, it means that a single bit separates uppercase and lowercase letters, which makes it simple for programs to convert between them.
Control characters
The first 32 codes, along with code 127, aren't meant to be displayed. They were designed to control devices such as printers and teletype machines. Most of these are now rarely used, but a few are still common. The control characters that you're most likely to meet are the following.
| Decimal | Name | Use |
|---|---|---|
| 9 | Horizontal Tab | Indents text |
| 10 | Line Feed | Starts a new line |
| 13 | Carriage Return | Returns to the start of a line |
| 27 | Escape | Begins terminal commands |
Why are there four number formats?
Each format suits different jobs. Decimal is the one that's most familiar to people. Hexadecimal is compact and maps neatly onto bytes, so it appears in code, in web colors and in memory dumps. Binary shows the actual bits that are stored. Octal is less common these days, but you'll still come across it in file permissions and some older programming contexts. All four are simply different ways of writing the same value.
ASCII, extended ASCII and Unicode
ASCII only uses 7 bits, which gives 128 values, and that's not enough for accented letters, other alphabets or emoji. Various 8-bit extensions added another 128 characters, but they weren't compatible with one another. Unicode solved this by giving every character its own code point, and it keeps the original 128 ASCII values unchanged. So any plain ASCII text is also valid UTF-8, which is why this table remains useful today.
Handy tricks with ASCII
- Digit values: subtract 48 from a digit's code to get its number.
- Case conversion: add or subtract 32 to change the case of a letter.
- Sorting: sorting by code puts all capitals before lowercase letters.
- Line endings: Windows text files typically use CR and LF, while Unix-like systems use only LF.
Using it while you code
Keep this page open when you're parsing text files, working with serial devices or writing a simple protocol. If a file seems to contain invisible characters, look up the values that your editor reports. A stray carriage return or a tab in the wrong place is a common cause of confusing bugs, and knowing the code makes it much easier to find and fix them.
Reading hexadecimal codes
You'll often see ASCII values written in hexadecimal, sometimes with a prefix like 0x or a percent sign. For example, 0x41 is the capital A, and %20 in a web address is a space. To read a value, look up the two-digit code in the Hex column. The first digit tells you which group of 16 the character belongs to, and the second digit tells you its position inside that group. The letters A to O in uppercase therefore run from 41 to 4F, and P to Z run from 50 to 5A. Lowercase letters follow the same pattern, beginning at 61. With a little practice, you'll be able to recognize common values at a glance when you read a hex dump or a log file.
Common mistakes
- Confusing the digit 0 with code 0. The digit is 48, and code 0 is Null.
- Assuming ASCII covers every language. It only has English letters.
- Mixing up CR and LF. They're separate codes.
Related developer tools
Encode a message with the text to binary converter, escape markup with the HTML entity encoder, and change number bases with the binary to decimal converter.
What next
Use this often? Add ASCII Table to your Home screen.
Frequently asked questions
What is an ASCII table?
It's a list of the 128 ASCII codes, with the character or control function for each.
What is the ASCII code for A?
The capital A is 65 in decimal, or 41 in hexadecimal.
How many ASCII characters are there?
There are 128: 95 printable characters and 33 control characters.
Is ASCII the same as Unicode?
No, but the first 128 Unicode code points match ASCII.
What is the difference between line feed and carriage return?
Line feed starts a new line, and carriage return goes back to the start of the line.
Sources
Was this tool helpful?
What went wrong?
We only receive the reason you pick, never what you typed into the tool.
Thanks for your feedback.