Unicode 0x13 Character (U+0013): What It Is and How to Find It
U+0013 is the invisible DC3 control character, historically used as XOFF. Learn how to detect, reveal, remove and verify it in text files and strings.
The Unicode character 0x13, written U+0013, is an invisible control character. It does not draw a glyph, so it can sit inside a line of text without showing up on screen. It can still break parsers, validators, comparisons and searches. This guide explains what the character is, how to confirm that it is present, and how to reveal or remove it without changing anything else in your text.
What U+0013 is
U+0013 belongs to the C0 control block, the first 32 code points inherited from ASCII. Its formal alias is DEVICE CONTROL THREE, usually abbreviated DC3. Its Unicode general category is Cc (control). In older serial and terminal communication, DC3 served as XOFF, the signal asking the sender to pause output. Its partner, U+0011 (DC1), served as XON and asked transmission to resume.
| Property | Value |
| Code point | U+0013 |
| Hexadecimal | 0x13 |
| Decimal | 19 |
| Octal | 023 |
| Name alias | DEVICE CONTROL THREE (DC3) |
| General category | Cc (control) |
| Caret notation | ^S (Ctrl+S) |
| UTF-8 bytes | 13 (a single byte) |
| Escape in Python, JavaScript and JSON | \x13 or \u0013 |
| Visible stand-in symbol | U+2413 ␓ SYMBOL FOR DEVICE CONTROL THREE |
A common mix-up: 0x13 is hexadecimal and equals decimal 19. It is not decimal 13, which is the carriage return (U+000D, \r). If a tool or document says character 13, check whether it means hex or decimal before you search or delete anything.
Why the character causes problems
Because it is invisible, U+0013 can make two strings that look identical compare as different. It can make a lookup or a regular expression fail to match. It can also cause outright rejection by strict formats. XML 1.0 forbids it in documents, even as a character reference. JSON allows it inside strings only in escaped form, so a raw 0x13 byte inside a JSON string makes the JSON invalid. In an interactive terminal, typing Ctrl+S may send XOFF and appear to freeze output when flow control is enabled. Ctrl+Q usually resumes it.
The character can arrive in text through data copied from terminal sessions, logs from serial devices or legacy systems, or corrupted or mis-decoded files. The exact source in any given file cannot be determined from the character alone.
How to identify U+0013 step by step
Step 1: Reveal control characters without modifying the file. On Linux and macOS, cat -v prints control characters in caret notation, so U+0013 appears as ^S. Illustrative example:
$ printf 'abc\x13def\n' | cat -v
abc^Sdef
Step 2: Confirm the exact byte value with a hex or octal dump. This rules out look-alikes such as other control characters. In the illustrative output below, xxd shows the byte as 13, and od -c shows it as the octal escape 023:
$ printf 'abc\x13def\n' | xxd
00000000: 6162 6313 6465 660a abc.def.
$ printf 'abc\x13def\n' | od -c
0000000 a b c 023 d e f \n
0000010
Step 3: Find every line that contains the character. With GNU grep and PCRE support, -P accepts the \x13 escape. In bash, the $'\x13' quoting form inserts the literal byte, so it works without -P. Setting LC_ALL=C makes grep treat the input as raw bytes.
# Line numbers of lines containing U+0013
LC_ALL=C grep -n -P '\x13' input.txt
# Same search without PCRE (bash quoting)
LC_ALL=C grep -n $'\x13' input.txt
# Count occurrences (not just matching lines)
LC_ALL=C grep -o -P '\x13' input.txt | wc -l
Step 4: Locate it precisely in code when you need line and column positions. In Python, unicodedata.category reports Cc for this character. Note that unicodedata.name raises an error for C0 controls, because they have no standard character name. DEVICE CONTROL THREE is only an alias. Example script:
import unicodedata
with open('input.txt', encoding='utf-8') as f:
for line_no, line in enumerate(f, 1):
for col, ch in enumerate(line, 1):
if ch == '\x13':
print(line_no, col, hex(ord(ch)), unicodedata.category(ch))
In JavaScript, text.includes('\u0013') tests for presence, and /\u0013/g matches every occurrence. In PowerShell, $text.Contains([char]0x13) performs the same check.
How to make it visible or remove it
If you only want to see where the character sits, replace it with the visible symbol ␓ (U+2413) in a copy of the text. This keeps the position marked and leaves the rest unchanged. If the character serves no purpose in your data, delete it. Before an in-place edit, keep a backup. Target only 0x13: a broad filter such as "remove all control characters" would also strip tabs, line feeds and carriage returns that your text needs.
# Write a cleaned copy (tr takes the octal form)
tr -d '\023' < input.txt > output.txt
# Edit in place with GNU sed, keeping input.txt.bak as a backup
sed -i.bak 's/\x13//g' input.txt
# Python: reveal or remove
visible = text.replace('\x13', '\u2413')
cleaned = text.replace('\x13', '')
// JavaScript
const cleaned = text.replace(/\u0013/g, '');
How to verify the result
- Search the output again: LC_ALL=C grep -c -P '\x13' output.txt should print 0. grep also exits with status 1 when nothing matches.
- Compare sizes: in UTF-8 each U+0013 is one byte, so wc -c on the original minus wc -c on the cleaned file should equal the occurrence count from Step 3.
- Diff the files: diff input.txt.bak input.txt, or cmp -l on the two files, should show only the removed 0x13 bytes and no other changes.
- Re-run the consuming tool: if a JSON or XML parser, validator or import failed before, run it again to confirm the error is gone.
Limits of this guide
How individual text editors, IDEs and terminals display U+0013 varies by application and settings. Some show a labeled box, some show ^S, and some show nothing. This guide does not cover any specific product's display behavior, so rely on a byte-level check such as xxd or od for a definitive answer. The command examples are illustrative and assume GNU tools. BSD and macOS versions of grep and sed may not support -P or the \x13 escape in the same way; in that case, the bash $'\x13' quoting form or tr with octal 023 is the safer choice.