What ASCII is
ASCII — the American Standard Code for Information Interchange — assigns a number from 0 to 127 to each of 128 characters: English letters, digits, punctuation, the space, and control codes that once drove teleprinters (carriage return, line feed, bell and so on). It was published as an American standard in the 1960s (ANSI X3.4) and is reproduced for internet use in RFC 20. ASCII is still everywhere because UTF-8, the dominant text encoding today, keeps the same 128 codes as its first block.
How to use the converter
Type in the Text box and each character becomes its decimal code, separated by spaces (or commas, or one per line). Paste numbers into the Decimal codes box and they become text again. Numbers above 127 are not ASCII; rather than fail, the converter treats them as Unicode code points and says so. Likewise, if your text contains é, ü, € or emoji, you get their Unicode numbers with a note that they are outside ASCII.
Worked example
The word “ASCII” converts to 65 83 67 73 73. Some patterns make ASCII easy to work out by hand:
- Capital letters run from 65 (A) to 90 (Z).
- Lowercase letters run from 97 (a) to 122 (z) — each exactly 32 above its capital, which in binary is a single bit (
0100000). - Digits 0–9 are codes 48–57, so the digit's value is its code minus 48.
- The space is 32, and the visible characters run from 33 (!) to 126 (~).
Control characters
Codes 0–31 and 127 are not printable. Several still matter: 9 is the tab, 10 is line feed (LF, the Unix new line), 13 is carriage return (CR; Windows uses CR followed by LF), and 27 is escape, used in terminal colour codes. Decoding a control code produces the actual invisible character, which may show as a line break or nothing at all.
The full ASCII table (0–127)
Generated from the same code as the converter. A printable version lives on the ASCII table page.
Control characters (0–31)
| Dec | Hex | Binary | Char |
|---|---|---|---|
| 0 | 00 | 0000000 | NUL |
| 1 | 01 | 0000001 | SOH |
| 2 | 02 | 0000010 | STX |
| 3 | 03 | 0000011 | ETX |
| 4 | 04 | 0000100 | EOT |
| 5 | 05 | 0000101 | ENQ |
| 6 | 06 | 0000110 | ACK |
| 7 | 07 | 0000111 | BEL |
| 8 | 08 | 0001000 | BS |
| 9 | 09 | 0001001 | HT |
| 10 | 0A | 0001010 | LF |
| 11 | 0B | 0001011 | VT |
| 12 | 0C | 0001100 | FF |
| 13 | 0D | 0001101 | CR |
| 14 | 0E | 0001110 | SO |
| 15 | 0F | 0001111 | SI |
| 16 | 10 | 0010000 | DLE |
| 17 | 11 | 0010001 | DC1 |
| 18 | 12 | 0010010 | DC2 |
| 19 | 13 | 0010011 | DC3 |
| 20 | 14 | 0010100 | DC4 |
| 21 | 15 | 0010101 | NAK |
| 22 | 16 | 0010110 | SYN |
| 23 | 17 | 0010111 | ETB |
| 24 | 18 | 0011000 | CAN |
| 25 | 19 | 0011001 | EM |
| 26 | 1A | 0011010 | SUB |
| 27 | 1B | 0011011 | ESC |
| 28 | 1C | 0011100 | FS |
| 29 | 1D | 0011101 | GS |
| 30 | 1E | 0011110 | RS |
| 31 | 1F | 0011111 | US |
Space, punctuation and digits (32–63)
| Dec | Hex | Binary | Char |
|---|---|---|---|
| 32 | 20 | 0100000 | SP |
| 33 | 21 | 0100001 | ! |
| 34 | 22 | 0100010 | " |
| 35 | 23 | 0100011 | # |
| 36 | 24 | 0100100 | $ |
| 37 | 25 | 0100101 | % |
| 38 | 26 | 0100110 | & |
| 39 | 27 | 0100111 | ' |
| 40 | 28 | 0101000 | ( |
| 41 | 29 | 0101001 | ) |
| 42 | 2A | 0101010 | * |
| 43 | 2B | 0101011 | + |
| 44 | 2C | 0101100 | , |
| 45 | 2D | 0101101 | - |
| 46 | 2E | 0101110 | . |
| 47 | 2F | 0101111 | / |
| 48 | 30 | 0110000 | 0 |
| 49 | 31 | 0110001 | 1 |
| 50 | 32 | 0110010 | 2 |
| 51 | 33 | 0110011 | 3 |
| 52 | 34 | 0110100 | 4 |
| 53 | 35 | 0110101 | 5 |
| 54 | 36 | 0110110 | 6 |
| 55 | 37 | 0110111 | 7 |
| 56 | 38 | 0111000 | 8 |
| 57 | 39 | 0111001 | 9 |
| 58 | 3A | 0111010 | : |
| 59 | 3B | 0111011 | ; |
| 60 | 3C | 0111100 | < |
| 61 | 3D | 0111101 | = |
| 62 | 3E | 0111110 | > |
| 63 | 3F | 0111111 | ? |
Uppercase letters and symbols (64–95)
| Dec | Hex | Binary | Char |
|---|---|---|---|
| 64 | 40 | 1000000 | @ |
| 65 | 41 | 1000001 | A |
| 66 | 42 | 1000010 | B |
| 67 | 43 | 1000011 | C |
| 68 | 44 | 1000100 | D |
| 69 | 45 | 1000101 | E |
| 70 | 46 | 1000110 | F |
| 71 | 47 | 1000111 | G |
| 72 | 48 | 1001000 | H |
| 73 | 49 | 1001001 | I |
| 74 | 4A | 1001010 | J |
| 75 | 4B | 1001011 | K |
| 76 | 4C | 1001100 | L |
| 77 | 4D | 1001101 | M |
| 78 | 4E | 1001110 | N |
| 79 | 4F | 1001111 | O |
| 80 | 50 | 1010000 | P |
| 81 | 51 | 1010001 | Q |
| 82 | 52 | 1010010 | R |
| 83 | 53 | 1010011 | S |
| 84 | 54 | 1010100 | T |
| 85 | 55 | 1010101 | U |
| 86 | 56 | 1010110 | V |
| 87 | 57 | 1010111 | W |
| 88 | 58 | 1011000 | X |
| 89 | 59 | 1011001 | Y |
| 90 | 5A | 1011010 | Z |
| 91 | 5B | 1011011 | [ |
| 92 | 5C | 1011100 | \ |
| 93 | 5D | 1011101 | ] |
| 94 | 5E | 1011110 | ^ |
| 95 | 5F | 1011111 | _ |
Lowercase letters, symbols and DEL (96–127)
| Dec | Hex | Binary | Char |
|---|---|---|---|
| 96 | 60 | 1100000 | ` |
| 97 | 61 | 1100001 | a |
| 98 | 62 | 1100010 | b |
| 99 | 63 | 1100011 | c |
| 100 | 64 | 1100100 | d |
| 101 | 65 | 1100101 | e |
| 102 | 66 | 1100110 | f |
| 103 | 67 | 1100111 | g |
| 104 | 68 | 1101000 | h |
| 105 | 69 | 1101001 | i |
| 106 | 6A | 1101010 | j |
| 107 | 6B | 1101011 | k |
| 108 | 6C | 1101100 | l |
| 109 | 6D | 1101101 | m |
| 110 | 6E | 1101110 | n |
| 111 | 6F | 1101111 | o |
| 112 | 70 | 1110000 | p |
| 113 | 71 | 1110001 | q |
| 114 | 72 | 1110010 | r |
| 115 | 73 | 1110011 | s |
| 116 | 74 | 1110100 | t |
| 117 | 75 | 1110101 | u |
| 118 | 76 | 1110110 | v |
| 119 | 77 | 1110111 | w |
| 120 | 78 | 1111000 | x |
| 121 | 79 | 1111001 | y |
| 122 | 7A | 1111010 | z |
| 123 | 7B | 1111011 | { |
| 124 | 7C | 1111100 | | |
| 125 | 7D | 1111101 | } |
| 126 | 7E | 1111110 | ~ |
| 127 | 7F | 1111111 | DEL |
ASCII, extended ASCII and Unicode
“Extended ASCII” is not one standard: codes 128–255 meant different things in different code pages (Latin-1, Windows-1252 and others), which is why old documents sometimes show garbled accents. Unicode solved this by giving every character one number, and UTF-8 stores those numbers in one to four bytes. See the binary translator and hex converter to view the UTF-8 bytes of any text.
Converting text to ASCII by hand
- Find each character in the table above (or the printable ASCII table).
- Write down its decimal code, separated by spaces: “Hi!” is 72 105 33.
- Remember the space: it is a character too, code 32, and is easy to forget when encoding a sentence.
Why sorting by ASCII can surprise you
Because every capital letter has a lower code than every lowercase letter, sorting text by raw character codes puts all capitalised words first: “apple”, “Zebra”, “mango”, “Banana” sorts as “Banana”, “Zebra”, “apple”, “mango”, since Z is 90 and a is 97. Digits (48–57) come before both, and many punctuation marks before those. This is why file lists and spreadsheets often offer a separate “natural” or case-insensitive sort.
ASCII codes in programming
Most languages expose these numbers directly. In JavaScript, "A".charCodeAt(0) gives 65 and String.fromCharCode(72, 105) gives “Hi”; in Python, ord("A") and chr(72) do the same. Beyond ASCII, Python’s ord() returns the Unicode code point — the number this converter shows for é or emoji — while in JavaScript you need codePointAt(), because charCodeAt() returns UTF-16 code units and splits an emoji into two numbers.