ASCII table

What is an Ascii Table?

ASCII (American Standard Code for Information Interchange) maps 128 characters to the numbers 0 to 127. It is the foundation of almost every modern text encoding: the first 128 code points of UTF-8 and Unicode are identical to ASCII. This reference table lists every character with its decimal, hexadecimal, octal and binary value.

How the table is organised

  • 0 to 31 and 127: control characters, such as NUL (0), TAB (9), LF line feed (10), CR carriage return (13) and ESC (27). They are not printable but control text layout and terminals.
  • 32 to 47: space and punctuation such as !, # and /.
  • 48 to 57: the digits 0 to 9 (hex 30 to 39).
  • 65 to 90: uppercase A to Z (hex 41 to 5A).
  • 97 to 122: lowercase a to z (hex 61 to 7A).

Useful patterns

Uppercase and lowercase letters differ by exactly 32, which is a single bit (0x20). That is why 'A' is 65 (binary 1000001) and 'a' is 97 (binary 1100001), and why flipping bit 5 toggles case. Digits are offset by 48, so subtracting 48 from the code of '7' (55) gives the number 7.

Typical uses

  • Decoding hex dumps or network captures byte by byte.
  • Checking which escape sequence to use, such as \n (10) or \t (9).
  • Understanding why Windows files end lines with CR LF (13 10) and Unix with LF (10).

Frequently Asked Questions

How many characters are in ASCII?

Standard ASCII has 128 characters, numbered 0 to 127: 33 control characters and 95 printable characters including the space.

What is the difference between ASCII and extended ASCII?

Extended ASCII refers to various 8-bit code pages that use values 128 to 255 for extra characters. They are not standardised, which is why UTF-8 replaced them.

Is ASCII the same as UTF-8?

The first 128 UTF-8 code points are identical to ASCII, so plain ASCII text is also valid UTF-8.

What is the ASCII code for a new line?

Line feed (LF) is decimal 10, hex 0A. Windows uses carriage return plus line feed, which is 13 followed by 10.