Every character a computer stores is a number. ASCII is the oldest and simplest
table of those numbers: 128 characters, from 0 to 127. An ASCII converter turns
text into those codes and codes back into text. A is 65, a is 97 and a space is
32.
Written in decimal, like 72 105.
11 characters converted. Runs in your browser. Nothing you type is uploaded.
Type in the left box and it converts as you go. Choose Text to ASCII to get the codes, or ASCII to text to read them back, and set the Number base to write or read them in decimal, hex, octal or binary. Decode this sends the result back round the other way, so a round trip is one click. The ASCII table is below the explanation.
How text becomes ASCII codes
- Take each character of the text.
- Look up its code in the ASCII table.
Ais 65. - Write the code in the base you want: 65 is
41in hex,101in octal and01000001in binary. - Put a space between the codes so they stay readable.
| Character | Decimal | Hex | Octal | Binary |
|---|---|---|---|---|
A | 65 | 41 | 101 | 01000001 |
a | 97 | 61 | 141 | 01100001 |
0 | 48 | 30 | 060 | 00110000 |
| space | 32 | 20 | 040 | 00100000 |
~ | 126 | 7E | 176 | 01111110 |
Upper and lower case letters are 32 apart: A is 65 and a is 97. The digit 0 is
48, not 0, so a digit's value is its code minus 48.
Reading ASCII codes
Split the codes at the spaces or commas, read each one in its base, and look the
number up. 72 105 in decimal is H and i. If the base is wrong the answer is
wrong or an error: 65 is A in decimal, e in hex, and not a binary number at
all. The tool reports the first code it cannot read, with its position, rather than
guessing.
ASCII table
All 128 codes. The shaded rows are control characters, which are commands for a
terminal or printer rather than shapes to draw. LF is the line break at the end of
a line, TAB is the tab key and ESC starts the escape sequences terminals use
for colours.
| 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 | TAB | Horizontal tab |
| 10 | 0A | 012 | 00001010 | LF | Line feed (newline) |
| 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 |
| 32 | 20 | 040 | 00100000 | SP | Space |
| 33 | 21 | 041 | 00100001 | ! | |
| 34 | 22 | 042 | 00100010 | " | |
| 35 | 23 | 043 | 00100011 | # | |
| 36 | 24 | 044 | 00100100 | $ | |
| 37 | 25 | 045 | 00100101 | % | |
| 38 | 26 | 046 | 00100110 | & | |
| 39 | 27 | 047 | 00100111 | ' | |
| 40 | 28 | 050 | 00101000 | ( | |
| 41 | 29 | 051 | 00101001 | ) | |
| 42 | 2A | 052 | 00101010 | * | |
| 43 | 2B | 053 | 00101011 | + | |
| 44 | 2C | 054 | 00101100 | , | |
| 45 | 2D | 055 | 00101101 | - | |
| 46 | 2E | 056 | 00101110 | . | |
| 47 | 2F | 057 | 00101111 | / | |
| 48 | 30 | 060 | 00110000 | 0 | |
| 49 | 31 | 061 | 00110001 | 1 | |
| 50 | 32 | 062 | 00110010 | 2 | |
| 51 | 33 | 063 | 00110011 | 3 | |
| 52 | 34 | 064 | 00110100 | 4 | |
| 53 | 35 | 065 | 00110101 | 5 | |
| 54 | 36 | 066 | 00110110 | 6 | |
| 55 | 37 | 067 | 00110111 | 7 | |
| 56 | 38 | 070 | 00111000 | 8 | |
| 57 | 39 | 071 | 00111001 | 9 | |
| 58 | 3A | 072 | 00111010 | : | |
| 59 | 3B | 073 | 00111011 | ; | |
| 60 | 3C | 074 | 00111100 | < | |
| 61 | 3D | 075 | 00111101 | = | |
| 62 | 3E | 076 | 00111110 | > | |
| 63 | 3F | 077 | 00111111 | ? | |
| 64 | 40 | 100 | 01000000 | @ | |
| 65 | 41 | 101 | 01000001 | A | |
| 66 | 42 | 102 | 01000010 | B | |
| 67 | 43 | 103 | 01000011 | C | |
| 68 | 44 | 104 | 01000100 | D | |
| 69 | 45 | 105 | 01000101 | E | |
| 70 | 46 | 106 | 01000110 | F | |
| 71 | 47 | 107 | 01000111 | G | |
| 72 | 48 | 110 | 01001000 | H | |
| 73 | 49 | 111 | 01001001 | I | |
| 74 | 4A | 112 | 01001010 | J | |
| 75 | 4B | 113 | 01001011 | K | |
| 76 | 4C | 114 | 01001100 | L | |
| 77 | 4D | 115 | 01001101 | M | |
| 78 | 4E | 116 | 01001110 | N | |
| 79 | 4F | 117 | 01001111 | O | |
| 80 | 50 | 120 | 01010000 | P | |
| 81 | 51 | 121 | 01010001 | Q | |
| 82 | 52 | 122 | 01010010 | R | |
| 83 | 53 | 123 | 01010011 | S | |
| 84 | 54 | 124 | 01010100 | T | |
| 85 | 55 | 125 | 01010101 | U | |
| 86 | 56 | 126 | 01010110 | V | |
| 87 | 57 | 127 | 01010111 | W | |
| 88 | 58 | 130 | 01011000 | X | |
| 89 | 59 | 131 | 01011001 | Y | |
| 90 | 5A | 132 | 01011010 | Z | |
| 91 | 5B | 133 | 01011011 | [ | |
| 92 | 5C | 134 | 01011100 | \ | |
| 93 | 5D | 135 | 01011101 | ] | |
| 94 | 5E | 136 | 01011110 | ^ | |
| 95 | 5F | 137 | 01011111 | _ | |
| 96 | 60 | 140 | 01100000 | ` | |
| 97 | 61 | 141 | 01100001 | a | |
| 98 | 62 | 142 | 01100010 | b | |
| 99 | 63 | 143 | 01100011 | c | |
| 100 | 64 | 144 | 01100100 | d | |
| 101 | 65 | 145 | 01100101 | e | |
| 102 | 66 | 146 | 01100110 | f | |
| 103 | 67 | 147 | 01100111 | g | |
| 104 | 68 | 150 | 01101000 | h | |
| 105 | 69 | 151 | 01101001 | i | |
| 106 | 6A | 152 | 01101010 | j | |
| 107 | 6B | 153 | 01101011 | k | |
| 108 | 6C | 154 | 01101100 | l | |
| 109 | 6D | 155 | 01101101 | m | |
| 110 | 6E | 156 | 01101110 | n | |
| 111 | 6F | 157 | 01101111 | o | |
| 112 | 70 | 160 | 01110000 | p | |
| 113 | 71 | 161 | 01110001 | q | |
| 114 | 72 | 162 | 01110010 | r | |
| 115 | 73 | 163 | 01110011 | s | |
| 116 | 74 | 164 | 01110100 | t | |
| 117 | 75 | 165 | 01110101 | u | |
| 118 | 76 | 166 | 01110110 | v | |
| 119 | 77 | 167 | 01110111 | w | |
| 120 | 78 | 170 | 01111000 | x | |
| 121 | 79 | 171 | 01111001 | y | |
| 122 | 7A | 172 | 01111010 | z | |
| 123 | 7B | 173 | 01111011 | { | |
| 124 | 7C | 174 | 01111100 | | | |
| 125 | 7D | 175 | 01111101 | } | |
| 126 | 7E | 176 | 01111110 | ~ | |
| 127 | 7F | 177 | 01111111 | DEL | Delete |
Gotchas
- ASCII stops at 127.
é,€, a Chinese character and an emoji have no ASCII code. The tool leaves them out and tells you which, with their Unicode code point, rather than inventing a replacement. - Extended ASCII is not ASCII. Codes 128 to 255 mean different characters in different code pages, which is why the same file can show different symbols on different computers. Nothing above 127 is converted here.
- Control characters are invisible. Code 10 is a line break and code 0 is nothing you can see. They are in the table and decode like any other code.
- The base matters.
41is)in decimal andAin hex. Pick the base your codes use before you trust the output. - ASCII is not secret. It is another way of writing the same text. Anyone can convert it back, so do not use it to hide anything.
Related
- Binary Translator, for text as UTF-8 bytes in binary, including characters beyond ASCII.
- URL Encoder and Decoder, which writes the same bytes as percent-escapes in hex.
- Base64 Encoder and Decoder, another way to write the same bytes as text.
- Hash Generator, for the fixed-length digest of some text rather than a reversible encoding.
- The Python cheat sheet for
ord,chrandhex. - The JavaScript cheat sheet for
charCodeAtandString.fromCharCode.
Common questions
How do I convert text to ASCII?
Type or paste the text into the left box with Text to ASCII selected. Each character is replaced by its ASCII code, a number from 0 to 127, and the codes are written with a space between them. The letter A is 65, so Hi cat becomes 72 105 32 99 97 116. Choose Decimal, Hex, Octal or Binary to write the codes in the base you need.
How do I convert ASCII codes to text?
Switch to ASCII to text, pick the base the codes are written in, and paste them. Spaces, commas and line breaks can separate the codes, in any mix, so 72, 105 and 72 105 both read as Hi. In hex an optional 0x in front of each code is fine, and in binary 0b is.
What is an ASCII code?
ASCII is a table from 1963 that gives 128 characters a number: 0 to 127. The digits, the English upper and lower case letters and the common punctuation each have a code, and so do 33 control characters such as line feed and tab. An ASCII code is that number, which can be written in decimal, hex, octal or binary. A capital A is 65, which is 41 in hex, 101 in octal and 01000001 in binary.
Where is the ASCII table?
Below the converter on this page. It lists all 128 codes, 0 to 127, in decimal, hex, octal and binary, with the character next to each one and the name of every control character, such as LF for line feed and ESC for escape.
What happens to letters like é, or an emoji?
They are not ASCII, so they have no ASCII code. Instead of swapping them for a question mark, the converter leaves them out of the codes and shows a warning that names each one with its Unicode code point, such as U+00E9 for é or U+1F431 for the cat emoji. To get the bytes for those characters, use the Binary Translator or the URL Encoder, which write UTF-8.
What is the difference between ASCII and Unicode?
Unicode is the larger table: over a million possible characters from every writing system. ASCII is the first 128 of them, with the same numbers. That is why the code for A is 65 in both. UTF-8, the encoding most of the web uses, writes those first 128 characters as the same single byte as ASCII and every other character as two to four bytes.
Why does it say my code is not ASCII?
Either a code is bigger than 127, which ASCII does not have, or it is not a number in the base you chose. A hex code with a G in it, or a binary code with a 2, is reported with its position. A decimal 200 is over the limit. Check that the base setting matches how your codes are written: 41 is a closing bracket in decimal but the letter A in hex.
Is anything I paste here sent to a server?
No. The conversion runs in your browser and neither box is submitted anywhere. The site records that the tool was used, in which direction and base, and how long the input was, so we know which tools are worth building next. The text itself is never part of that.