ASCII is a 7-bit code with 128 values, numbered 0 to 127: codes 0 to 31 and 127 are control characters, and codes 32 to 126 are the 95 printable characters, starting with the space at 32. Capital A is 65 (hex 41), small a is 97 (hex 61) and the digit 0 is 48 (hex 30). The table was checked on 27 November 2026 against the code chart in RFC 20, which reproduces the USA Standard Code for Information Interchange of 1968, and against the UTF-8 definition in RFC 3629. Every decimal, hex, octal and binary value below was generated from the code number itself.
Quick facts
| Range or character | Decimal | Hex | Notes |
|---|---|---|---|
| Control characters | 0 to 31, and 127 | 00 to 1F, and 7F | 33 codes; RFC 20 notes that DEL is strictly not a control character |
| Space | 32 | 20 | The first printable code, normally shown as blank |
| Digits 0 to 9 | 48 to 57 | 30 to 39 | The value of a digit is its code minus 48 |
| Capital letters A to Z | 65 to 90 | 41 to 5A | 26 codes in alphabet order |
| Small letters a to z | 97 to 122 | 61 to 7A | Each is its capital plus 32 |
| Highest code | 127 | 7F | DEL; ASCII stops here because it uses 7 bits |
Patterns that save looking things up
- Capital and small letters differ by 32. A is 65 and a is 97, Z is 90 and z is 122. In binary, 32 is a single bit, so switching case only flips that one bit: A is
1000001and a is1100001. - Digits sit at 48 to 57. Subtract 48 from the code of a digit to get its number: 7 is code 55, and 55 minus 48 is 7. In hex the digit simply follows a 3: 7 is hex 37.
- Letters count from 1 in the low bits. A is hex 41 and a is hex 61, so the second hex digit of the letters A to O and a to o is its place in the alphabet in hex: E is hex 45, the fifth letter.
- RFC 20 uses column and row numbers. It writes K as 4/11: column 4 is the top three bits (100) and row 11 the bottom four (1011), so K is binary
1001011, decimal 75, hex 4B. To convert a column/row pair, multiply the column by 16 and add the row.
Control characters (0 to 31 and 127)
The names are those in the RFC 20 legend. Most were meant for teleprinters and data links. The ones still met every day are HT (tab, 9), LF (line feed, 10), CR (carriage return, 13), ESC (escape, 27), NUL (0) and DEL (127). RFC 20 marks BS, HT, LF, VT, FF and CR as format effectors, the codes that move the print position, and groups FS, GS, RS and US as information separators for splitting data into files, groups, records and units.
| Dec | Hex | Oct | Binary | Abbr. | Name |
|---|---|---|---|---|---|
| 0 | 00 | 000 | 0000000 | NUL | Null |
| 1 | 01 | 001 | 0000001 | SOH | Start of Heading |
| 2 | 02 | 002 | 0000010 | STX | Start of Text |
| 3 | 03 | 003 | 0000011 | ETX | End of Text |
| 4 | 04 | 004 | 0000100 | EOT | End of Transmission |
| 5 | 05 | 005 | 0000101 | ENQ | Enquiry |
| 6 | 06 | 006 | 0000110 | ACK | Acknowledge |
| 7 | 07 | 007 | 0000111 | BEL | Bell |
| 8 | 08 | 010 | 0001000 | BS | Backspace |
| 9 | 09 | 011 | 0001001 | HT | Horizontal Tabulation |
| 10 | 0A | 012 | 0001010 | LF | Line Feed |
| 11 | 0B | 013 | 0001011 | VT | Vertical Tabulation |
| 12 | 0C | 014 | 0001100 | FF | Form Feed |
| 13 | 0D | 015 | 0001101 | CR | Carriage Return |
| 14 | 0E | 016 | 0001110 | SO | Shift Out |
| 15 | 0F | 017 | 0001111 | SI | Shift In |
| 16 | 10 | 020 | 0010000 | DLE | Data Link Escape |
| 17 | 11 | 021 | 0010001 | DC1 | Device Control 1 |
| 18 | 12 | 022 | 0010010 | DC2 | Device Control 2 |
| 19 | 13 | 023 | 0010011 | DC3 | Device Control 3 |
| 20 | 14 | 024 | 0010100 | DC4 | Device Control 4 |
| 21 | 15 | 025 | 0010101 | NAK | Negative Acknowledge |
| 22 | 16 | 026 | 0010110 | SYN | Synchronous Idle |
| 23 | 17 | 027 | 0010111 | ETB | End of Transmission Block |
| 24 | 18 | 030 | 0011000 | CAN | Cancel |
| 25 | 19 | 031 | 0011001 | EM | End of Medium |
| 26 | 1A | 032 | 0011010 | SUB | Substitute |
| 27 | 1B | 033 | 0011011 | ESC | Escape |
| 28 | 1C | 034 | 0011100 | FS | File Separator |
| 29 | 1D | 035 | 0011101 | GS | Group Separator |
| 30 | 1E | 036 | 0011110 | RS | Record Separator |
| 31 | 1F | 037 | 0011111 | US | Unit Separator |
| 127 | 7F | 177 | 1111111 | DEL | Delete |
Printable characters (32 to 126)
| Dec | Hex | Oct | Binary | Character |
|---|---|---|---|---|
| 32 | 20 | 040 | 0100000 | (space) |
| 33 | 21 | 041 | 0100001 | ! |
| 34 | 22 | 042 | 0100010 | " |
| 35 | 23 | 043 | 0100011 | # |
| 36 | 24 | 044 | 0100100 | $ |
| 37 | 25 | 045 | 0100101 | % |
| 38 | 26 | 046 | 0100110 | & |
| 39 | 27 | 047 | 0100111 | ' |
| 40 | 28 | 050 | 0101000 | ( |
| 41 | 29 | 051 | 0101001 | ) |
| 42 | 2A | 052 | 0101010 | * |
| 43 | 2B | 053 | 0101011 | + |
| 44 | 2C | 054 | 0101100 | , |
| 45 | 2D | 055 | 0101101 | - |
| 46 | 2E | 056 | 0101110 | . |
| 47 | 2F | 057 | 0101111 | / |
| 48 | 30 | 060 | 0110000 | 0 |
| 49 | 31 | 061 | 0110001 | 1 |
| 50 | 32 | 062 | 0110010 | 2 |
| 51 | 33 | 063 | 0110011 | 3 |
| 52 | 34 | 064 | 0110100 | 4 |
| 53 | 35 | 065 | 0110101 | 5 |
| 54 | 36 | 066 | 0110110 | 6 |
| 55 | 37 | 067 | 0110111 | 7 |
| 56 | 38 | 070 | 0111000 | 8 |
| 57 | 39 | 071 | 0111001 | 9 |
| 58 | 3A | 072 | 0111010 | : |
| 59 | 3B | 073 | 0111011 | ; |
| 60 | 3C | 074 | 0111100 | < |
| 61 | 3D | 075 | 0111101 | = |
| 62 | 3E | 076 | 0111110 | > |
| 63 | 3F | 077 | 0111111 | ? |
| 64 | 40 | 100 | 1000000 | @ |
| 65 | 41 | 101 | 1000001 | A |
| 66 | 42 | 102 | 1000010 | B |
| 67 | 43 | 103 | 1000011 | C |
| 68 | 44 | 104 | 1000100 | D |
| 69 | 45 | 105 | 1000101 | E |
| 70 | 46 | 106 | 1000110 | F |
| 71 | 47 | 107 | 1000111 | G |
| 72 | 48 | 110 | 1001000 | H |
| 73 | 49 | 111 | 1001001 | I |
| 74 | 4A | 112 | 1001010 | J |
| 75 | 4B | 113 | 1001011 | K |
| 76 | 4C | 114 | 1001100 | L |
| 77 | 4D | 115 | 1001101 | M |
| 78 | 4E | 116 | 1001110 | N |
| 79 | 4F | 117 | 1001111 | O |
| 80 | 50 | 120 | 1010000 | P |
| 81 | 51 | 121 | 1010001 | Q |
| 82 | 52 | 122 | 1010010 | R |
| 83 | 53 | 123 | 1010011 | S |
| 84 | 54 | 124 | 1010100 | T |
| 85 | 55 | 125 | 1010101 | U |
| 86 | 56 | 126 | 1010110 | V |
| 87 | 57 | 127 | 1010111 | W |
| 88 | 58 | 130 | 1011000 | X |
| 89 | 59 | 131 | 1011001 | Y |
| 90 | 5A | 132 | 1011010 | Z |
| 91 | 5B | 133 | 1011011 | [ |
| 92 | 5C | 134 | 1011100 | \ |
| 93 | 5D | 135 | 1011101 | ] |
| 94 | 5E | 136 | 1011110 | ^ |
| 95 | 5F | 137 | 1011111 | _ |
| 96 | 60 | 140 | 1100000 | ` |
| 97 | 61 | 141 | 1100001 | a |
| 98 | 62 | 142 | 1100010 | b |
| 99 | 63 | 143 | 1100011 | c |
| 100 | 64 | 144 | 1100100 | d |
| 101 | 65 | 145 | 1100101 | e |
| 102 | 66 | 146 | 1100110 | f |
| 103 | 67 | 147 | 1100111 | g |
| 104 | 68 | 150 | 1101000 | h |
| 105 | 69 | 151 | 1101001 | i |
| 106 | 6A | 152 | 1101010 | j |
| 107 | 6B | 153 | 1101011 | k |
| 108 | 6C | 154 | 1101100 | l |
| 109 | 6D | 155 | 1101101 | m |
| 110 | 6E | 156 | 1101110 | n |
| 111 | 6F | 157 | 1101111 | o |
| 112 | 70 | 160 | 1110000 | p |
| 113 | 71 | 161 | 1110001 | q |
| 114 | 72 | 162 | 1110010 | r |
| 115 | 73 | 163 | 1110011 | s |
| 116 | 74 | 164 | 1110100 | t |
| 117 | 75 | 165 | 1110101 | u |
| 118 | 76 | 166 | 1110110 | v |
| 119 | 77 | 167 | 1110111 | w |
| 120 | 78 | 170 | 1111000 | x |
| 121 | 79 | 171 | 1111001 | y |
| 122 | 7A | 172 | 1111010 | z |
| 123 | 7B | 173 | 1111011 | { |
| 124 | 7C | 174 | 1111100 | | |
| 125 | 7D | 175 | 1111101 | } |
| 126 | 7E | 176 | 1111110 | ~ |
ASCII, UTF-8 and extended ASCII
RFC 20 proposed sending 7-bit ASCII inside an 8-bit byte whose highest bit is always 0, so every ASCII byte is between hex 00 and 7F. UTF-8 was designed around that: RFC 3629 says it preserves the full US-ASCII range, and its encoding table puts the characters from U+0000 to U+007F in a single byte of the form 0xxxxxxx. A file that contains only ASCII characters is therefore also a valid UTF-8 file, byte for byte, and the first 128 Unicode code points are the ASCII characters with the same numbers.
Values from 128 to 255 are not ASCII. Tables called extended ASCII show one of several 8-bit code pages that fill those values in different ways, so the same byte can stand for different characters depending on the code page. In UTF-8, the RFC 3629 table shows that every byte from hex 80 upward has its top bit set and only appears as part of a multi-byte character. If accented letters turn into pairs of odd symbols, text saved in one encoding is usually being read as another.
For codes inside web addresses, see the URL encoding characters table, which lists the percent codes built from these same hex values, and the URL Encoder and Decoder. Base64, which turns any bytes into a set of 64 printable ASCII characters, is explained in how much Base64 increases size.
Sources and dates
| Page | Read | Used for |
|---|---|---|
| RFC 20: ASCII format for Network Interchange | 27 November 2026 | The code chart, 7 bits in an 8-bit byte with the high bit 0, column and row notation, control character names, DEL note |
| RFC 3629: UTF-8, a transformation format of ISO 10646 | 27 November 2026 | UTF-8 preserves the US-ASCII range; U+0000 to U+007F as one byte 0xxxxxxx |
Frequently asked questions
What is the ASCII code for A?
Capital A is 65 in decimal, 41 in hex and 1000001 in binary. Small a is 97 in decimal, 61 in hex and 1100001 in binary, 32 higher than the capital.
How many characters are in ASCII?
128, numbered 0 to 127. 33 of them are control characters (0 to 31 and 127) and 95 are printable characters from the space at 32 to the tilde at 126.
What is the ASCII code for a space?
The space is 32 in decimal and 20 in hex. That is why a space in a web address is written as %20 when it is percent encoded.
Is ASCII the same as UTF-8?
Not the same, but compatible. UTF-8 encodes the first 128 Unicode characters as the same single bytes as ASCII, so plain ASCII text is valid UTF-8. UTF-8 then adds multi-byte sequences for every other character.
What is extended ASCII?
A name for 8-bit tables that use the values 128 to 255 for extra letters and symbols. They are not part of ASCII, which stops at 127, and different code pages use those values for different characters.