How to use the ASCII converter
- Text → ASCII codes: type or paste text, choose decimal, hexadecimal, binary or octal, and copy the codes.
- ASCII codes → text: paste codes separated by spaces, commas or new lines. Auto-detect recognizes 8-digit binary, hex letters and 0x/0b prefixes.
- UTF-8 option: characters outside ASCII (such as é, ñ or emoji) are converted to their UTF-8 bytes, the way they are actually stored in files and on the web.
What is ASCII?
ASCII, the American Standard Code for Information Interchange, was first published by the American Standards Association in 1963 and revised in 1967; the current version is ANSI INCITS 4-1986. It is a 7-bit code, so it has 2⁷ = 128 values:
- 0–31 and 127: control characters for devices such as teletypes and printers. A few are still essential: tab (9), line feed (10) and carriage return (13).
- 32–126: the 95 printable characters: space, punctuation, digits 0–9 (48–57), uppercase A–Z (65–90) and lowercase a–z (97–122).
Converting text to ASCII by hand
Worked example
the word “Hi”
- H is decimal 72, which is 0x48 in hexadecimal and 01001000 in binary.
- i is decimal 105, which is 0x69 in hexadecimal and 01101001 in binary.
- So “Hi” is 72 105 in decimal, 48 69 in hex and 01001000 01101001 in binary.
Useful patterns: digits start at 48, so the code minus 48 is the digit’s value. Uppercase letters start at 65 and lowercase at 97; the two cases differ by exactly 32, a single bit.
ASCII table: printable characters (32–126)
| Dec | Hex | Binary | Octal | Character |
|---|---|---|---|---|
| 32 | 20 | 00100000 | 040 | Space |
| 33 | 21 | 00100001 | 041 | ! |
| 34 | 22 | 00100010 | 042 | " |
| 35 | 23 | 00100011 | 043 | # |
| 36 | 24 | 00100100 | 044 | $ |
| 37 | 25 | 00100101 | 045 | % |
| 38 | 26 | 00100110 | 046 | & |
| 39 | 27 | 00100111 | 047 | ' |
| 40 | 28 | 00101000 | 050 | ( |
| 41 | 29 | 00101001 | 051 | ) |
| 42 | 2A | 00101010 | 052 | * |
| 43 | 2B | 00101011 | 053 | + |
| 44 | 2C | 00101100 | 054 | , |
| 45 | 2D | 00101101 | 055 | - |
| 46 | 2E | 00101110 | 056 | . |
| 47 | 2F | 00101111 | 057 | / |
| 48 | 30 | 00110000 | 060 | 0 |
| 49 | 31 | 00110001 | 061 | 1 |
| 50 | 32 | 00110010 | 062 | 2 |
| 51 | 33 | 00110011 | 063 | 3 |
| 52 | 34 | 00110100 | 064 | 4 |
| 53 | 35 | 00110101 | 065 | 5 |
| 54 | 36 | 00110110 | 066 | 6 |
| 55 | 37 | 00110111 | 067 | 7 |
| 56 | 38 | 00111000 | 070 | 8 |
| 57 | 39 | 00111001 | 071 | 9 |
| 58 | 3A | 00111010 | 072 | : |
| 59 | 3B | 00111011 | 073 | ; |
| 60 | 3C | 00111100 | 074 | < |
| 61 | 3D | 00111101 | 075 | = |
| 62 | 3E | 00111110 | 076 | > |
| 63 | 3F | 00111111 | 077 | ? |
| 64 | 40 | 01000000 | 100 | @ |
| 65 | 41 | 01000001 | 101 | A |
| 66 | 42 | 01000010 | 102 | B |
| 67 | 43 | 01000011 | 103 | C |
| 68 | 44 | 01000100 | 104 | D |
| 69 | 45 | 01000101 | 105 | E |
| 70 | 46 | 01000110 | 106 | F |
| 71 | 47 | 01000111 | 107 | G |
| 72 | 48 | 01001000 | 110 | H |
| 73 | 49 | 01001001 | 111 | I |
| 74 | 4A | 01001010 | 112 | J |
| 75 | 4B | 01001011 | 113 | K |
| 76 | 4C | 01001100 | 114 | L |
| 77 | 4D | 01001101 | 115 | M |
| 78 | 4E | 01001110 | 116 | N |
| 79 | 4F | 01001111 | 117 | O |
| 80 | 50 | 01010000 | 120 | P |
| 81 | 51 | 01010001 | 121 | Q |
| 82 | 52 | 01010010 | 122 | R |
| 83 | 53 | 01010011 | 123 | S |
| 84 | 54 | 01010100 | 124 | T |
| 85 | 55 | 01010101 | 125 | U |
| 86 | 56 | 01010110 | 126 | V |
| 87 | 57 | 01010111 | 127 | W |
| 88 | 58 | 01011000 | 130 | X |
| 89 | 59 | 01011001 | 131 | Y |
| 90 | 5A | 01011010 | 132 | Z |
| 91 | 5B | 01011011 | 133 | [ |
| 92 | 5C | 01011100 | 134 | \ |
| 93 | 5D | 01011101 | 135 | ] |
| 94 | 5E | 01011110 | 136 | ^ |
| 95 | 5F | 01011111 | 137 | _ |
| 96 | 60 | 01100000 | 140 | ` |
| 97 | 61 | 01100001 | 141 | a |
| 98 | 62 | 01100010 | 142 | b |
| 99 | 63 | 01100011 | 143 | c |
| 100 | 64 | 01100100 | 144 | d |
| 101 | 65 | 01100101 | 145 | e |
| 102 | 66 | 01100110 | 146 | f |
| 103 | 67 | 01100111 | 147 | g |
| 104 | 68 | 01101000 | 150 | h |
| 105 | 69 | 01101001 | 151 | i |
| 106 | 6A | 01101010 | 152 | j |
| 107 | 6B | 01101011 | 153 | k |
| 108 | 6C | 01101100 | 154 | l |
| 109 | 6D | 01101101 | 155 | m |
| 110 | 6E | 01101110 | 156 | n |
| 111 | 6F | 01101111 | 157 | o |
| 112 | 70 | 01110000 | 160 | p |
| 113 | 71 | 01110001 | 161 | q |
| 114 | 72 | 01110010 | 162 | r |
| 115 | 73 | 01110011 | 163 | s |
| 116 | 74 | 01110100 | 164 | t |
| 117 | 75 | 01110101 | 165 | u |
| 118 | 76 | 01110110 | 166 | v |
| 119 | 77 | 01110111 | 167 | w |
| 120 | 78 | 01111000 | 170 | x |
| 121 | 79 | 01111001 | 171 | y |
| 122 | 7A | 01111010 | 172 | z |
| 123 | 7B | 01111011 | 173 | { |
| 124 | 7C | 01111100 | 174 | | |
| 125 | 7D | 01111101 | 175 | } |
| 126 | 7E | 01111110 | 176 | ~ |
ASCII control characters (0–31 and 127)
| Dec | Hex | Binary | Octal | Abbrev. | Meaning |
|---|---|---|---|---|---|
| 0 | 00 | 00000000 | 000 | NUL | Null |
| 1 | 01 | 00000001 | 001 | SOH | Control character |
| 2 | 02 | 00000010 | 002 | STX | Control character |
| 3 | 03 | 00000011 | 003 | ETX | Control character |
| 4 | 04 | 00000100 | 004 | EOT | Control character |
| 5 | 05 | 00000101 | 005 | ENQ | Control character |
| 6 | 06 | 00000110 | 006 | ACK | Control character |
| 7 | 07 | 00000111 | 007 | BEL | Bell (alert) |
| 8 | 08 | 00001000 | 010 | BS | Backspace |
| 9 | 09 | 00001001 | 011 | HT | Horizontal tab |
| 10 | 0A | 00001010 | 012 | LF | Line feed (new line) |
| 11 | 0B | 00001011 | 013 | VT | Vertical tab |
| 12 | 0C | 00001100 | 014 | FF | Form feed |
| 13 | 0D | 00001101 | 015 | CR | Carriage return |
| 14 | 0E | 00001110 | 016 | SO | Control character |
| 15 | 0F | 00001111 | 017 | SI | Control character |
| 16 | 10 | 00010000 | 020 | DLE | Control character |
| 17 | 11 | 00010001 | 021 | DC1 | Control character |
| 18 | 12 | 00010010 | 022 | DC2 | Control character |
| 19 | 13 | 00010011 | 023 | DC3 | Control character |
| 20 | 14 | 00010100 | 024 | DC4 | Control character |
| 21 | 15 | 00010101 | 025 | NAK | Control character |
| 22 | 16 | 00010110 | 026 | SYN | Control character |
| 23 | 17 | 00010111 | 027 | ETB | Control character |
| 24 | 18 | 00011000 | 030 | CAN | Control character |
| 25 | 19 | 00011001 | 031 | EM | Control character |
| 26 | 1A | 00011010 | 032 | SUB | Control character |
| 27 | 1B | 00011011 | 033 | ESC | Escape |
| 28 | 1C | 00011100 | 034 | FS | Control character |
| 29 | 1D | 00011101 | 035 | GS | Control character |
| 30 | 1E | 00011110 | 036 | RS | Control character |
| 31 | 1F | 00011111 | 037 | US | Control character |
| 127 | 7F | 01111111 | 177 | DEL | Delete |
ASCII, “extended ASCII” and UTF-8
Because ASCII uses only 7 bits, computers that stored characters in 8-bit bytes had 128 spare values. Different vendors filled them differently, creating many incompatible “extended ASCII” code pages, such as IBM code page 437, ISO-8859-1 (Latin-1) and Windows-1252. There is no single extended ASCII.
Unicode solved this by giving every character a unique code point. UTF-8 stores ASCII characters in one byte and other characters in two to four bytes: é is C3 A9, € is E2 82 AC, and 😀 is F0 9F 98 80.
ASCII in programming and spreadsheets
| Language / tool | Character → code | Code → character |
|---|---|---|
| JavaScript | "A".charCodeAt(0) → 65 | String.fromCharCode(65) |
| Python | ord("A") → 65 | chr(65) |
| Java / C# | (int) 'A' | (char) 65 |
| Excel / Google Sheets | =CODE("A") | =CHAR(65) |
| HTML | A or A | (entity renders “A”) |
Need special characters such as H₂O or x² that ASCII cannot represent? Try the subscript and superscript generator.