ASCII Delete Character (DEL, Code 127): History & Details
Why character code 127 uses all 7 bits and how terminal emulators handle deletion.
Character code 127 sits at the end of the original 7-bit ASCII table as the only control character outside the 0x00 to 0x1F range. Unlike standard control codes designed for teletype print heads, DEL was created for punched paper tape, where punching out all seven data bits erased an existing character. Today, DEL remains a source of key-mapping friction between Unix tty drivers, SSH clients, and terminal emulators.
Punched Tape and the 7-Bit All-Ones Design
Standardized in 1963 under ANSI X3.4, character 127 (hexadecimal 0x7F, octal 0177) was assigned the label DEL (Delete). In paper tape computer storage, text was recorded by punching physical holes into paper strips across seven parallel data tracks, accompanied by a smaller sprocket hole for timing. Once a hole was punched into a tape position, physical media could not un-punch it. If a teleprinter operator made an error while typing a message onto tape, they needed a mechanism to invalidate the erroneous character without tearing or splicing the physical paper ribbon.
The solution relied on binary mechanics. Because the binary format for decimal 127 is 01111111 in 7-bit ASCII, punching holes across all seven data tracks converted any previous character into code 127. Teleprinters and paper tape readers were engineered to ignore code 127 entirely during transmission and playback. If an operator typed the letter 'A' (binary 1000001) by mistake, backspacing the tape punch head and striking the DEL key punched out the remaining five unpunched track positions, turning the byte into all-ones (1111111). When fed into a computer reader, the all-ones pattern produced no printed output and advanced the tape head to the next frame.
This physical requirement explains why DEL resides at index 127 rather than alongside the other ASCII control characters located between 0 and 31. On the standard ASCII table, codes 0x00 through 0x1F require specific bit combinations to signal formatting actions like carriage returns or line feeds, but 0x7F stands alone as the highest index in 7-bit ASCII space.
Backspace Versus Delete: The Architectural Split
Code 8 (BS or Backspace) and Code 127 (DEL) perform distinct operations in raw character streams, though modern desktop software frequently blurs the distinction. In 1960s teletype protocols, code 8 commanded the mechanical print carriage to step left by one character column without modifying the ink already deposited on paper. This permitted operators to combine characters, such as typing a letter followed by a backspace and an accent mark or underline. Code 127, by contrast, represented destroyed data on physical storage media.
When computer terminals shifted from paper printers to video display units in the 1970s, hardware manufacturers implemented erase behavior differently:
- DEC VT100 Terminals: Digital Equipment Corporation placed a key labeled "DELETE" in the top-right corner of the main key block on VT100 keyboards. Pressing this key transmitted character code 127. Unix systems configured for VT100 terminals treated code 127 as the character-erase signal, removing the letter to the left of the cursor.
- IBM Terminals and PC Keyboards: IBM mainframes and subsequent PC key layouts distinguished between a "Backspace" key (emitting code 8) and a "Delete" key (emitting an escape sequence like
ESC [ 3 ~). Over time, PC software established the convention that Backspace erases to the left of the cursor while Delete erases to the right.
Examining ASCII keyboard mappings shows how this hardware divergence split terminal drivers into two camps: environments expecting 0x08 (^H) for character deletion and environments expecting 0x7F (^?). Our ASCII control characters guide details how these early terminal standards shaped modern line-editing protocols.
Unix Terminal Emulation and the ^? Control Sequence
The Unix TTY subsystem processes incoming raw characters before passing text to interactive shell applications. The POSIX termios line discipline maintains an erase setting that specifies which ASCII character triggers destructive backspacing in canonical mode. In control character notation, DEL is represented as ^?, derived from adding 64 to 0x7F modulo 128 (yielding ASCII 63, the question mark).
Mismatches between a terminal emulator's key configuration and the shell's line discipline produce common display glitches. When a terminal emulator sends ^H (code 8) while the remote TTY expects ^? (code 127), pressing the backspace key outputs raw control text like ^H onto the terminal screen instead of erasing characters. System administrators resolve this alignment using the stty utility:
stty erase ^?configures the terminal driver to treat code 127 as the erase character.stty erase ^Hconfigures the terminal driver to treat code 8 as the erase character.
You can inspect raw byte emissions from terminal keys using a hex-to-ASCII tool to verify whether your terminal sends 0x7F or 0x08 when keybindings malfunction.
Modern Text Encoding and Unicode Compatibility
When the International Organization for Standardization (ISO) codified ISO/IEC 646 and the Unicode Consortium created the Universal Coded character sets, character 127 retained its legacy designation. In Unicode, the code point U+007F is formally named DELETE and designated as a C0 control character. Reviewing how UTF-8 works demonstrates that U+007F is encoded as a single byte with the binary value 01111111, preserving 100% backward compatibility with original 1963 ASCII.
| Notation | Value | Format |
|---|---|---|
| Decimal | 127 | Base 10 |
| Hexadecimal | 0x7F | Base 16 |
| Octal | 0177 | Base 8 |
| Binary | 01111111 | Base 2 |
| Control Notation | ^? | ASCII caret format |
| Unicode Code Point | U+007F | C0 Control |
In web protocols, network services, and application programming interfaces, code 127 is no longer used for paper tape punches, but it remains active in POSIX termios interfaces, Telnet protocol option negotiations (defined in RFC 854), and raw terminal input parsing. Low-level keyboard drivers in Linux, BSD, and macOS continue to parse 0x7F to ensure interactive shell sessions handle character erasure predictably across remote network connections.