Skip to content
ASCII World

How ASCII Works

From Binary Numbers to Printable Characters

By the ASCII World team

1. What ASCII Actually Is

ASCII stands for American Standard Code for Information Interchange. It assigns each character a unique number: 65 for uppercase A, 97 for lowercase a, 48 for the digit 0. When you press a key, your operating system sends the corresponding ASCII code to whatever application is listening.

The standard uses 7 bits per character, which gives 2^7 = 128 possible values (0 through 127). That covers 26 uppercase letters, 26 lowercase, 10 digits, 33 punctuation and symbol characters, a space, and 33 control codes. No more, no less.

2. How the Number Mapping Works

The mapping is not random. Uppercase letters run from 65 (A) to 90 (Z). Lowercase letters start at 97 (a) and end at 122 (z). The difference between any uppercase letter and its lowercase equivalent is always 32, which means flipping a single bit (bit 5) toggles case. This was a deliberate hardware optimization from the 1960s.

Digits 0 through 9 occupy positions 48-57. To convert an ASCII digit to its numeric value, subtract 48. To convert back, add 48. These patterns make text processing fast even on primitive hardware, which is exactly what the committee intended.

3. Control Characters: The Invisible 33

Positions 0-31 and 127 are control characters. They have no visible glyph. Some still matter: LF (line feed, 10) and CR (carriage return, 13) end lines of text, HT (tab, 9) indents columns, and NUL (0) terminates strings in C.

Most of the others are dead. Characters like SOH, STX, ETX, and EOT date from teletype communication and have no standard meaning in modern software. You will still encounter them in serial protocols, industrial control systems, and legacy mainframe file transfers. The FAQ covers common questions about which control characters still see active use.

4. Why ASCII Exists

Before 1963, every manufacturer used a different character encoding. IBM had EBCDIC (still used on mainframes today). Teletype machines used Baudot code. DEC had its own scheme. Sending text between two different systems required manual translation tables.

The American Standards Association published X3.4-1963 to fix this. By assigning one universal number to each character, any two systems that implemented ASCII could exchange text without conversion. The standard worked so well that it became the base layer for every encoding that followed, including UTF-8 and Unicode. See the full timeline of ASCII history for key dates.

5. Extended ASCII: The 8-Bit Expansion

Standard ASCII's 128 characters cannot represent accented letters (e, u, n), currency symbols beyond $, or characters from non-Latin scripts. Extended ASCII uses an 8th bit to double the range to 256 characters (0-255), but there is no single "Extended ASCII" standard.

ISO 8859-1 covers Western European languages. Windows-1252 adds smart quotes and other typographic characters. CP437 provides box-drawing characters for DOS-era interfaces. Each maps positions 128-255 differently, which is exactly why a file written in one encoding looks like garbage when opened in another. You can compare encodings side by side to see where they diverge.

6. Where ASCII Breaks Down

128 characters cannot cover Chinese (50,000+ characters), Japanese (hiragana, katakana, kanji), Arabic, Hindi, or any writing system outside the Latin alphabet. Even European languages need more than 256 positions once you combine all their diacritical marks.

The fragmentation of Extended ASCII made this worse. A file saved in ISO 8859-5 (Cyrillic) is unreadable in ISO 8859-1 (Western European). There was no metadata to indicate which encoding a file used, so software had to guess. Wrong guesses produce mojibake, the garbled text you get when encoding and decoding use different tables.

7. Reading the ASCII Table

The ASCII table on our homepage lists all 128 characters with their decimal, hexadecimal, and binary values. The chart view arranges them in a 16x8 grid that matches the original bit layout. The compact view strips it down to essentials. The grid view lets you click any cell for details.

For any individual character, the character detail page shows its encoding across all supported character sets, how to type it using ALT codes, and its representation in 10 programming languages. Use the base converter to translate between decimal, hex, octal, and binary on the fly.

8. ASCII in Programming

Every mainstream language provides ASCII-related functions. Python has ord('A') returning 65 and chr(65) returning 'A'. JavaScript uses 'A'.charCodeAt(0) and String.fromCharCode(65). C treats characters as integers natively, so 'A' + 32 gives 'a'.

Common operations that rely on ASCII values: case conversion (toggle bit 5), digit extraction (subtract 48), alphabetic sorting (compare code points), and input validation (check if a value falls within a known range). Try the text to ASCII converter to see the codes for any string, or use the ASCII to text tool to go the other direction.

9. From ASCII to Unicode

Unicode replaced the patchwork of Extended ASCII standards with a single universal registry. It assigns a unique code point to every character in every writing system, plus emojis, mathematical notation, and historical scripts. The current version defines over 154,000 characters across 168 scripts.

The first 128 Unicode code points are identical to ASCII, which is why UTF-8 is backward compatible. A pure ASCII file is already valid UTF-8 with zero modifications. UTF-8 uses variable-length encoding: 1 byte for ASCII characters, 2-4 bytes for everything else. This efficiency is why UTF-8 now accounts for over 98% of all web pages.

10. ASCII Art

ASCII's 95 printable characters can be arranged to create images, a practice dating back to typewriter art in the 1960s. The ASCII art gallery on this site collects examples across multiple categories. The emoticons page has 80+ kaomoji and text faces. The banners page shows FIGlet-style text headers.

To create your own, try the ASCII art generator for text-to-art conversion, or the image to ASCII converter to turn photographs into character grids. Both let you adjust character density and output width.

References

  1. ANSI INCITS 4-1986 (R2012) - American National Standard for Information Systems
  2. The Unicode Standard - Chapter 2: General Structure
  3. RFC 20 - ASCII Format for Network Interchange
  4. W3Techs - Usage Statistics of Character Encodings for Websites