ASCII Table and Character Code Lookup: Decimal, Hex, Binary
ASCII table of all 128 codes in decimal and hex, with every control character named.
Look up any text or code, and catch characters that only look like ASCII.
ASCII in short
ASCII (American Standard Code for Information Interchange) gives each of 128 characters a number from 0 to 127.
33 of them are control codes (0 to 31, and 127). The other 95 are the letters, digits, punctuation and the space.
It needs only 7 bits, so every ASCII character fits in one byte with the top bit left at 0.
Patterns worth knowing
Digits 0 to 9 are 48 to 57 (hex 30 to 39), so a digit’s value is its code minus 48.
Capital letters run from 65 to 90 and small letters from 97 to 122. Each pair is exactly 32 apart, one bit (hex 20), which is why changing case in code is a single bit flip.
The space is 32 and DEL is 127.
A line break is LF (10) on Linux and macOS, and CR then LF (13 10) on Windows. Most “this file has odd line endings” trouble is that pair.
Printable characters, 32 to 126 (and DEL at 127)
| Dec | Hex | Char | Dec | Hex | Char | Dec | Hex | Char |
|---|---|---|---|---|---|---|---|---|
| 32 | 20 | space | 64 | 40 | @ | 96 | 60 | ` |
| 33 | 21 | ! | 65 | 41 | A | 97 | 61 | a |
| 34 | 22 | " | 66 | 42 | B | 98 | 62 | b |
| 35 | 23 | # | 67 | 43 | C | 99 | 63 | c |
| 36 | 24 | $ | 68 | 44 | D | 100 | 64 | d |
| 37 | 25 | % | 69 | 45 | E | 101 | 65 | e |
| 38 | 26 | & | 70 | 46 | F | 102 | 66 | f |
| 39 | 27 | ' | 71 | 47 | G | 103 | 67 | g |
| 40 | 28 | ( | 72 | 48 | H | 104 | 68 | h |
| 41 | 29 | ) | 73 | 49 | I | 105 | 69 | i |
| 42 | 2A | * | 74 | 4A | J | 106 | 6A | j |
| 43 | 2B | + | 75 | 4B | K | 107 | 6B | k |
| 44 | 2C | , | 76 | 4C | L | 108 | 6C | l |
| 45 | 2D | - | 77 | 4D | M | 109 | 6D | m |
| 46 | 2E | . | 78 | 4E | N | 110 | 6E | n |
| 47 | 2F | / | 79 | 4F | O | 111 | 6F | o |
| 48 | 30 | 0 | 80 | 50 | P | 112 | 70 | p |
| 49 | 31 | 1 | 81 | 51 | Q | 113 | 71 | q |
| 50 | 32 | 2 | 82 | 52 | R | 114 | 72 | r |
| 51 | 33 | 3 | 83 | 53 | S | 115 | 73 | s |
| 52 | 34 | 4 | 84 | 54 | T | 116 | 74 | t |
| 53 | 35 | 5 | 85 | 55 | U | 117 | 75 | u |
| 54 | 36 | 6 | 86 | 56 | V | 118 | 76 | v |
| 55 | 37 | 7 | 87 | 57 | W | 119 | 77 | w |
| 56 | 38 | 8 | 88 | 58 | X | 120 | 78 | x |
| 57 | 39 | 9 | 89 | 59 | Y | 121 | 79 | y |
| 58 | 3A | : | 90 | 5A | Z | 122 | 7A | z |
| 59 | 3B | ; | 91 | 5B | [ | 123 | 7B | { |
| 60 | 3C | < | 92 | 5C | \ | 124 | 7C | | |
| 61 | 3D | = | 93 | 5D | ] | 125 | 7D | } |
| 62 | 3E | > | 94 | 5E | ^ | 126 | 7E | ~ |
| 63 | 3F | ? | 95 | 5F | _ | 127 | 7F | DEL |
Control characters, 0 to 31 and 127
The Keys column is the combination that sends the code from a terminal. Ctrl+C sends 3, end of text, which is why it stops a running program, and Ctrl+[ is the same code as the Esc key.
| Dec | Hex | Abbr | Name | Keys |
|---|---|---|---|---|
| 0 | 00 | NUL | null | Ctrl+@ |
| 1 | 01 | SOH | start of heading | Ctrl+A |
| 2 | 02 | STX | start of text | Ctrl+B |
| 3 | 03 | ETX | end of text | Ctrl+C |
| 4 | 04 | EOT | end of transmission | Ctrl+D |
| 5 | 05 | ENQ | enquiry | Ctrl+E |
| 6 | 06 | ACK | acknowledge | Ctrl+F |
| 7 | 07 | BEL | bell | Ctrl+G |
| 8 | 08 | BS | backspace | Ctrl+H |
| 9 | 09 | HT | horizontal tab | Ctrl+I |
| 10 | 0A | LF | line feed (new line) | Ctrl+J |
| 11 | 0B | VT | vertical tab | Ctrl+K |
| 12 | 0C | FF | form feed | Ctrl+L |
| 13 | 0D | CR | carriage return | Ctrl+M |
| 14 | 0E | SO | shift out | Ctrl+N |
| 15 | 0F | SI | shift in | Ctrl+O |
| 16 | 10 | DLE | data link escape | Ctrl+P |
| 17 | 11 | DC1 | device control 1 (XON) | Ctrl+Q |
| 18 | 12 | DC2 | device control 2 | Ctrl+R |
| 19 | 13 | DC3 | device control 3 (XOFF) | Ctrl+S |
| 20 | 14 | DC4 | device control 4 | Ctrl+T |
| 21 | 15 | NAK | negative acknowledge | Ctrl+U |
| 22 | 16 | SYN | synchronous idle | Ctrl+V |
| 23 | 17 | ETB | end of transmission block | Ctrl+W |
| 24 | 18 | CAN | cancel | Ctrl+X |
| 25 | 19 | EM | end of medium | Ctrl+Y |
| 26 | 1A | SUB | substitute | Ctrl+Z |
| 27 | 1B | ESC | escape | Ctrl+[ |
| 28 | 1C | FS | file separator | Ctrl+\ |
| 29 | 1D | GS | group separator | Ctrl+] |
| 30 | 1E | RS | record separator | Ctrl+^ |
| 31 | 1F | US | unit separator | Ctrl+_ |
| 127 | 7F | DEL | delete | Ctrl+? |
There is no “extended ASCII”
Codes 128 to 255 are not ASCII at all. Different 8-bit code pages filled them in differently: Windows-1252 puts the euro sign at 128, Latin-1 (ISO 8859-1) keeps 128 to 159 for controls, and the original IBM PC used them for box-drawing lines. That is how text moved between systems turns é into é.
UTF-8, which nearly the whole web uses now, keeps 0 to 127 byte for byte the same as ASCII and writes every other character in 2 to 4 bytes. So a plain ASCII file is already valid UTF-8, and the reverse is only true when nothing above 127 is in it.
Using the lookup
Type text to get each character’s decimal, hex, octal and binary codes, or switch to codes and type numbers to get the characters back. Decimal (72), hex with 0x (0x48) and 8-bit binary (01001000) all work, separated by spaces or commas.
The panel also flags curly quotes, long dashes, non-breaking spaces and zero-width characters pasted from a word processor or a phone. They look exactly like their ASCII cousins and are not, and they are a common reason a script, a CSV import or a password box rejects text that looks right.
How we build and check this calculator
This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.
SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.
More Developer Tools Calculators