ASCII table

All 128 ASCII codes with decimal, hex, octal and binary values. Select any character for details, or search by character, number or name.

A

Capital A

Decimal
65
Hex
0x41
Octal
101
Binary
01000001
HTML
A
Escape
\x41

Flip bit 5 (±32) →

Why the table is laid out this way

ASCII is 7 bits, which splits neatly into a 3-bit column and a 4-bit row. Look at the binary of any character and the pattern jumps out:

  • 000 and 001: the 32 control codes.
  • 011: digits. The low four bits are the digit itself, so “7” is 011 0111.
  • 100 and 101: uppercase letters. The low five bits count the letter: A = 1, B = 2 … Z = 26.
  • 110 and 111: lowercase letters, the same count with bit 5 switched on.

So converting case is one bit, and turning a digit character into its value is a mask. Select “A” in the table and follow the case link to see it. The full letter set in binary is on the binary alphabet page.

Bit columns
High 3 bitsRangeHolds
000–0010–31Control
01032–47Space, punctuation
01148–63Digits, : ; < = > ?
100–10164–95@, A–Z, [ \ ] ^ _
110–11196–127`, a–z, { | } ~, DEL

Questions people ask

What is ASCII?

The American Standard Code for Information Interchange, first published in 1963, assigns the numbers 0–127 to 128 characters: 33 control codes, the space, and 94 printable letters, digits and symbols. Every modern encoding, including UTF-8, keeps these same numbers.

What is the ASCII code for A?

Uppercase A is 65 (hex 41, binary 01000001). Lowercase a is 97 (hex 61, binary 01100001).

Why are uppercase and lowercase letters 32 apart?

The designers placed them so that they differ by a single bit, bit 5 (value 32). Flipping that bit switches case, which made case-insensitive comparison cheap on early hardware.

What are control characters?

Codes 0–31 and 127 are not printable. They were instructions for teleprinters: 7 rings the bell, 10 is line feed, 13 is carriage return. Windows ends lines with CR LF (13 10), Unix with LF (10).

What about codes 128–255 (extended ASCII)?

ASCII itself stops at 127. “Extended ASCII” refers to many incompatible 8-bit code pages such as ISO-8859-1 and Windows-1252. Today, characters above 127 are almost always encoded as multi-byte UTF-8 instead; see the Unicode converter.

What is the ASCII code for a space?

32 (hex 20, binary 00100000).