The problem: text isn't numbers
A computer's memory holds bits — patterns of 0s and 1s that naturally represent numbers. But people write text. Bridging that gap requires an encoding: a shared agreement mapping numbers to characters. ASCII (American Standard Code for Information Interchange), published in 1963 for Teletype machines, was the agreement that stuck: 128 numbers, each assigned to one character.
Seven bits give 128 values (0–127), which is why ASCII is a 7-bit code. It fits comfortably inside one byte, with the eighth bit originally left for error checking on noisy phone lines.
The layout has hidden patterns
The table wasn't assigned randomly — it's engineered for clever bit tricks:
| Range | Characters | Example |
|---|---|---|
| 0–31 | control codes (invisible) | 10 = line feed, 13 = carriage return |
| 32 | space | the most common character in English text |
| 33–47 | punctuation | ! " # $ % & ' ( ) * + , - . / |
| 48–57 | digits 0–9 | '0' is 48, '9' is 57 |
| 65–90 | uppercase A–Z | 'A' is 65 |
| 97–122 | lowercase a–z | 'a' is 97 |
| 127 | DEL (delete) | a control code, not a visible character |
Spot the patterns programmers exploit daily:
- Case flip is one bit: lowercase is exactly 32 more than uppercase ('A'=65, 'a'=97). Toggling bit 5 converts case — no lookup table needed.
- Digit to value: subtract 48 from any digit character to get its numeric value ('7' − 48 = 7). Parsers do this constantly.
- Letters are sequential: 'C' − 'A' = 2, so alphabet position is just subtraction.
Control characters: the invisible 33
Codes 0–31 and 127 never print anything — they're control codes, instructions inherited from Teletype machines. A few still matter enormously:
- NUL (0) — marks the end of a string in C and many file formats.
- LF (10) — line feed: "move to the next line". Unix line endings.
- CR (13) — carriage return: "go back to the line start". Windows uses CR+LF together.
- ESC (27) — escape: introduces terminal control sequences (colors, cursor movement).
- DEL (127) — delete: originally punched out all holes in paper tape.
The Windows-vs-Unix line-ending war that still breaks text files in 2026? It's a disagreement about two ASCII control codes from the typewriter era.
Beyond ASCII: Unicode and UTF-8
128 characters can't hold é, 中, or 😀. Unicode extends the idea to over 149,000 characters across every writing system, and UTF-8 is its dominant encoding — designed so cleverly that it's byte-for-byte identical to ASCII for codes 0–127. Plain English text in UTF-8 is ASCII; other characters use 2–4 bytes with a prefix scheme that never collides with ASCII bytes. That's why ASCII never died: it became the foundation Unicode was built on.
Try it yourself
Look up any character's code, or convert text to binary and watch each character become 8 bits.
Key takeaways
- ASCII maps the numbers 0–127 to characters: letters, digits, punctuation and control codes.
- The layout is engineered: case differs by one bit (32), digits start at 48, letters are sequential.
- Control codes 0–31 are invisible instructions — LF, CR and NUL still shape computing today.
- UTF-8 is backward-compatible with ASCII, which is why ASCII never went away.
Frequently asked questions
What does ASCII stand for?
American Standard Code for Information Interchange. Published in 1963, it assigns the numbers 0–127 to 128 characters: letters, digits, punctuation and control codes.
What is the ASCII code for the letter A?
65. Uppercase letters run from A=65 to Z=90, lowercase from a=97 to z=122, and digits from 0=48 to 9=57. Lowercase is exactly 32 more than uppercase — one bit flip.
Why is ASCII only 128 characters?
It was designed as a 7-bit code for American English teleprinters in the 1960s — enough for the alphabet, digits and basic punctuation. Modern text uses Unicode, which includes ASCII as its first 128 code points.
Is ASCII still used today?
Yes — as the foundation. UTF-8, the dominant text encoding on the web, is byte-for-byte identical to ASCII for the first 128 characters, so plain English text is still ASCII under the hood.