ASCII Table
All 128 ASCII codes in decimal, hex, octal and binary. Type a character, a number or a name to find its row.
Nothing in ASCII matches that. ASCII stops at code 127, so accented letters and emoji aren't in it.Text to binary handles those with UTF-8.
Control characters (0 to 31)
| Dec | Hex | Oct | Binary | Char | Name |
|---|---|---|---|---|---|
| 0 | 00 | 000 | 00000000 | NUL | Null |
| 1 | 01 | 001 | 00000001 | SOH | Start of heading |
| 2 | 02 | 002 | 00000010 | STX | Start of text |
| 3 | 03 | 003 | 00000011 | ETX | End of text |
| 4 | 04 | 004 | 00000100 | EOT | End of transmission |
| 5 | 05 | 005 | 00000101 | ENQ | Enquiry |
| 6 | 06 | 006 | 00000110 | ACK | Acknowledge |
| 7 | 07 | 007 | 00000111 | BEL | Bell |
| 8 | 08 | 010 | 00001000 | BS | Backspace |
| 9 | 09 | 011 | 00001001 | HT | Horizontal tab |
| 10 | 0A | 012 | 00001010 | LF | Line feed |
| 11 | 0B | 013 | 00001011 | VT | Vertical tab |
| 12 | 0C | 014 | 00001100 | FF | Form feed |
| 13 | 0D | 015 | 00001101 | CR | Carriage return |
| 14 | 0E | 016 | 00001110 | SO | Shift out |
| 15 | 0F | 017 | 00001111 | SI | Shift in |
| 16 | 10 | 020 | 00010000 | DLE | Data link escape |
| 17 | 11 | 021 | 00010001 | DC1 | Device control 1 |
| 18 | 12 | 022 | 00010010 | DC2 | Device control 2 |
| 19 | 13 | 023 | 00010011 | DC3 | Device control 3 |
| 20 | 14 | 024 | 00010100 | DC4 | Device control 4 |
| 21 | 15 | 025 | 00010101 | NAK | Negative acknowledge |
| 22 | 16 | 026 | 00010110 | SYN | Synchronous idle |
| 23 | 17 | 027 | 00010111 | ETB | End of transmission block |
| 24 | 18 | 030 | 00011000 | CAN | Cancel |
| 25 | 19 | 031 | 00011001 | EM | End of medium |
| 26 | 1A | 032 | 00011010 | SUB | Substitute |
| 27 | 1B | 033 | 00011011 | ESC | Escape |
| 28 | 1C | 034 | 00011100 | FS | File separator |
| 29 | 1D | 035 | 00011101 | GS | Group separator |
| 30 | 1E | 036 | 00011110 | RS | Record separator |
| 31 | 1F | 037 | 00011111 | US | Unit separator |
Space, symbols and digits (32 to 63)
| Dec | Hex | Oct | Binary | Char | Name |
|---|---|---|---|---|---|
| 32 | 20 | 040 | 00100000 | SP | Space |
| 33 | 21 | 041 | 00100001 | ! | Exclamation mark |
| 34 | 22 | 042 | 00100010 | " | Double quote |
| 35 | 23 | 043 | 00100011 | # | Number sign (hash) |
| 36 | 24 | 044 | 00100100 | $ | Dollar sign |
| 37 | 25 | 045 | 00100101 | % | Percent sign |
| 38 | 26 | 046 | 00100110 | & | Ampersand |
| 39 | 27 | 047 | 00100111 | ' | Apostrophe (single quote) |
| 40 | 28 | 050 | 00101000 | ( | Left parenthesis |
| 41 | 29 | 051 | 00101001 | ) | Right parenthesis |
| 42 | 2A | 052 | 00101010 | * | Asterisk |
| 43 | 2B | 053 | 00101011 | + | Plus sign |
| 44 | 2C | 054 | 00101100 | , | Comma |
| 45 | 2D | 055 | 00101101 | - | Hyphen-minus |
| 46 | 2E | 056 | 00101110 | . | Full stop (period) |
| 47 | 2F | 057 | 00101111 | / | Slash |
| 48 | 30 | 060 | 00110000 | 0 | Digit 0 |
| 49 | 31 | 061 | 00110001 | 1 | Digit 1 |
| 50 | 32 | 062 | 00110010 | 2 | Digit 2 |
| 51 | 33 | 063 | 00110011 | 3 | Digit 3 |
| 52 | 34 | 064 | 00110100 | 4 | Digit 4 |
| 53 | 35 | 065 | 00110101 | 5 | Digit 5 |
| 54 | 36 | 066 | 00110110 | 6 | Digit 6 |
| 55 | 37 | 067 | 00110111 | 7 | Digit 7 |
| 56 | 38 | 070 | 00111000 | 8 | Digit 8 |
| 57 | 39 | 071 | 00111001 | 9 | Digit 9 |
| 58 | 3A | 072 | 00111010 | : | Colon |
| 59 | 3B | 073 | 00111011 | ; | Semicolon |
| 60 | 3C | 074 | 00111100 | < | Less-than sign |
| 61 | 3D | 075 | 00111101 | = | Equals sign |
| 62 | 3E | 076 | 00111110 | > | Greater-than sign |
| 63 | 3F | 077 | 00111111 | ? | Question mark |
Capital letters (64 to 95)
| Dec | Hex | Oct | Binary | Char | Name |
|---|---|---|---|---|---|
| 64 | 40 | 100 | 01000000 | @ | At sign |
| 65 | 41 | 101 | 01000001 | A | Capital letter A |
| 66 | 42 | 102 | 01000010 | B | Capital letter B |
| 67 | 43 | 103 | 01000011 | C | Capital letter C |
| 68 | 44 | 104 | 01000100 | D | Capital letter D |
| 69 | 45 | 105 | 01000101 | E | Capital letter E |
| 70 | 46 | 106 | 01000110 | F | Capital letter F |
| 71 | 47 | 107 | 01000111 | G | Capital letter G |
| 72 | 48 | 110 | 01001000 | H | Capital letter H |
| 73 | 49 | 111 | 01001001 | I | Capital letter I |
| 74 | 4A | 112 | 01001010 | J | Capital letter J |
| 75 | 4B | 113 | 01001011 | K | Capital letter K |
| 76 | 4C | 114 | 01001100 | L | Capital letter L |
| 77 | 4D | 115 | 01001101 | M | Capital letter M |
| 78 | 4E | 116 | 01001110 | N | Capital letter N |
| 79 | 4F | 117 | 01001111 | O | Capital letter O |
| 80 | 50 | 120 | 01010000 | P | Capital letter P |
| 81 | 51 | 121 | 01010001 | Q | Capital letter Q |
| 82 | 52 | 122 | 01010010 | R | Capital letter R |
| 83 | 53 | 123 | 01010011 | S | Capital letter S |
| 84 | 54 | 124 | 01010100 | T | Capital letter T |
| 85 | 55 | 125 | 01010101 | U | Capital letter U |
| 86 | 56 | 126 | 01010110 | V | Capital letter V |
| 87 | 57 | 127 | 01010111 | W | Capital letter W |
| 88 | 58 | 130 | 01011000 | X | Capital letter X |
| 89 | 59 | 131 | 01011001 | Y | Capital letter Y |
| 90 | 5A | 132 | 01011010 | Z | Capital letter Z |
| 91 | 5B | 133 | 01011011 | [ | Left square bracket |
| 92 | 5C | 134 | 01011100 | \ | Backslash |
| 93 | 5D | 135 | 01011101 | ] | Right square bracket |
| 94 | 5E | 136 | 01011110 | ^ | Caret |
| 95 | 5F | 137 | 01011111 | _ | Underscore |
Small letters and DEL (96 to 127)
| Dec | Hex | Oct | Binary | Char | Name |
|---|---|---|---|---|---|
| 96 | 60 | 140 | 01100000 | ` | Grave accent (backtick) |
| 97 | 61 | 141 | 01100001 | a | Small letter a |
| 98 | 62 | 142 | 01100010 | b | Small letter b |
| 99 | 63 | 143 | 01100011 | c | Small letter c |
| 100 | 64 | 144 | 01100100 | d | Small letter d |
| 101 | 65 | 145 | 01100101 | e | Small letter e |
| 102 | 66 | 146 | 01100110 | f | Small letter f |
| 103 | 67 | 147 | 01100111 | g | Small letter g |
| 104 | 68 | 150 | 01101000 | h | Small letter h |
| 105 | 69 | 151 | 01101001 | i | Small letter i |
| 106 | 6A | 152 | 01101010 | j | Small letter j |
| 107 | 6B | 153 | 01101011 | k | Small letter k |
| 108 | 6C | 154 | 01101100 | l | Small letter l |
| 109 | 6D | 155 | 01101101 | m | Small letter m |
| 110 | 6E | 156 | 01101110 | n | Small letter n |
| 111 | 6F | 157 | 01101111 | o | Small letter o |
| 112 | 70 | 160 | 01110000 | p | Small letter p |
| 113 | 71 | 161 | 01110001 | q | Small letter q |
| 114 | 72 | 162 | 01110010 | r | Small letter r |
| 115 | 73 | 163 | 01110011 | s | Small letter s |
| 116 | 74 | 164 | 01110100 | t | Small letter t |
| 117 | 75 | 165 | 01110101 | u | Small letter u |
| 118 | 76 | 166 | 01110110 | v | Small letter v |
| 119 | 77 | 167 | 01110111 | w | Small letter w |
| 120 | 78 | 170 | 01111000 | x | Small letter x |
| 121 | 79 | 171 | 01111001 | y | Small letter y |
| 122 | 7A | 172 | 01111010 | z | Small letter z |
| 123 | 7B | 173 | 01111011 | { | Left curly brace |
| 124 | 7C | 174 | 01111100 | | | Vertical bar (pipe) |
| 125 | 7D | 175 | 01111101 | } | Right curly brace |
| 126 | 7E | 176 | 01111110 | ~ | Tilde |
| 127 | 7F | 177 | 01111111 | DEL | Delete |
How to read the table
ASCII is a numbered list of 128 characters. Each row is one entry, and the first four columns are the same number written four ways. Capital A is 65 in decimal, 41 in hex, 101 in octal and01000001 in binary.
Binary is shown as a full 8-bit byte. ASCII itself needs only seven bits, so the first digit is always 0. Of the 128 codes, 95 are printable, from the space at 32 to the tilde at 126. The other 33 are control characters: codes 0 to 31, plus DEL at 127.
In HTML, you can write any printable character by its number. A uses the decimal code andA uses the hex code. Both show a capital A.
Patterns worth remembering
Digits start at 48
The character 0 is code 48, and the other digits follow in order. To get a digit's value from its code, subtract 48. In hex it's even easier: the digits run from 30 to 39, so the second hex digit is the value.
Capital and small letters are 32 apart
A is 65 and a is 97. The same gap holds for every letter. In binary, 32 is a single bit, so flipping that one bit switches a letter between capital and small.
Letters count from 1
The last five bits of a letter give its place in the alphabet. G ends in 00111, which is 7, and G is the seventh letter. This works for both cases.
Sorting follows the codes
A plain code-by-code sort puts digits first, then capital letters, then small letters. That's why such a sort places "Zebra" before "apple": Z is 90 and a is 97. It also puts "10" before "9", because it compares the character 1 with the character 9.
Control characters and the Ctrl key
The first 32 codes don't print anything. They were made to control printers, terminals and data links. Many terminals still send them when you hold Ctrl and press a key. For a letter, the code is its place in the alphabet, so Ctrl+A sends 1 and Ctrl+Z sends 26.
| Keys | Code | What it usually does |
|---|---|---|
| Ctrl+C | 3 ETX | Stops the running program in most terminals. |
| Ctrl+D | 4 EOT | Signals the end of input on Linux and macOS. |
| Ctrl+H | 8 BS | Backspace. |
| Ctrl+I | 9 HT | Tab. |
| Ctrl+M | 13 CR | Carriage return, the code behind Enter in a terminal. |
| Ctrl+[ | 27 ESC | Escape. Vim users often press it in place of the Esc key. |
Programs and desktop apps can give these keys other jobs. In most editors, Ctrl+C copies the selected text.
Line endings
Two control characters end lines of text. Linux and macOS use a line feed, code 10. Windows uses a carriage return, code 13, followed by a line feed. If a file shows stray characters at the end of each line, this difference is a likely cause.
What comes after 127?
Nothing, as far as ASCII goes. Tables sold as "extended ASCII" fill codes 128 to 255 in different ways. Latin-1, Windows-1252 and the old IBM PC code page 437 don't agree with each other, so a byte above 127 means nothing until you know which one was used.
Most text today uses UTF-8. It keeps all 128 ASCII codes exactly as they are here, and writes every other character as two to four bytes. So a plain ASCII file is already a valid UTF-8 file.
ASCII table FAQ
What is the ASCII code for A?
Capital A is 65 in decimal, 41 in hex and 01000001 in binary. Small a is 97, 61 in hex and 01100001.
What is the ASCII code for a space?
A space is 32 in decimal, 20 in hex and 00100000 in binary. It counts as a printable character even though you can't see it.
What is the ASCII code for Enter?
It depends on the system. A line break is usually stored as 10 (line feed) on Linux and macOS, and as 13 then 10 on Windows.
What does ASCII stand for?
American Standard Code for Information Interchange.
How many characters are in ASCII?
128, numbered 0 to 127. There are 95 printable characters and 33 control characters.