Identify ASCII Control Characters in Unicode
How to recognize the ASCII control characters inside Unicode text, what visible-notation transformations change, and when to keep the original plain text.
ASCII reserves 33 of its 128 codes for control characters. They are the 32 codes from 0 to 31 plus DEL at 127. Unicode keeps them at the same positions: U+0000 through U+001F and U+007F. All of them carry the general category Cc (Control). Unicode also defines a second set, the C1 controls at U+0080 through U+009F, which are also category Cc but are not part of ASCII. Control characters have no visible glyph of their own, so finding them usually means converting them into something you can see. This review covers what those conversions change and when the result is fit for your purpose.
Should you make control characters visible?
For inspection work, yes. Debugging, reviewing logs, comparing files, checking pasted input and auditing data all benefit from visible notation. The main benefit is that tabs, carriage returns, escape codes and stray nulls stop hiding behind blank space or broken layout.
The decisive tradeoff is that most visible forms replace the control character with different characters. A visible tab symbol does not indent, and a visible line-feed symbol does not break a line. Treat the visible version as a report about the text, not as a substitute for it. Keep the original plain text whenever it will be processed by software, pasted into forms or code, stored as data, or read by people using assistive technology.
What each approach actually changes
Methods for revealing control characters fall into two groups: those that only change the display, and those that change the stored characters.
- Display-only marking: an editor or terminal option such as 'show invisibles' or 'show whitespace' draws markers on screen while the file keeps its original bytes. Copying from the editor normally copies the real control characters, not the markers.
- Escape notation: each control is rewritten as a printable sequence such as \t, \n, \r, \x1B or U+000A. The stored text changes, but the conversion can be reversed if everyone agrees on which escape syntax is in use.
- Caret notation: a control is shown as ^ followed by a printable character, for example ^M for carriage return or ^[ for escape. The printable character is the control code with 64 added, which is why NUL appears as ^@ and DEL as ^?.
- Control Pictures substitution: each control is replaced with a symbol from the Unicode Control Pictures block (U+2400 to U+243F), such as U+2409 for horizontal tab. These symbols are ordinary graphic characters. The original control is gone from the stored text.
Some terminology gets used loosely in this area. In terminals, 'reverse' often means reverse video, which swaps foreground and background colors to highlight text. That is a display effect, not a reordering of characters. Bidirectional marks and overrides such as U+200E or U+202E are sometimes grouped with control characters, but they are format characters (category Cf), not ASCII controls. Zero-width space (U+200B) and the byte order mark (U+FEFF) are also Cf. A good inspector reports the general category so these can be told apart from true Cc controls.
If you also run a reversal transformation on text that contains controls, the line endings get reordered too. A Windows-style CR LF pair becomes LF CR, which most software no longer reads as a single line break. Naive code-point reversal also separates combining marks from their base letters and splits multi-code-point emoji. Make the controls visible before reversing so the damage can be seen.
Original (invisible): A<tab>B<carriage return><line feed>
Escape notation: A\tB\r\n
Caret notation: A^IB^M^J
Control Pictures: A␉B␍␊
All three visible forms in the example show the same four positions. Only the original still behaves as a tab followed by a line break.
Common ASCII control characters and their visible forms
| Code point | Abbreviation | Name | Common escape | Caret | Control Picture |
| U+0000 | NUL | Null | \0 | ^@ | ␀ (U+2400) |
| U+0007 | BEL | Bell | \a | ^G | ␇ (U+2407) |
| U+0008 | BS | Backspace | \b | ^H | ␈ (U+2408) |
| U+0009 | HT | Horizontal tab | \t | ^I | ␉ (U+2409) |
| U+000A | LF | Line feed | \n | ^J | ␊ (U+240A) |
| U+000B | VT | Vertical tab | \v | ^K | ␋ (U+240B) |
| U+000C | FF | Form feed | \f | ^L | ␌ (U+240C) |
| U+000D | CR | Carriage return | \r | ^M | ␍ (U+240D) |
| U+001B | ESC | Escape | \x1B | ^[ | ␛ (U+241B) |
| U+007F | DEL | Delete | \x7F | ^? | ␡ (U+2421) |
Escape syntax depends on the language or tool. The forms above follow C-style conventions. Some environments accept \e for escape, and many accept only hexadecimal or Unicode escapes.
Encoding also matters. In UTF-8, the ASCII controls and DEL are single bytes with the same values as in ASCII. The C1 controls take two bytes each, C2 80 through C2 9F. C1 controls often appear by accident when text in Windows-1252 is decoded as ISO-8859-1, because Windows-1252 uses bytes 0x80 to 0x9F for printable characters such as the euro sign.
Will the result stay usable after copying or sharing?
It depends on which form you share.
- Control Pictures copy and paste as ordinary symbols. Pasting them back will not restore the original tabs or line breaks.
- Escape notation survives copying as plain ASCII. It is only meaningful to a reader or program that uses the same escape conventions.
- Raw control characters are the least predictable when shared. Some destinations strip them or convert them, and some reject the input entirely. Software that treats NUL as the end of a string may cut the text off at that point. Escape sequences that begin with ESC can change colors, cursor position or other terminal state when printed, which is a good reason to make untrusted text visible before displaying it in a terminal.
- Searching and editing follow the stored characters. A search for a tab will not match the ␉ symbol, and a search for ␉ will not match a real tab.
Accessibility is uncertain. Screen readers may announce Control Picture symbols by name, skip them, or read them some other way, and raw controls may be silent. No documentation or scoped test for a specific screen reader, browser or platform was available for this review, so no claim is made about any particular one. If a visible-control report will be read with assistive technology, test it in that environment, and also provide a plain-language description such as 'line 3 contains a tab between the two values.'
How to spot control characters and where to look for tools
These clues often point to hidden controls:
- Columns that should line up don't, because tabs and spaces are mixed.
- ^M appears at line ends, which means CR LF line endings are being viewed in a tool that expects LF only.
- Empty boxes or replacement symbols appear where nothing should be.
- Text is cut off unexpectedly, which can be a sign of an embedded NUL.
- Terminal colors or the cursor behave strangely after printing a file, which suggests ESC sequences.
- Two strings look identical but don't compare as equal, which may be caused by a control or a format character such as U+200B.
Search terms that lead to the right capability include 'show invisible characters,' 'show whitespace,' 'Unicode code point inspector,' 'hex dump,' 'caret notation,' 'Control Pictures,' and 'Unicode general category Cc.' No specific editor menu or web tool was verified for this review. Check that any option you find actually exists in your version of the software, and do not assume an online tool's data handling from how it looks or how it describes itself.
Standard command-line utilities, where installed, can show the bytes directly. On systems with GNU coreutils, cat -A displays nonprinting characters in caret notation, tabs as ^I, and line ends as $. The od -c command prints each byte with C-style escapes. The hexdump -C and xxd commands show hexadecimal byte values next to printable text. Options vary between implementations, so check the manual page on your system.
In a scripting language, you can inspect code points and categories directly. The Python example below lists every control (Cc) or format (Cf) character together with its position and code point. It reports categories rather than names because Python's unicodedata.name() raises an error for control characters, which have no formal character name.
import unicodedata
def inspect(text):
for i, ch in enumerate(text):
cat = unicodedata.category(ch)
if cat in ("Cc", "Cf"):
print(i, f"U+{ord(ch):04X}", cat)
inspect("A\tB\r\n\u200b")
# 1 U+0009 Cc
# 3 U+000D Cc
# 4 U+000A Cc
# 5 U+200B Cf
Bottom line
Making ASCII control characters visible is the right move when you need to diagnose text. Use display-only marking when you want the file left untouched. Use escape notation when the result must be reversible. Use Control Pictures when people need a readable report. In every case, keep the original plain text as the authoritative version, because visible notation changes how the text behaves, how it searches, and possibly how assistive technology reads it.