The ASCII Table Explained

The ASCII Table Explained

Every A you type is, inside the computer, the number 65. That mapping — character to number — is ASCII, a 1963 standard that has quietly outlived nearly everything else in computing.

The idea

ASCII assigns each character a number from 0 to 127:

  • 0–31: control codes — carriage return, tab, bell. Invisible, but they still run your terminal.
  • 32–47, 58–64, etc.: punctuation and symbols. Space is 32.
  • 48–57: digits 0–9. Notice digits are contiguous — that’s why '5' - '0' converts a character to a number in code.
  • 65–90: uppercase A–Z.
  • 97–122: lowercase a–z. Lowercase is exactly +32 from uppercase.

Why it still matters

  • Sorting: “Z” (90) sorts before “a” (97) in every ASCII-based sort. That’s why case-insensitive sorting is a feature, not the default.
  • Line endings: Windows uses CR+LF (\r\n, codes 13+10); Unix uses just LF (10). The invisible difference that breaks scripts daily.
  • The null byte: code 0 terminates strings in C — the source of entire bug families.
  • Programming tricks: c - 'a', ch + 32 (case flip), and range checks (c >= '0' && c <= '9') all rely on ASCII’s layout.

The reference

The full 128-code table — decimal, hex, binary, and character — lives in the ASCII table. The hex column matters most: 0x41 is A, and half of debugging output you’ll read is in hex.

ASCII maps English and basic punctuation. Everything else — é, kanji, emoji — came later, which is why Unicode exists. But underneath Unicode, the ASCII codes remain: UTF-8 encodes the first 128 characters identically. ASCII didn’t die; it became the foundation.