ASCII Table
Decimal · Hexadecimal · Octal · Binary · Character (0–127)
Complete ASCII character reference for all 128 standard ASCII codes. Search by character, decimal value or hex code. Click any row to copy its reference to clipboard.
| Dec | Hex | Oct | Binary | Char |
|---|---|---|---|---|
| 0 | 00 | 000 | 0000000 | NUL |
| 1 | 01 | 001 | 0000001 | SOH |
| 2 | 02 | 002 | 0000010 | STX |
| 3 | 03 | 003 | 0000011 | ETX |
| 4 | 04 | 004 | 0000100 | EOT |
| 5 | 05 | 005 | 0000101 | ENQ |
| 6 | 06 | 006 | 0000110 | ACK |
| 7 | 07 | 007 | 0000111 | BEL |
| 8 | 08 | 010 | 0001000 | BS |
| 9 | 09 | 011 | 0001001 | HT |
| 10 | 0A | 012 | 0001010 | LF |
| 11 | 0B | 013 | 0001011 | VT |
| 12 | 0C | 014 | 0001100 | FF |
| 13 | 0D | 015 | 0001101 | CR |
| 14 | 0E | 016 | 0001110 | SO |
| 15 | 0F | 017 | 0001111 | SI |
| 16 | 10 | 020 | 0010000 | DLE |
| 17 | 11 | 021 | 0010001 | DC1 |
| 18 | 12 | 022 | 0010010 | DC2 |
| 19 | 13 | 023 | 0010011 | DC3 |
| 20 | 14 | 024 | 0010100 | DC4 |
| 21 | 15 | 025 | 0010101 | NAK |
| 22 | 16 | 026 | 0010110 | SYN |
| 23 | 17 | 027 | 0010111 | ETB |
| 24 | 18 | 030 | 0011000 | CAN |
| 25 | 19 | 031 | 0011001 | EM |
| 26 | 1A | 032 | 0011010 | SUB |
| 27 | 1B | 033 | 0011011 | ESC |
| 28 | 1C | 034 | 0011100 | FS |
| 29 | 1D | 035 | 0011101 | GS |
| 30 | 1E | 036 | 0011110 | RS |
| 31 | 1F | 037 | 0011111 | US |
| 32 | 20 | 040 | 0100000 | |
| 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 | ~ |
| 127 | 7F | 177 | 1111111 | DEL |
Click any row to copy its Dec / Hex / Char reference to clipboard.
What Is ASCII?
ASCII (American Standard Code for Information Interchange) is the oldest and most universally supported character encoding standard in computing. Developed in the early 1960s and first published as a US standard in 1963, ASCII uses 7 bits to represent exactly 128 characters — numbered 0 through 127. Every modern computing system, programming language, network protocol and file format is built on top of ASCII.
ASCII divides into three main groups. Control characters (0–31 and 127) are non-printable codes originally designed to control teletype printers and serial communications — many remain in active use today: 9 (tab), 10 (newline LF on Unix/Linux), 13 (carriage return CR), 27 (escape). Printable characters (32–126) cover space, punctuation, digits 0–9 (codes 48–57), uppercase A–Z (65–90) and lowercase a–z (97–122). The structure is deliberate: digits start at 48 (0x30), letters at 65 (0x41) and 97 (0x61), with exactly 32 (0x20) separating upper from lowercase.
ASCII's 128-character range is sufficient for English but inadequate for other languages. Unicode was created to address this — over 140,000 characters covering every writing system. Critically, UTF-8 (the dominant web encoding, used on over 98% of websites) is fully backward-compatible with ASCII: bytes 0–127 are identical in both encodings, so any pure ASCII file is automatically a valid UTF-8 file.
A=65 → a=97), subtract 32 to go the other way. In binary: A=1000001, a=1100001 — only bit 5 (the 0x20 bit) differs. This is why char | 0x20 converts to lowercase and char & ~0x20 converts to uppercase in C.
How to Use the ASCII Table
- Search by character — type a letter, digit or symbol (e.g.
Aor@) in the search box. Matching rows appear instantly. - Search by decimal value — type the decimal code (e.g.
65) to jump directly to that character's row. - Search by hex value — type a hex code (e.g.
41for A or20for space) to find by hexadecimal. - Read all number bases — each row shows the same character in decimal, hexadecimal, octal and binary so you can compare representations side by side.
- Click to copy — click any table row to copy its Dec/Hex/Char reference to your clipboard. A confirmation toast appears.
- Use quick-reference chips — click the chips in the common values section below to instantly copy the most-used ASCII codes.
ASCII Encoding Explained
ASCII encodes each character as a 7-bit binary integer. The 128 possible values (0–127) are divided into control codes and printable characters. The encoding choices were not arbitrary — they were designed with computing efficiency in mind.
Number base representations
Each ASCII code can be expressed in any number base. The table shows four: decimal (base 10, everyday counting), hexadecimal (base 16, used in programming and memory addresses), octal (base 8, used in Unix file permissions and some legacy systems), and binary (base 2, the actual bit pattern stored in memory).
Converting between them: Decimal 65 → Hex: 65 ÷ 16 = 4 remainder 1 → 0x41. Decimal 65 → Binary: 64+1 = 1000000+1 = 1000001. Decimal 65 → Octal: 65 ÷ 8 = 8 remainder 1, 8 ÷ 8 = 1 remainder 0 → 101.
Digit encoding shortcut
ASCII digits '0'–'9' start at code 48. To get the numeric value of a digit character, subtract 48: '5' = 53, 53 − 48 = 5. In hex: digit '0'=0x30, so digit_value = ascii_code & 0x0F (mask the lower nibble).
URL encoding
URL percent-encoding uses ASCII hex values: space = %20 (hex 20 = decimal 32), @ = %40 (hex 40 = decimal 64), / = %2F (hex 2F = decimal 47). This is why knowing ASCII hex values is essential for web development.
Essential ASCII Codes Quick Reference
The most frequently needed ASCII codes for programmers and developers:
Worked Examples
Example 1: Converting "Hi" to ASCII codes
The string "Hi" = H (72) + i (105). In hex: 0x48 0x69. In binary: 1001000 1101001. This is the exact byte sequence stored in memory or sent over a network when you transmit the text "Hi" in ASCII or UTF-8.
Example 2: URL-encoding a string
The URL query string "name=John Doe" must have the space encoded. Space = ASCII 32 = hex 0x20, so it becomes %20. Result: name=John%20Doe. The ampersand (&) = ASCII 38 = 0x26 → %26 when it appears in a value rather than as a separator.
Example 3: Case conversion in C
To lowercase a character in C without using a library: char lower = 'A' | 0x20; gives 'a'. To uppercase: char upper = 'a' & ~0x20; gives 'A'. This works because the only bit difference between uppercase and lowercase ASCII letters is bit 5 (value 32 = 0x20).
Practical Tips for Using ASCII Codes
- Digit extraction shortcut — to get the integer value of an ASCII digit, use
ascii_code - 48or equivalentlyascii_code & 0x0F. Example: '7' = 55, 55 - 48 = 7. - Alphabetic range checks — to check if a character is uppercase:
c >= 65 && c <= 90. Lowercase:c >= 97 && c <= 122. Digit:c >= 48 && c <= 57. - Windows vs Unix line endings — Windows uses CR+LF (13+10, \r\n), Unix/Linux/Mac uses LF only (10, \n). Mixing these causes extra blank lines or ^M characters when reading files across platforms.
- Null terminator in C — ASCII 0 (NUL) is used to mark the end of a string in C. It is not the same as the character '0' (ASCII 48). Always be aware of this when working with C-style strings.
- JSON and string escaping — double quote (34, 0x22) must be escaped as \" in JSON strings. Backslash (92, 0x5C) must be escaped as \\. Tab (9) as \t, newline (10) as \n.
- Regex character classes — [A-Z] matches codes 65–90, [a-z] matches 97–122, [0-9] matches 48–57. These work because ASCII assigns consecutive codes to each range.
- Base64 encoding — Base64 encodes binary data using ASCII printable characters (A-Z, a-z, 0-9, +, /). The output is always ASCII, making it safe to embed binary data in text-based formats.
Frequently Asked Questions
ASCII (American Standard Code for Information Interchange) is a character encoding standard that uses 7 bits to represent 128 characters (codes 0–127). Developed in the early 1960s, it encodes control characters (0–31), printable characters including letters, digits and symbols (32–126), and the delete character (127). It forms the foundation of modern character encoding systems including UTF-8 and Unicode.
The ASCII code for space is 32 in decimal, 0x20 in hexadecimal, 040 in octal, and 0100000 in binary. It is the first printable ASCII character. In URLs, space is encoded as %20 (its hex value). In programming, you can use ASCII 32 or the space character literal ' '.
Uppercase letters A–Z are ASCII codes 65–90 (0x41–0x5A in hex). Lowercase letters a–z are codes 97–122 (0x61–0x7A). The difference between uppercase and lowercase of the same letter is always 32 (e.g. A=65, a=97, difference=32). In binary, this is simply flipping bit 5 — the 0x20 bit.
ASCII control characters are codes 0–31 (and 127). Originally designed to control teletype machines, key ones still used today: 9=HT (tab, \t), 10=LF (newline \n on Unix/Linux/Mac), 13=CR (carriage return \r, used with LF for Windows line endings), 27=ESC (escape), 0=NUL (null terminator in C strings), 7=BEL (alert/bell).
ASCII defines only 128 characters (0–127) using 7 bits, covering English text. Unicode extends this to over 140,000 characters covering virtually every writing system. UTF-8, the most common Unicode encoding, is fully backward compatible with ASCII — bytes 0–127 in UTF-8 are identical to ASCII. Any pure ASCII file is automatically a valid UTF-8 file.
The ASCII assignment was designed with practical priorities: codes 0–31 for control characters, 32 for space, then punctuation and digits (48–57) before letters. Digits starting at 48 (0x30) means the digit value equals (ASCII code − 48). The 32-unit gap between uppercase (65) and lowercase (97) enables a single bitwise XOR (with 0x20) to toggle case.
Python: ord('A') returns 65; chr(65) returns 'A'. JavaScript: 'A'.charCodeAt(0) returns 65; String.fromCharCode(65) returns 'A'. C/C++: (int)'A' returns 65. Java: (int)'A' returns 65. These conversions are essential for character arithmetic, validation, and encoding operations.