{ }DevToolBox

ASCII Table — Character Code Reference

A complete, searchable ASCII code table showing decimal, hexadecimal, octal and binary values for all 128 standard characters. Click any row for detailed information including HTML entities and escape sequences. Toggle extended ASCII (128–255) for the full character set.

ASCII Character Table
Showing 128 characters
DecHexOctChar
00x00000NUL
10x01001SOH
20x02002STX
30x03003ETX
40x04004EOT
50x05005ENQ
60x06006ACK
70x07007BEL
80x08010BS
90x09011HT
100x0A012LF
110x0B013VT
120x0C014FF
130x0D015CR
140x0E016SO
150x0F017SI
160x10020DLE
170x11021DC1
180x12022DC2
190x13023DC3
200x14024DC4
210x15025NAK
220x16026SYN
230x17027ETB
240x18030CAN
250x19031EM
260x1A032SUB
270x1B033ESC
280x1C034FS
290x1D035GS
300x1E036RS
310x1F037US
320x20040Space
330x21041!
340x22042"
350x23043#
360x24044$
370x25045%
380x26046&
390x27047'
400x28050(
410x29051)
420x2A052*
430x2B053+
440x2C054,
450x2D055-
460x2E056.
470x2F057/
480x300600
490x310611
500x320622
510x330633
520x340644
530x350655
540x360666
550x370677
560x380708
570x390719
580x3A072:
590x3B073;
600x3C074<
610x3D075=
620x3E076>
630x3F077?
640x40100@
650x41101A
660x42102B
670x43103C
680x44104D
690x45105E
700x46106F
710x47107G
720x48110H
730x49111I
740x4A112J
750x4B113K
760x4C114L
770x4D115M
780x4E116N
790x4F117O
800x50120P
810x51121Q
820x52122R
830x53123S
840x54124T
850x55125U
860x56126V
870x57127W
880x58130X
890x59131Y
900x5A132Z
910x5B133[
920x5C134\
930x5D135]
940x5E136^
950x5F137_
960x60140`
970x61141a
980x62142b
990x63143c
1000x64144d
1010x65145e
1020x66146f
1030x67147g
1040x68150h
1050x69151i
1060x6A152j
1070x6B153k
1080x6C154l
1090x6D155m
1100x6E156n
1110x6F157o
1120x70160p
1130x71161q
1140x72162r
1150x73163s
1160x74164t
1170x75165u
1180x76166v
1190x77167w
1200x78170x
1210x79171y
1220x7A172z
1230x7B173{
1240x7C174|
1250x7D175}
1260x7E176~
1270x7F177DEL

What Is ASCII?

ASCII (American Standard Code for Information Interchange) is a character encoding standard that assigns numeric values to letters, digits, punctuation marks and control characters. First published in 1963 by the American National Standards Institute (ANSI), ASCII remains the foundation of virtually every modern text encoding system, including UTF-8, which is backward-compatible with ASCII for the first 128 code points.

The standard ASCII table contains 128 characters numbered 0 through 127. Each character can be represented using 7 bits of binary data, which is why early computer systems used 7-bit data words. The 8th bit was often used as a parity bit for error detection. When 8-bit bytes became standard, the upper half (128–255) was used for various “extended ASCII” character sets such as ISO 8859-1 (Latin-1) and Windows-1252.

ASCII Table Structure

The 128 ASCII characters fall into three logical groups:

Control Characters (0–31 and 127)

The first 32 codes (0–31) and code 127 (DEL) are non-printable control characters. They were originally designed to control teletypewriters and data transmission equipment. Some remain critically important today:

  • 0 (NUL) — The null character, used as a string terminator in C and many other programming languages.
  • 9 (HT) — Horizontal Tab, the familiar Tab key on your keyboard.
  • 10 (LF) — Line Feed, the newline character on Unix and Linux systems (\n).
  • 13 (CR) — Carriage Return, used together with LF on Windows (\r\n) for line endings.
  • 27 (ESC) — Escape, used as the start of ANSI escape sequences for terminal colors and formatting.
  • 127 (DEL) — Delete. On paper tape systems, punching all holes (1111111 in binary) would delete a character.

Printable Characters (32–126)

Codes 32 through 126 are the printable characters that make up the visible text you read every day:

  • 32 — The Space character (often overlooked, but it is an actual character with a code).
  • 48–57 — Digits 0 through 9. Notice that the digit 0 has ASCII value 48, not 0. This distinction is a common source of bugs in C programs.
  • 65–90 — Uppercase letters A through Z. The difference between uppercase and lowercase is exactly 32 (one bit flip: bit 5), a deliberate design choice that makes case conversion efficient.
  • 97–122 — Lowercase letters a through z.
  • 33–47, 58–64, 91–96, 123–126 — Punctuation and symbols such as !, @, #, $, %, ^, &, *, brackets, braces, and more.

Extended ASCII (128–255)

The term “Extended ASCII” refers to 8-bit character sets that use the upper 128 positions (128–255) for additional characters. There is no single “extended ASCII” standard — multiple encoding schemes exist, including ISO 8859-1 (Latin-1) for Western European languages and Windows-1252 (a superset of Latin-1 commonly used on Windows). These extensions include accented characters like é, ü, and ñ, as well as currency symbols, mathematical operators and box-drawing characters.

Number Representations

Every ASCII character can be expressed in multiple number bases:

  • Decimal (base 10) — The most human-friendly form. The letter ‘A’ is 65 in decimal.
  • Hexadecimal (base 16) — Compact and byte-aligned. ‘A’ is 0x41. Hex is the most common notation in programming contexts.
  • Octal (base 8) — Used historically in Unix file permissions and some C escape sequences (\101 for ‘A’).
  • Binary (base 2) — The raw bit pattern. ‘A’ is 01000001. Standard ASCII uses 7 bits; the 8th bit is zero for all standard characters.

ASCII in Programming

Understanding ASCII values is fundamental in many programming scenarios:

  • String comparison — When you sort strings “alphabetically” in most programming languages, you are actually sorting by ASCII/Unicode code points. This means uppercase letters come before lowercase (‘Z’ = 90 < ‘a’ = 97), which can lead to unexpected sort orders.
  • Character arithmetic — In C, Java and many other languages, you can perform arithmetic on characters: 'A' + 1 == 'B', 'a' - 'A' == 32. This is used extensively in algorithms for case conversion, Caesar ciphers, and digit-to-integer conversion (ch - '0').
  • Input validation — Checking whether a character is a digit (ch >= 48 && ch <= 57) or a letter is a common operation in parsers and validators.
  • Escape sequences — Control characters like tab (\t, ASCII 9), newline (\n, ASCII 10), and carriage return (\r, ASCII 13) are used in every programming language for formatting text output.

ASCII vs Unicode vs UTF-8

ASCII handles only 128 characters, which is sufficient for English text but inadequate for the world’s diverse writing systems. Unicode was created to solve this problem by assigning a unique code point to every character in every script — over 149,000 characters as of Unicode 15.1.

UTF-8 is the dominant encoding for Unicode text. It is a variable-width encoding that uses 1 to 4 bytes per character. The crucial design decision of UTF-8 is that the first 128 characters (code points U+0000 through U+007F) are encoded identically to ASCII, using a single byte. This means all existing ASCII text is automatically valid UTF-8, which is why the transition from ASCII to UTF-8 was so smooth.

When working with modern software, you are almost certainly using UTF-8 encoding. But since UTF-8 is backward-compatible with ASCII, understanding the ASCII table remains essential — the first 128 code points of Unicode are the ASCII table.

Common ASCII Values Worth Memorizing

Experienced programmers often have a few key ASCII values committed to memory:

  • 0 — NUL (null terminator)
  • 10 — LF (newline on Unix/Mac)
  • 13 — CR (carriage return, part of Windows newline)
  • 32 — Space
  • 48 — ‘0’ (start of digits)
  • 65 — ‘A’ (start of uppercase)
  • 97 — ‘a’ (start of lowercase)
  • 127 — DEL (delete)

Knowing that uppercase and lowercase letters differ by exactly 32 (binary: one bit flip) is particularly useful. To convert ‘A’ to ‘a’, add 32. To convert ‘a’ to ‘A’, subtract 32. In binary terms, you toggle bit 5 (ch ^ 0x20).

Frequently Asked Questions

What is the difference between ASCII and Unicode?

ASCII defines 128 characters using 7 bits. Unicode defines over 149,000 characters from all the world’s writing systems. The first 128 Unicode code points (U+0000 to U+007F) are identical to ASCII. UTF-8, the most common Unicode encoding, encodes these first 128 characters in a single byte, making it backward-compatible with ASCII.

Why does ASCII start at 0 and not 1?

ASCII code 0 (NUL) was intentionally included as a “no operation” character for paper tape and data transmission systems. The NUL character could be used to fill gaps or serve as padding without affecting the data. In C programming, NUL (code 0) serves as the string terminator, marking the end of a null-terminated string.

Why is the Space character code 32?

The ASCII table was designed so that control characters occupy positions 0–31 and printable characters start at 32. Space is the first printable character. This layout allows software to easily distinguish control characters from printable characters by checking if the code is below 32.

How do I find the ASCII code of a character?

Use the search box in the ASCII table above to look up any character. In most programming languages, you can also get the code directly: “A”.charCodeAt(0) in JavaScript returns 65, ord(“A”) in Python returns 65, and (int)’A’ in C/Java gives 65.

What is extended ASCII?

Extended ASCII refers to any 8-bit encoding that uses codes 128–255 for additional characters beyond the standard 128. There is no single “extended ASCII” standard — multiple incompatible encodings exist (ISO 8859-1, Windows-1252, etc.). This ambiguity is one of the reasons Unicode was created to provide a single, universal character set.

Related Tools