Ascii

ASCII, the American Standard Code for Information Interchange, is a character encoding that assigns the numbers 0 through 127 to 128 characters: the unaccented English letters in upper and lower case, the digits, punctuation, a space, and 33 non-printing control codes. Each code fits in seven bits, so a character occupies one byte with the top bit left at zero. It was first published as a standard by the American Standards Association in 1963 (ASA X3.4-1963), revised in 1967 and 1968, and restated by ANSI in 1986. Almost every text system since, from Unix terminals to HTML, either uses it directly or builds on it.

ASCII was designed for teleprinters and data links, and its layout shows it. The standard emerged from committees working with the teletype and telegraph industry and with computer makers who wanted to stop translating between proprietary codes, and Bob Bemer, then at IBM, is widely credited with major contributions, including the escape character and the backslash. Codes 0 to 31 and 127 are control characters, many of which only made sense for paper-tape and printer hardware: NUL (0), BEL (7, rang a bell), BS (8), TAB (9), LF (10, line feed), CR (13, carriage return), ESC (27) and DEL (127, originally all holes punched to erase a tape position). Seven bits were chosen partly to leave an eighth bit for a parity check on noisy lines. In 1969 RFC 20 specified ASCII as the format for network interchange, which cemented its place in internet protocols.

The arrangement of the table is deliberate and enables bit tricks that still appear in code. The digits 0 to 9 occupy codes 48 to 57 (0x30 to 0x39), so subtracting 48 from a digit character gives its numeric value; capital letters run from 65 (A) to 90 (Z); lowercase from 97 (a) to 122 (z). Because 97 is 65 plus 32, upper and lower case differ in exactly one bit (0x20), so flipping that bit swaps case, and sorting by code point puts all capitals before all lowercase letters, which is why a plain byte-order sort yields "Zebra" before "apple". Control keys follow the same logic: holding Ctrl while typing C clears the upper bits of the letter and sends code 3, which terminals interpret as an interrupt.

Text: Hi!
three characters
ASCII code of each character
H = 72
0x48, 1001000
i = 105
0x69, 1101001
! = 33
0x21, 0100001
Stored as three bytes: 48 69 21
each byte has its top bit equal to 0
Any UTF-8 reader also decodes these bytes as Hi!
ASCII text is valid UTF-8, byte for byte

A recurring misconception is that "extended ASCII" is a standard; it is not. Once 8-bit bytes were universal, vendors used codes 128 to 255 for their own accented letters, box-drawing characters and symbols, producing IBM code page 437 on the original PC, ISO 8859-1 (Latin-1), Windows-1252 and many more, each different and none of them ASCII. Only the lower 128 codes are ASCII proper, and they agree across essentially all of these. That compatibility is also ASCII's lasting gift: UTF-8 was designed so that every ASCII byte means the same thing, which means ASCII files are already valid UTF-8 and old tools keep working.

Line endings are the most visible legacy of the teletype. Moving a printer head to the left margin (carriage return) and advancing the paper (line feed) were separate mechanical actions, so early systems stored both as the pair CR LF; Unix chose a single LF, classic Mac OS used CR, and Windows kept CR LF, which is why a file saved on one system sometimes displays an extra symbol or one long line on another, and why Git has settings for line-ending conversion. Similar leftovers include the tab character and the NUL byte, which C uses to end strings.

ASCII's limitations are blunt, and still practical to remember. It cannot represent accents, any non-Latin script, or emoji, so a name like Zoë or a Chinese city cannot be stored in pure ASCII; software that "supports only ASCII" will mangle, replace with question marks or reject such input. Yet ASCII remains everywhere that text must be machine-simple: protocol keywords in HTTP and SMTP, source-code identifiers in many languages, file formats like CSV and JSON structure characters, and the hex digits and base-64 alphabet used to carry binary data. For data scientists, checking whether a column is pure ASCII is a quick screening test for encoding trouble.

Read ASCII as the original 128-slot alphabet of computing: small, English-centred and shaped by teletypes, but so carefully laid out and so widely copied that every later text standard still begins with it.

Take ascii further

Ask the copilot about this term, or have our engineers assess it against your process.