Invisible characters in ASCII are non-printable characters that do not have a visual representation on the screen. These characters are often used for control purposes, formatting, or special signaling in text or data streams.
Types of Invisible ASCII Characters
1. Control Characters (ASCII 0–31 and 127)
These characters are non-printable and are used for controlling devices, text formatting, or signaling.
ASCII Code | Character | Name | Description |
---|---|---|---|
0 | NUL |
Null | No operation (used as a string terminator). |
1 | SOH |
Start of Header | Marks the start of a header. |
2 | STX |
Start of Text | Marks the start of text data. |
3 | ETX |
End of Text | Marks the end of text data. |
4 | EOT |
End of Transmission | Marks the end of transmission. |
5 | ENQ |
Enquiry | Requests a response from a device. |
6 | ACK |
Acknowledge | Acknowledges receipt of data. |
7 | BEL |
Bell | Triggers an alert sound or visual alert. |
8 | BS |
Backspace | Moves the cursor one character back. |
9 | TAB |
Horizontal Tab | Moves the cursor to the next tab stop. |
10 | LF |
Line Feed | Moves the cursor to the next line. |
11 | VT |
Vertical Tab | Moves the cursor vertically. |
12 | FF |
Form Feed | Advances the printer to a new page. |
13 | CR |
Carriage Return | Moves the cursor to the beginning of the line. |
14 | SO |
Shift Out | Switches to an alternate character set. |
15 | SI |
Shift In | Switches back to the default character set. |
16 | DLE |
Data Link Escape | Signals control of a communication link. |
… | … | … | … |
127 | DEL |
Delete | Marks a deleted character (historically). |
2. Whitespace Characters
Whitespace characters are technically visible in that they create space but do not render glyphs.
ASCII Code | Character | Name | Description |
---|---|---|---|
9 | TAB |
Horizontal Tab | Creates a tab space. |
10 | LF |
Line Feed | Moves the cursor to a new line. |
11 | VT |
Vertical Tab | Moves the cursor vertically. |
12 | FF |
Form Feed | Starts a new page. |
13 | CR |
Carriage Return | Returns the cursor to the start of the line. |
32 | Space | Space | Inserts a blank space. |
How to Represent or Use Invisible Characters
- Programming and Escape Sequences:
- Many programming languages allow these characters to be represented using escape sequences:
\n
for Line Feed (LF)\t
for Horizontal Tab (TAB)\r
for Carriage Return (CR)
- Many programming languages allow these characters to be represented using escape sequences:
- Keyboard Shortcuts:
- Some invisible characters like
TAB
(9) orSPACE
(32) can be entered directly using the keyboard.
- Some invisible characters like
- Hexadecimal Representation:
- Invisible characters can be represented in hexadecimal notation:
0x00
for NUL0x09
for TAB0x20
for Space
- Invisible characters can be represented in hexadecimal notation:
- Viewing Invisible Characters:
- Tools like text editors (
vim
,nano
) orcat -A
in the terminal can help visualize these characters.
- Tools like text editors (
Practical Applications
- Communication Protocols: ASCII control characters like
ACK
,EOT
, andSTX
are used in data communication. - Document Formatting: Whitespace characters like
TAB
andCR
structure text files. - Programming and Data Parsing: Invisible characters help separate data fields or terminate strings.
- Testing and Debugging: Invisible characters are often checked to ensure data integrity.