What it does
ASCII (American Standard Code for Information Interchange) assigns numbers 0 to 127 to letters, digits, punctuation and control codes. It is the foundation of nearly every text encoding: UTF-8 keeps these 128 values identical.
How the table is organised
- 0-31 and 127 are control characters such as line feed (10), carriage return (13), tab (9) and escape (27). They do not print.
- 32 is the space character.
- 48-57 are the digits 0-9, 65-90 capital letters and 97-122 lowercase letters. Lowercase is capital plus 32, which is why toggling bit 5 changes case.
Searching the table
Type a character (A), a decimal code (65), a hex value (0x41) or a name (escape, newline). One typed character shows exactly that character, and one digit also shows the code with that decimal value. Longer entries match anywhere in a row, so 65 also lists rows whose hex or octal digits contain 65.
Using the codes
The control codes you meet most are 9 (tab), 10 (line feed) and 13 (carriage return), written \t, \n and \r in source code; the String Escape & Unescape tool converts between those escapes and the real characters. For printable ASCII, a percent-encoded byte in a URL is the hex code (a space is 32, so %20), which the URL Encoder & Decoder applies, and a numeric HTML entity uses the decimal code ( ), which the HTML Entity Encoder & Decoder handles.
Beyond 127
ASCII stops at 127. Values 128 to 255 are not ASCII: in Latin-1 and Windows-1252 they are single accented letters and symbols, while in UTF-8 any character above 127 takes two to four bytes. To see the bytes of arbitrary text use Text to Binary, Hex & Octal, and to convert a single code between bases use the Number Base Converter.
Examples
Search by character, decimal number, hexadecimal number (with or without 0x) or name. Every column is searched, so a number can match more than one row:
Aor0x41finds decimal 65, hex 41, octal 101, binary 01000001.LFfinds decimal 10, hex 0A, octal 012, binary 00001010, “Line Feed (newline)”.escapefinds two rows: 16 (DLE, Data Link Escape) and 27 (ESC, Escape).spacefinds 8 (BS, Backspace, whose name contains the word) and 32 (SP, Space).65finds four rows, not just the letter A: the digit 5 (decimal 53, hex 35, octal 065), A (decimal 65), and the lowercase e and u, whose octal codes 145 and 165 contain 65. Use the 0x prefix or a character when you want one exact row.
Useful patterns
- Codes 0 to 31 and 127 are control characters, for example 9 is tab, 10 is line feed (
\n), 13 is carriage return (\r) and 27 is escape, which starts terminal colour sequences. Codes 32 to 126 are the printable characters. - The digits 0 to 9 are codes 48 to 57, so a digit character minus 48 gives its value.
- An uppercase letter and its lowercase letter differ by exactly 32 (A is 65, a is 97), which is one bit, 0x20.
Frequently asked questions
How many characters does ASCII define?
128, with the codes 0 to 127. It needs 7 bits, and in practice each character is stored in one byte.
What about characters above 127?
They are not part of ASCII. Older “extended ASCII” code pages such as Windows-1252 and ISO 8859-1 disagree with each other. Today Unicode and its UTF-8 encoding are standard, and UTF-8 stores the first 128 characters exactly as ASCII does.
How do I convert text to these codes?
Use the Text to Binary Converter, or the Number Base Converter for a single number.
Privacy
This tool runs entirely in your browser. What you enter is processed on your device and is not sent to a server.