Free tool
ASCII table
ASCII maps 128 characters to the numbers 0-127: 33 control codes and 95 printable characters. The table below lists every code in decimal, hex, octal and binary, with its HTML entity, string escape and name. Search by character, by code in any notation (65, 0x41, %41, A) or by name, and click a row to copy any format. Below the table, convert text to codes and back.
Free · no sign-up · runs in your browser, nothing is uploaded
| Dec | Char | Hex | Oct | Binary | HTML | Description |
|---|---|---|---|---|---|---|
| 0 | NUL | 00 | 000 | 00000000 | � | Null^@ |
| 1 | SOH | 01 | 001 | 00000001 |  | Start of Heading^A |
| 2 | STX | 02 | 002 | 00000010 |  | Start of Text^B |
| 3 | ETX | 03 | 003 | 00000011 |  | End of Text^C |
| 4 | EOT | 04 | 004 | 00000100 |  | End of Transmission^D |
| 5 | ENQ | 05 | 005 | 00000101 |  | Enquiry^E |
| 6 | ACK | 06 | 006 | 00000110 |  | Acknowledge^F |
| 7 | BEL | 07 | 007 | 00000111 |  | Bell (alert)^G |
| 8 | BS | 08 | 010 | 00001000 |  | Backspace^H |
| 9 | HT | 09 | 011 | 00001001 | 		 | Horizontal Tab^I |
| 10 | LF | 0A | 012 | 00001010 | 
 | Line Feed (new line)^J |
