ASCII Table — Decimal, Hex, Binary, Octal & Character Chart
Browse all 128 ASCII codes (0–127) with their decimal, hexadecimal, octal, and binary representations. Control characters (0–31, 127) are highlighted and labeled with their standard abbreviations and full names. Filter to show only printable characters or only control codes, and search by decimal number, hex value, or character.
| Dec | Hex | Char | Description |
|---|---|---|---|
| 0 | 0x00 | NUL | NUL — Null |
| 1 | 0x01 | SOH | SOH — Start of Heading |
| 2 | 0x02 | STX | STX — Start of Text |
| 3 | 0x03 | ETX | ETX — End of Text |
| 4 | 0x04 | EOT | EOT — End of Transmission |
| 5 | 0x05 | ENQ | ENQ — Enquiry |
| 6 | 0x06 | ACK | ACK — Acknowledge |
| 7 | 0x07 | BEL | BEL — Bell |
| 8 | 0x08 | BS | BS — Backspace |
| 9 | 0x09 | HT | HT — Horizontal Tab |
| 10 | 0x0A | LF | LF — Line Feed |
| 11 | 0x0B | VT | VT — Vertical Tab |
| 12 | 0x0C | FF | FF — Form Feed |
| 13 | 0x0D | CR | CR — Carriage Return |
| 14 | 0x0E | SO | SO — Shift Out |
| 15 | 0x0F | SI | SI — Shift In |
| 16 | 0x10 | DLE | DLE — Data Link Escape |
| 17 | 0x11 | DC1 | DC1 — Device Control 1 (XON) |
| 18 | 0x12 | DC2 | DC2 — Device Control 2 |
| 19 | 0x13 | DC3 | DC3 — Device Control 3 (XOFF) |
| 20 | 0x14 | DC4 | DC4 — Device Control 4 |
| 21 | 0x15 | NAK | NAK — Negative Acknowledge |
| 22 | 0x16 | SYN | SYN — Synchronous Idle |
| 23 | 0x17 | ETB | ETB — End of Transmission Block |
| 24 | 0x18 | CAN | CAN — Cancel |
| 25 | 0x19 | EM | EM — End of Medium |
| 26 | 0x1A | SUB | SUB — Substitute |
| 27 | 0x1B | ESC | ESC — Escape |
| 28 | 0x1C | FS | FS — File Separator |
| 29 | 0x1D | GS | GS — Group Separator |
| 30 | 0x1E | RS | RS — Record Separator |
| 31 | 0x1F | US | US — Unit Separator |
| 32 | 0x20 | SP — Space | |
| 33 | 0x21 | ! | |
| 34 | 0x22 | " | |
| 35 | 0x23 | # | |
| 36 | 0x24 | $ | |
| 37 | 0x25 | % | |
| 38 | 0x26 | & | |
| 39 | 0x27 | ' | |
| 40 | 0x28 | ( | |
| 41 | 0x29 | ) | |
| 42 | 0x2A | * | |
| 43 | 0x2B | + | |
| 44 | 0x2C | , | |
| 45 | 0x2D | - | |
| 46 | 0x2E | . | |
| 47 | 0x2F | / | |
| 48 | 0x30 | 0 | |
| 49 | 0x31 | 1 | |
| 50 | 0x32 | 2 | |
| 51 | 0x33 | 3 | |
| 52 | 0x34 | 4 | |
| 53 | 0x35 | 5 | |
| 54 | 0x36 | 6 | |
| 55 | 0x37 | 7 | |
| 56 | 0x38 | 8 | |
| 57 | 0x39 | 9 | |
| 58 | 0x3A | : | |
| 59 | 0x3B | ; | |
| 60 | 0x3C | < | |
| 61 | 0x3D | = | |
| 62 | 0x3E | > | |
| 63 | 0x3F | ? | |
| 64 | 0x40 | @ | |
| 65 | 0x41 | A | |
| 66 | 0x42 | B | |
| 67 | 0x43 | C | |
| 68 | 0x44 | D | |
| 69 | 0x45 | E | |
| 70 | 0x46 | F | |
| 71 | 0x47 | G | |
| 72 | 0x48 | H | |
| 73 | 0x49 | I | |
| 74 | 0x4A | J | |
| 75 | 0x4B | K | |
| 76 | 0x4C | L | |
| 77 | 0x4D | M | |
| 78 | 0x4E | N | |
| 79 | 0x4F | O | |
| 80 | 0x50 | P | |
| 81 | 0x51 | Q | |
| 82 | 0x52 | R | |
| 83 | 0x53 | S | |
| 84 | 0x54 | T | |
| 85 | 0x55 | U | |
| 86 | 0x56 | V | |
| 87 | 0x57 | W | |
| 88 | 0x58 | X | |
| 89 | 0x59 | Y | |
| 90 | 0x5A | Z | |
| 91 | 0x5B | [ | |
| 92 | 0x5C | \ | |
| 93 | 0x5D | ] | |
| 94 | 0x5E | ^ | |
| 95 | 0x5F | _ | |
| 96 | 0x60 | ` | |
| 97 | 0x61 | a | |
| 98 | 0x62 | b | |
| 99 | 0x63 | c | |
| 100 | 0x64 | d | |
| 101 | 0x65 | e | |
| 102 | 0x66 | f | |
| 103 | 0x67 | g | |
| 104 | 0x68 | h | |
| 105 | 0x69 | i | |
| 106 | 0x6A | j | |
| 107 | 0x6B | k | |
| 108 | 0x6C | l | |
| 109 | 0x6D | m | |
| 110 | 0x6E | n | |
| 111 | 0x6F | o | |
| 112 | 0x70 | p | |
| 113 | 0x71 | q | |
| 114 | 0x72 | r | |
| 115 | 0x73 | s | |
| 116 | 0x74 | t | |
| 117 | 0x75 | u | |
| 118 | 0x76 | v | |
| 119 | 0x77 | w | |
| 120 | 0x78 | x | |
| 121 | 0x79 | y | |
| 122 | 0x7A | z | |
| 123 | 0x7B | { | |
| 124 | 0x7C | | | |
| 125 | 0x7D | } | |
| 126 | 0x7E | ~ | |
| 127 | 0x7F | DEL | DEL — Delete |
Showing 128 of 128 ASCII codes
How it works
What is ASCII?
ASCII (American Standard Code for Information Interchange) is a character encoding standard originally published in 1963. It defines 128 characters: 33 non-printing control characters (codes 0–31 and 127) and 95 printable characters (codes 32–126), including uppercase and lowercase English letters, digits 0–9, and common punctuation marks. ASCII became the foundation for virtually every modern text encoding, including UTF-8, which is backward-compatible with ASCII for the first 128 code points.
Each ASCII character is assigned a 7-bit integer value, which is why the table stops at 127 (2⁷ − 1). When stored in an 8-bit byte, the leading bit is typically 0 for standard ASCII. The extended ASCII range (128–255) is not standardized by the original spec and varies by code page — ISO 8859-1, Windows-1252, and similar encodings each define a different set of characters for the upper half of the byte.
Control characters (0–31 and 127)
The first 32 ASCII codes and code 127 are non-printing control characters inherited from teletype machine conventions. Most are obsolete in modern computing, but several remain important: code 9 (HT, horizontal tab), code 10 (LF, line feed or newline on Unix/Linux), code 13 (CR, carriage return, used in Windows line endings as CR+LF), code 27 (ESC, Escape, used in terminal escape sequences), and code 127 (DEL). These characters are not rendered as visible glyphs.
On Unix-like systems, you can generate control characters in a terminal by holding Ctrl and pressing the corresponding letter: Ctrl+A = SOH (1), Ctrl+C = ETX (3, sends interrupt signal), Ctrl+D = EOT (4, signals end of input), Ctrl+J = LF (10), Ctrl+M = CR (13), Ctrl+Z = SUB (26, suspends a process on Unix). Understanding these codes is essential for low-level I/O, terminal control sequences, and network protocol implementation.
ASCII in programming and web development
In JavaScript, you can get the ASCII code of a character using charCodeAt(0): 'A'.charCodeAt(0) returns 65. To convert back, use String.fromCharCode(65) to get 'A'. In Python, ord('A') returns 65 and chr(65) returns 'A'. In C, char values are integers and can be used directly in arithmetic: 'A' + 1 equals 'B'.
ASCII values are the basis for many common programming patterns. The difference between uppercase and lowercase letters is always 32: 'a' (97) = 'A' (65) + 32. Digits 0–9 occupy codes 48–57, so subtracting 48 from a digit character's ASCII value gives its numeric value. URL encoding represents non-URL-safe characters as %XX where XX is the hex ASCII code, making this table essential for debugging URL-encoded strings and HTTP headers.
Frequently asked questions
›What is the ASCII code for Enter / newline?
The newline (line feed) character is ASCII code 10 (0x0A, LF). On Unix/Linux/macOS, a newline is represented by LF alone. On Windows, a newline is CR+LF (codes 13 and 10, or 0x0D 0x0A). The carriage return character is code 13 (0x0D, CR). When writing cross-platform text processing code, always handle both LF and CR+LF line endings.
›What is the ASCII code for the space character?
The space character is ASCII code 32 (0x20, SP). It is the first printable ASCII character. The non-breaking space (used in HTML as ) is not part of standard 7-bit ASCII — it is code 160 (0xA0) in ISO 8859-1 and UTF-8 (encoded as 0xC2 0xA0 in UTF-8).
›What is the difference between ASCII, UTF-8, and Unicode?
ASCII defines 128 characters with 7-bit codes. Unicode is a universal standard that defines over 140,000 characters with code points up to U+10FFFF. UTF-8 is a variable-width encoding of Unicode: it encodes ASCII characters (0–127) in a single byte, making it backward-compatible with ASCII. Characters beyond 127 use 2–4 bytes in UTF-8. Modern text systems use UTF-8 or UTF-16, but ASCII remains important for protocol headers, file formats, and legacy systems.
›How do I find the ASCII code of a character in JavaScript?
Use charCodeAt(0): 'A'.charCodeAt(0) returns 65. For Unicode code points beyond 65535, use codePointAt(0) instead. To convert a code back to a character: String.fromCharCode(65) returns 'A'. For full Unicode support: String.fromCodePoint(128512) returns the 😀 emoji.
›What does ASCII code 0 (NUL) do?
NUL (code 0) is the null character. In C and many other languages, it is used as a string terminator — a string 'Hello' is stored in memory as the bytes 72, 101, 108, 108, 111, 0. In databases and file formats, NUL can appear as a field separator or padding byte. In most text editors and terminals, NUL is invisible and ignored, but it can cause problems when reading binary files as text.
›What is the Escape character (ASCII 27)?
ESC (code 27, 0x1B) is the Escape character. It is the start of ANSI/VT100 escape sequences, which control terminal colors and cursor movement. For example, the sequence ESC[31m changes the terminal text color to red. In many applications, pressing the Escape key sends this character. It is also used in various data formats and communication protocols.
›Why does uppercase A have ASCII code 65 and lowercase a have 97?
The ASCII table was designed so that uppercase letters (A=65, B=66, ..., Z=90) and lowercase letters (a=97, b=98, ..., z=122) differ by exactly 32. This allows converting between cases with a single addition or subtraction. To convert uppercase to lowercase in ASCII: add 32 (or set bit 5). To convert lowercase to uppercase: subtract 32 (or clear bit 5). This is why bitwise case conversion works in C: char lower = upper | 0x20.
›What is the difference between CR, LF, and CRLF?
CR (Carriage Return, code 13) and LF (Line Feed, code 10) originated from typewriter/teletype conventions. CR moves the print head to the beginning of the line; LF advances to the next line. Unix/Linux uses LF alone for newlines. Windows uses CR+LF (both together). Classic Mac OS (before OS X) used CR alone. Most modern parsers handle all three, but mixing line endings in source files causes problems with version control diffs and some text processors.
Related tools
Last updated: