ASCII Control Codes Table
The standard 7-bit ASCII character set has 128 code positions. Decimal codes 0–31 are control characters, and code 127 is DEL. These entries generally do not represent ordinary printable letters or symbols.
Showing 33 of 33 reference entries.
| Decimal | Hex | Binary | Abbreviation | Character name | Description | Copy |
|---|---|---|---|---|---|---|
| 0 | 00 | 0000000 | NUL | Null | Null character; historically used for padding or indicating an empty value. | |
| 1 | 01 | 0000001 | SOH | Start of Heading | Marks the beginning of a heading or control information in certain protocols. | |
| 2 | 02 | 0000010 | STX | Start of Text | Marks the beginning of text in some communication protocols. | |
| 3 | 03 | 0000011 | ETX | End of Text | Marks the end of a text section in some communication protocols. | |
| 4 | 04 | 0000100 | EOT | End of Transmission | Indicates the end of a transmission in certain protocols. | |
| 5 | 05 | 0000101 | ENQ | Enquiry | Requests a response or status from another device or system. | |
| 6 | 06 | 0000110 | ACK | Acknowledge | Indicates that data or a message has been received successfully. | |
| 7 | 07 | 0000111 | BEL | Bell | Historically signals an audible or visual alert. | |
| 8 | 08 | 0001000 | BS | Backspace | Moves the printing position backward by one position in applicable environments. | |
| 9 | 09 | 0001001 | HT | Horizontal Tab | Advances to the next horizontal tab position. Commonly represented by a tab character. | |
| 10 | 0A | 0001010 | LF | Line Feed | Moves to the next line. Commonly used in Unix and Linux line endings. | |
| 11 | 0B | 0001011 | VT | Vertical Tab | Advances to the next vertical tab position. Rarely used in modern text. | |
| 12 | 0C | 0001100 | FF | Form Feed | Historically advances to the next page or form. | |
| 13 | 0D | 0001101 | CR | Carriage Return | Returns the printing position to the start of a line. Used in Windows CRLF line endings together with LF. | |
| 14 | 0E | 0001110 | SO | Shift Out | Signals a shift to an alternate character interpretation in systems that support it. | |
| 15 | 0F | 0001111 | SI | Shift In | Signals a return to the standard character interpretation in systems that support it. | |
| 16 | 10 | 0010000 | DLE | Data Link Escape | Changes the interpretation of following characters in certain data communication protocols. | |
| 17 | 11 | 0010001 | DC1 | Device Control 1 | Device-control character traditionally associated with XON in some serial communication systems. | |
| 18 | 12 | 0010010 | DC2 | Device Control 2 | Device-control character reserved for device-specific functions. | |
| 19 | 13 | 0010011 | DC3 | Device Control 3 | Device-control character traditionally associated with XOFF in some serial communication systems. | |
| 20 | 14 | 0010100 | DC4 | Device Control 4 | Device-control character reserved for device-specific functions. | |
| 21 | 15 | 0010101 | NAK | Negative Acknowledge | Indicates that data was not accepted or that an error was detected. | |
| 22 | 16 | 0010110 | SYN | Synchronous Idle | Used by some synchronous communication systems to maintain synchronization. | |
| 23 | 17 | 0010111 | ETB | End of Transmission Block | Marks the end of a block of data in certain communication protocols. | |
| 24 | 18 | 0011000 | CAN | Cancel | Indicates that data or an operation should be canceled or disregarded. | |
| 25 | 19 | 0011001 | EM | End of Medium | Historically indicates the physical end of a medium or the end of usable data. | |
| 26 | 1A | 0011010 | SUB | Substitute | Used as a substitute for a character that is invalid, missing, or in error in certain contexts. | |
| 27 | 1B | 0011011 | ESC | Escape | Introduces an escape sequence or changes the interpretation of following characters in many systems. | |
| 28 | 1C | 0011100 | FS | File Separator | A hierarchical information separator intended for separating files or larger data units. | |
| 29 | 1D | 0011101 | GS | Group Separator | An information separator intended for separating groups of records. | |
| 30 | 1E | 0011110 | RS | Record Separator | An information separator intended for separating records. | |
| 31 | 1F | 0011111 | US | Unit Separator | An information separator intended for separating smaller data units. | |
| 127 | 7F | 1111111 | DEL | Delete | Historically associated with deleting or obliterating a character on punched tape. DEL is not strictly a control character under the original RFC 20 terminology. |
Binary values are shown as 7-bit ASCII representations, including leading zeros. Hexadecimal values use two digits for convenient reference.
What Are ASCII Control Characters?
ASCII stands for American Standard Code for Information Interchange. The original 7-bit ASCII encoding assigns numeric values from 0 through 127 to characters and control functions. Control characters were designed to help manage communication, text formatting and device behavior.
Many control characters do not have a visible glyph. For example, line feed (LF, decimal 10) moves text to a new line in many environments, while horizontal tab (HT, decimal 9) represents a tabulation character. Other codes originated in older communication systems and may have little or no effect in a modern application.
ASCII code ranges
- 0–31: ASCII control characters.
- 32: Space, a printable character that normally appears as a blank.
- 33–126: Printable ASCII punctuation, digits, uppercase and lowercase letters, and symbols.
- 127: DEL, traditionally associated with deleting or obliterating a character.
Although DEL is commonly included in ASCII control-code tables, RFC 20 notes that it is not strictly a control character in the same sense as codes 0–31.
Important ASCII Control Characters
NUL — Null (Decimal 0, Hex 00)
NUL is the zero-valued ASCII character. It has historical
uses in padding and data representation. In programming,
a NUL byte is not the same thing as the printable two-character
string \0; the latter is a common notation
used in source code to represent the byte.
HT — Horizontal Tab (Decimal 9, Hex 09)
HT represents horizontal tabulation. In source code,
strings and text files it is often represented by
\t. The visual width of a tab depends on
the application and its tab-stop settings.
LF — Line Feed (Decimal 10, Hex 0A)
LF is commonly used as a newline character in Unix and
Linux text files. It is often written as \n
in programming languages. The exact handling depends on
the language and operating environment.
CR — Carriage Return (Decimal 13, Hex 0D)
CR represents a carriage return. Windows text files conventionally use CR followed by LF (CRLF) as a line ending, while Unix-like systems typically use LF alone. CR and LF are distinct characters.
ESC — Escape (Decimal 27, Hex 1B)
ESC can introduce escape sequences. In terminals, these sequences may control cursor movement, text styling or other terminal behavior. ESC itself is a control code; the bytes that follow determine the sequence's meaning.
DEL — Delete (Decimal 127, Hex 7F)
DEL was associated with erasing or obliterating unwanted characters in punched-tape systems. In modern contexts, its meaning depends on the application, terminal, protocol or input-handling convention.
Decimal, Hexadecimal and Binary Representations
The same ASCII code can be expressed in different number systems. Decimal is convenient for counting, hexadecimal is compact for debugging and byte-oriented data, and binary shows the individual bits.
| Character | Decimal | Hexadecimal | 7-bit binary | Common notation |
|---|---|---|---|---|
| NUL | 0 | 00 | 0000000 | \0 in some languages |
| HT | 9 | 09 | 0001001 | \t |
| LF | 10 | 0A | 0001010 | \n |
| CR | 13 | 0D | 0001101 | \r |
| ESC | 27 | 1B | 0011011 | Escape character |
| DEL | 127 | 7F | 1111111 | Delete |
A hexadecimal byte is conventionally written using two
hex digits, such as 0A. Standard ASCII itself
uses seven bits; a byte-oriented system often stores
an ASCII value in an eight-bit byte with the high bit
set to zero.
Frequently Asked Questions
1. How many ASCII control characters are there?
The traditional reference includes 33 entries: decimal codes 0–31 and code 127 (DEL). Strictly speaking, RFC 20 distinguishes DEL from the control characters 0–31.
2. What is the ASCII code for a newline?
Line feed (LF) is decimal 10 and hexadecimal 0A. Carriage return (CR) is decimal 13 and hexadecimal 0D. Some systems use LF alone; Windows text files conventionally use CR followed by LF.
3. What is the difference between CR and LF?
CR means carriage return and traditionally moves the position to the beginning of a line. LF means line feed and moves to the next line. They are different ASCII codes and may be combined in CRLF line endings.
4. What is the ASCII code for ESC?
ESC (Escape) is decimal 27, hexadecimal 1B, and seven-bit binary 0011011. It is commonly used to introduce escape sequences in terminals and communication systems.
5. Why do control characters not display normally?
They were designed mainly to represent control functions rather than visible letters or symbols. A program may interpret them, ignore them, display a placeholder, or show a special notation.
6. Is ASCII the same as UTF-8?
No. ASCII is a 7-bit character encoding. UTF-8 is a variable-length Unicode encoding whose first 128 code points use the same byte values as ASCII. UTF-8 can also represent many characters beyond the ASCII range.
7. How can I copy an ASCII control code?
Search or filter the reference table, then click Copy beside the desired entry. The copied value includes its decimal number, abbreviation, name, hexadecimal representation and binary value.
Related Binary and Number System Tools
Explore these related tools on Binarios.org for converting and understanding binary data and digital representations.
Further Reading
The original ASCII network-interchange reference documents the standard character table and describes the historical functions of its control codes.