| 11 | VT | 0B | 013 | 00001011 |  | Vertical Tab^K |
| 12 | FF | 0C | 014 | 00001100 |  | Form Feed (new page)^L |
| 13 | CR | 0D | 015 | 00001101 | | Carriage Return^M |
| 14 | SO | 0E | 016 | 00001110 |  | Shift Out^N |
| 15 | SI | 0F | 017 | 00001111 |  | Shift In^O |
| 16 | DLE | 10 | 020 | 00010000 |  | Data Link Escape^P |
| 17 | DC1 | 11 | 021 | 00010001 |  | Device Control 1 (XON)^Q |
| 18 | DC2 | 12 | 022 | 00010010 |  | Device Control 2^R |
| 19 | DC3 | 13 | 023 | 00010011 |  | Device Control 3 (XOFF)^S |
| 20 | DC4 | 14 | 024 | 00010100 |  | Device Control 4^T |
| 21 | NAK | 15 | 025 | 00010101 |  | Negative Acknowledge^U |
| 22 | SYN | 16 | 026 | 00010110 |  | Synchronous Idle^V |
| 23 | ETB | 17 | 027 | 00010111 |  | End of Transmission Block^W |
| 24 | CAN | 18 | 030 | 00011000 |  | Cancel^X |
| 25 | EM | 19 | 031 | 00011001 |  | End of Medium^Y |
| 26 | SUB | 1A | 032 | 00011010 |  | Substitute^Z |
| 27 | ESC | 1B | 033 | 00011011 |  | Escape^[ |
| 28 | FS | 1C | 034 | 00011100 |  | File Separator^\ |
| 29 | GS | 1D | 035 | 00011101 |  | Group Separator^] |
| 30 | RS | 1E | 036 | 00011110 |  | Record Separator^^ |
| 31 | US | 1F | 037 | 00011111 |  | Unit Separator^_ |
| 32 | SP | 20 | 040 | 00100000 |   | Space |
| 33 | ! | 21 | 041 | 00100001 | !! | Exclamation mark |
| 34 | " | 22 | 042 | 00100010 | "" | Quotation mark (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 | // | Solidus (slash) |
| 48 | 0 | 30 | 060 | 00110000 | 0 | Digit zero |
| 49 | 1 | 31 | 061 | 00110001 | 1 | Digit one |
| 50 | 2 | 32 | 062 | 00110010 | 2 | Digit two |
| 51 | 3 | 33 | 063 | 00110011 | 3 | Digit three |
| 52 | 4 | 34 | 064 | 00110100 | 4 | Digit four |
| 53 | 5 | 35 | 065 | 00110101 | 5 | Digit five |
| 54 | 6 | 36 | 066 | 00110110 | 6 | Digit six |
| 55 | 7 | 37 | 067 | 00110111 | 7 | Digit seven |
| 56 | 8 | 38 | 070 | 00111000 | 8 | Digit eight |
| 57 | 9 | 39 | 071 | 00111001 | 9 | Digit nine |
| 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 |
| 64 | @ | 40 | 100 | 01000000 | @@ | Commercial at |
| 65 | A | 41 | 101 | 01000001 | A | Latin capital letter A |
| 66 | B | 42 | 102 | 01000010 | B | Latin capital letter B |
| 67 | C | 43 | 103 | 01000011 | C | Latin capital letter C |
| 68 | D | 44 | 104 | 01000100 | D | Latin capital letter D |
| 69 | E | 45 | 105 | 01000101 | E | Latin capital letter E |
| 70 | F | 46 | 106 | 01000110 | F | Latin capital letter F |
| 71 | G | 47 | 107 | 01000111 | G | Latin capital letter G |
| 72 | H | 48 | 110 | 01001000 | H | Latin capital letter H |
| 73 | I | 49 | 111 | 01001001 | I | Latin capital letter I |
| 74 | J | 4A | 112 | 01001010 | J | Latin capital letter J |
| 75 | K | 4B | 113 | 01001011 | K | Latin capital letter K |
| 76 | L | 4C | 114 | 01001100 | L | Latin capital letter L |
| 77 | M | 4D | 115 | 01001101 | M | Latin capital letter M |
| 78 | N | 4E | 116 | 01001110 | N | Latin capital letter N |
| 79 | O | 4F | 117 | 01001111 | O | Latin capital letter O |
| 80 | P | 50 | 120 | 01010000 | P | Latin capital letter P |
| 81 | Q | 51 | 121 | 01010001 | Q | Latin capital letter Q |
| 82 | R | 52 | 122 | 01010010 | R | Latin capital letter R |
| 83 | S | 53 | 123 | 01010011 | S | Latin capital letter S |
| 84 | T | 54 | 124 | 01010100 | T | Latin capital letter T |
| 85 | U | 55 | 125 | 01010101 | U | Latin capital letter U |
| 86 | V | 56 | 126 | 01010110 | V | Latin capital letter V |
| 87 | W | 57 | 127 | 01010111 | W | Latin capital letter W |
| 88 | X | 58 | 130 | 01011000 | X | Latin capital letter X |
| 89 | Y | 59 | 131 | 01011001 | Y | Latin capital letter Y |
| 90 | Z | 5A | 132 | 01011010 | Z | Latin capital letter Z |
| 91 | [ | 5B | 133 | 01011011 | [[ | Left square bracket |
| 92 | \ | 5C | 134 | 01011100 | \\ | Reverse solidus (backslash) |
| 93 | ] | 5D | 135 | 01011101 | ]] | Right square bracket |
| 94 | ^ | 5E | 136 | 01011110 | ^^ | Circumflex accent (caret) |
| 95 | _ | 5F | 137 | 01011111 | __ | Low line (underscore) |
| 96 | ` | 60 | 140 | 01100000 | `` | Grave accent (backtick) |
| 97 | a | 61 | 141 | 01100001 | a | Latin small letter a |
| 98 | b | 62 | 142 | 01100010 | b | Latin small letter b |
| 99 | c | 63 | 143 | 01100011 | c | Latin small letter c |
| 100 | d | 64 | 144 | 01100100 | d | Latin small letter d |
| 101 | e | 65 | 145 | 01100101 | e | Latin small letter e |
| 102 | f | 66 | 146 | 01100110 | f | Latin small letter f |
| 103 | g | 67 | 147 | 01100111 | g | Latin small letter g |
| 104 | h | 68 | 150 | 01101000 | h | Latin small letter h |
| 105 | i | 69 | 151 | 01101001 | i | Latin small letter i |
| 106 | j | 6A | 152 | 01101010 | j | Latin small letter j |
| 107 | k | 6B | 153 | 01101011 | k | Latin small letter k |
| 108 | l | 6C | 154 | 01101100 | l | Latin small letter l |
| 109 | m | 6D | 155 | 01101101 | m | Latin small letter m |
| 110 | n | 6E | 156 | 01101110 | n | Latin small letter n |
| 111 | o | 6F | 157 | 01101111 | o | Latin small letter o |
| 112 | p | 70 | 160 | 01110000 | p | Latin small letter p |
| 113 | q | 71 | 161 | 01110001 | q | Latin small letter q |
| 114 | r | 72 | 162 | 01110010 | r | Latin small letter r |
| 115 | s | 73 | 163 | 01110011 | s | Latin small letter s |
| 116 | t | 74 | 164 | 01110100 | t | Latin small letter t |
| 117 | u | 75 | 165 | 01110101 | u | Latin small letter u |
| 118 | v | 76 | 166 | 01110110 | v | Latin small letter v |
| 119 | w | 77 | 167 | 01110111 | w | Latin small letter w |
| 120 | x | 78 | 170 | 01111000 | x | Latin small letter x |
| 121 | y | 79 | 171 | 01111001 | y | Latin small letter y |
| 122 | z | 7A | 172 | 01111010 | z | Latin small letter z |
| 123 | { | 7B | 173 | 01111011 | {{ | Left curly bracket |
| 124 | | | 7C | 174 | 01111100 | || | Vertical line (pipe) |
| 125 | } | 7D | 175 | 01111101 | }} | Right curly bracket |
| 126 | ~ | 7E | 176 | 01111110 | ~ | Tilde |
| 127 | DEL | 7F | 177 | 01111111 |  | Delete^? |
Text to ASCII codes
Codes appear here.
What is ASCII?
ASCII (American Standard Code for Information Interchange) was first published in the US in 1963 and last revised as ANSI X3.4-1986. It is a 7-bit code: 128 values, each stored in a byte whose top bit is 0. RFC 20 (1969) adopted it for data sent over the ARPANET, and protocols like HTTP and email headers still use it.
| Range (dec) | Hex | What is there |
|---|---|---|
| 0-31 | 00-1F | Control codes: NUL, tab, line feed, carriage return, escape... |
| 32 | 20 | Space |
| 33-47, 58-64, 91-96, 123-126 | 21-2F, 3A-40, 5B-60, 7B-7E | Punctuation and symbols |
| 48-57 | 30-39 | Digits 0-9 |
| 65-90 | 41-5A | Uppercase A-Z |
| 97-122 | 61-7A | Lowercase a-z |
| 127 | 7F | DEL, a control code |
Unicode starts with the same 128 characters, and UTF-8 stores them as the same single bytes, so plain ASCII text is valid UTF-8.
Control characters you still meet
Most of the 33 control codes came from teleprinters and are unused today. These are the ones that still matter:
| Dec | Name | Escape / key | Used for today |
|---|---|---|---|
| 0 | NUL | \0 | End of a C string; padding in binary formats |
| 7 | BEL | \a | Makes a terminal beep or flash |
| 8 | BS | \b | Backspace: moves the cursor back one column |
| 9 | HT | \t | Tab |
| 10 | LF | \n | New line on Linux and macOS |
| 13 | CR | \r | Sent by Enter; CR LF ends lines on Windows and in HTTP |
| 3 | ETX | Ctrl+C | Terminals turn it into an interrupt (SIGINT) |
| 4 | EOT | Ctrl+D | End of input in a Unix terminal |
| 27 | ESC | \x1B | Starts ANSI escape sequences for colors and cursor moves |
| 127 | DEL | Ctrl+? | Sent by the Backspace key in many terminals |
Caret notation (^C, ^[) names a control code by the key you press with Ctrl. Ctrl keeps only the low 5 bits of the key's code, so C (67) becomes 3 and [ (91) becomes 27, which is why Ctrl+[ works as Escape in Vim. ^? is the exception: it means DEL, 127.
Handy patterns in the ASCII table
- Case is one bit. A lowercase letter is its uppercase letter plus 32 (bit 5,
0x20).c ^ 0x20flips the case of an ASCII letter andc | 0x20makes it lowercase. - Digits are 48-57.
c - 48(orc - '0'in C) turns a digit character into its value. - Uppercase sorts first. Plain byte comparison puts "Zebra" before "apple", because Z (90) is less than a (97). Use a locale-aware compare for human sorting.
- Hex digits are not contiguous. 0-9 are 48-57 but A-F are 65-70, so hex parsing needs two ranges.
- Not every symbol has a named HTML entity.
˜is the small tilde U+02DC, not ~ (126), and the hyphen-minus (45) has none. Use~or the character itself.
Get ASCII codes in JavaScript, Python, C and bash
// JavaScript 'A'.charCodeAt(0) // 65 '😀'.codePointAt(0) // 128512 (use codePointAt beyond ASCII) String.fromCharCode(72, 105) // "Hi" [...'Hi'].map(c => c.charCodeAt(0).toString(16)) // ['48', '69']
# Python
ord('A') # 65
chr(97) # 'a'
'Hi'.encode('ascii') # b'Hi' (raises UnicodeEncodeError for é)
[hex(b) for b in b'Hi'] # ['0x48', '0x69']/* C */
char c = 'A';
printf("%d %x %c\n", c, c, c + 32); /* 65 41 a */# bash printf '%d\n' "'A" # 65 printf '\x41\n' # A printf 'Hi' | xxd # 00000000: 4869 Hi man ascii # the full table in your terminal (Linux)
Extended ASCII and mojibake
Bytes 128-255 are outside ASCII, and different encodings put different characters there. Windows-1252 has € at 0x80 and curly quotes at 0x91-0x94, where ISO-8859-1 has invisible C1 control codes. From 0xA0 up, both match Unicode U+00A0-U+00FF. In UTF-8, these characters take two or more bytes instead of one.
That mismatch causes mojibake. The UTF-8 bytes for é are C3 A9; read as Windows-1252 they show as é. If you see that, the text is UTF-8 and the reader picked the wrong encoding. Declare charset=utf-8 in the Content-Type header or <meta charset="utf-8">.
For characters beyond ASCII, use the Unicode converter. To turn text into bits, try text to binary or the binary converter, and to escape strings for JSON, HTML or a shell, the string escape tool. For editors, linters and other code tools, browse code tools on DevHunt.
More free developer tools
FAQ
How many characters are in ASCII?+
ASCII has 128 codes, 0 to 127. 95 of them are printable (space, digits, letters and punctuation, codes 32 to 126) and 33 are control codes (0 to 31 and 127, DEL).
What is the ASCII code for A?+
Uppercase A is 65 in decimal, 0x41 in hex, 101 in octal and 01000001 in binary. Lowercase a is 97 (0x61). Every lowercase letter is its uppercase letter plus 32.
What is the ASCII value of a space?+
Space is 32 in decimal and 0x20 in hex. It is the first printable character. In URLs it is encoded as %20, and in HTML forms as +.
What is the ASCII code for Enter or a new line?+
The Enter key usually sends Carriage Return, 13 (0x0D, \r). A new line in a text file is Line Feed, 10 (0x0A, \n) on Linux and macOS, and the pair CR LF (13 10, \r\n) on Windows and in HTTP headers.
What is ASCII code 0?+
Code 0 is NUL, the null character. It prints nothing. C and many other languages use it to mark the end of a string, which is why it often shows up as \0.
Is ASCII 7-bit or 8-bit?+
ASCII is a 7-bit code. Computers store each character in an 8-bit byte with the top bit set to 0. Bytes 128 to 255 are not ASCII; their meaning depends on the encoding, such as Windows-1252, ISO-8859-1 or UTF-8.
What is the difference between ASCII and Unicode?+
Unicode covers every writing system, with over a million possible code points. Its first 128 code points are exactly ASCII. In UTF-8, those 128 characters are stored as the same single bytes, so any ASCII file is also valid UTF-8.
What is extended ASCII?+
Extended ASCII is a loose name for 8-bit encodings that keep ASCII in 0-127 and add 128 more characters in 128-255. There is no single extended ASCII: Windows-1252, ISO-8859-1 and the old DOS code page 437 all put different characters there. Turn on the 128-255 table in the tool to compare the two most common ones.
Sources: RFC 20: ASCII format for network interchange · Unicode C0 Controls and Basic Latin chart · WHATWG HTML named character references · WHATWG Encoding: windows-1252 · Unicode: Windows-1252 mapping · MDN: String.prototype.charCodeAt() · Python: ord(). Checked 2026-10-31.