Control characters in ASCII code are those that do not represent a visible symbol on the screen, but are used to control devices, such as printers or text terminals. These characters perform specific functions, such as controlling the position of the cursor, starting a new line, or signaling the end of a file.
ASCII code control character table
Complete list of ASCII commands and control characters ranging from 0 to 31.
Decimal | Octal | Hex | Binary (8 bits) | Symbol / Abbreviation | Representation | Description |
---|---|---|---|---|---|---|
0 | 000 | 00 | 0000 0000 | NUL | ␀ | Null character |
1 | 001 | 01 | 0000 0001 | SOH | ␁ | Start of Heading |
2 | 002 | 02 | 0000 0010 | STX | ␂ | Start of Text |
3 | 003 | 03 | 00000011 | ETX | End of Text | |
4 | 004 | 04 | 00000100 | EOT | End of Transmission | |
5 | 005 | 05 | 00000101 | ENQ | Enquiry | |
6 | 006 | 06 | 00000110 | ACK | Acknowledge | |
7 | 007 | 07 | 00000111 | BEL | Bell, Alert | |
8 | 010 | 08 | 00001000 | BS | Backspace | |
9 | 011 | 09 | 00001001 | HT | Horizontal Tab | |
10 | 012 | 0A | 00001010 | LF | Line Feed | |
11 | 013 | 0B | 00001011 | VT | Vertical Tabulation | |
12 | 014 | 0C | 00001100 | FF | Form Feed | |
13 | 015 | 0D | 00001101 | CR | Carriage Return | |
14 | 016 | 0E | 00001110 | SO | Shift Out | |
15 | 017 | 0F | 00001111 | SI | Shift In | |
16 | 020 | 10 | 00010000 | DLE | Data Link Escape | |
17 | 021 | 11 | 00010001 | DC1 | Device Control One (XON) | |
18 | 022 | 12 | 00010010 | DC2 | Device Control Two | |
19 | 023 | 13 | 00010011 | DC3 | Device Control Three (XOFF) | |
20 | 024 | 14 | 00010100 | DC4 | Device Control Four | |
21 | 025 | 15 | 00010101 | NAK | Negative Acknowledge | |
22 | 026 | 16 | 00010110 | SYN | Synchronous Idle | |
23 | 027 | 17 | 00010111 | ETB | End of Transmission Block | |
24 | 030 | 18 | 00011000 | CAN | Cancel | |
25 | 031 | 19 | 00011001 | EM | End of medium | |
26 | 032 | 1A | 00011010 | SUB | Substitute | |
27 | 033 | 1B | 00011011 | ESC | Escape | |
28 | 034 | 1C | 00011100 | FS | File Separator | |
29 | 035 | 1D | 00011101 | GS | Group Separator | |
30 | 036 | 1E | 00011110 | RS | Record Separator | |
31 | 037 | 1F | 00011111 | US | Unit Separator | |
Decimal | Octal | Hex | Binary | Symbol / Abbreviation | Representation | Description |
What are control characters?
As I mentioned at the beginning, control characters in the ASCII code are a set of codes that do not represent visible symbols such as letters or numbers, but are used to control the flow of data, the presentation of text, and the operations of devices such as printers or terminals. These characters occupy the first 32 values of the ASCII table (from 0 to 31) plus the value 127, and are essential for communication in old and modern computer systems.
What is the function of control characters?
As the name suggests, these codes are responsible for telling a computer or device to perform an action. Some of the most common functions are:
- Line Feed (LF, code 10): Moves the cursor to the next line.
- Carriage Return (CR, code 13): Moves the cursor to the beginning of the line, similar to what a typewriter does.
- Horizontal Tab (HT, code 9): Advances the cursor to the next tab position.
- Delete (DEL, code 127): Deletes a character or line of text.
- End of Text (ETX, code 3): Signals the end of a text transmission.
Control characters examples
- 0 (NULL): Null character, used in many applications to indicate the end of a text string.
- 7 (BEL): Activates or emits a bell or alert sound on the device (for example, a “beep”).
- 8 (BS): Backspace, go back one character, like when you delete something.
- 9 (TAB): Horizontal tabulation.
- 10 (LF): Line Feed.
- 13 (CR): Carriage Return.
- 27 (ESC): Escape character, used to change modes on devices or initiate special sequences.
- And character 127 (DEL): It is the “delete” character.
Use in modern systems
Although many of these control characters originated in older systems such as teletypewriters, they are still relevant in modern communication protocols and text file formats. For example, the carriage return and line feed are essential in systems such as Windows and Unix to indicate the end of a line of text.
In short, control characters are instructions that cannot be seen but play a crucial role in the organization, transmission and presentation of text in computer systems.