U+001A Character: What the SUB Control Code Means in Your Text

U+001A is the invisible SUB (substitute) control character. Learn what it changes in stored text, where it comes from, how it affects copying and parsing, and when to remove it.

If a file, database field or pasted snippet contains U+001A, you are dealing with an invisible control code, not a letter, symbol or styling effect. This review explains what that character is, what its presence changes in your text, and whether keeping, replacing or removing it fits your intended use.

Short answer: should U+001A stay in your text?

For text meant to be read, searched, shared or parsed by modern software, the safest recommendation is to remove it or replace it with what was originally intended. Its only real benefit is in narrow legacy or protocol contexts where a system explicitly expects it, such as old tools that treat it as an end-of-file marker or conversion pipelines that use it to flag an unconvertible character. The decisive tradeoff is that it carries no readable meaning while still changing the stored data, so it can silently break searches, comparisons and strict file formats. Plain text without it is preferable whenever a person or a standard parser will consume the result.

What U+001A is

  • Code point: U+001A, decimal 26, hexadecimal 1A.
  • Name: SUBSTITUTE, usually abbreviated SUB.
  • Unicode classification: a C0 control character (general category Cc), inherited from ASCII.
  • Keyboard association: Ctrl+Z, written in caret notation as ^Z.
  • Visible glyph: none by design; it has no standard printed form.

In ASCII, SUB was intended to stand in for a character that was found to be invalid or could not be represented. Over time it picked up other conventional roles, which is why its presence can mean different things depending on where the text came from.

What it actually changes

U+001A is a stored character change, not a visual presentation effect. It occupies a real position in the string, counts toward its length, and travels with the text when it is saved or copied, even if nothing appears on screen. It does not reverse characters or words, mirror glyphs, substitute decorative Unicode letters, apply CSS styling or alter bidirectional display order. Searches for this character are sometimes grouped with "invisible character" or "special font" tools, but it is unrelated to text styling.

The word "substitute" is a common source of confusion. SUB is the old ASCII placeholder for a bad or missing character. Unicode's own placeholder for undecodable or unrepresentable input is a different character, U+FFFD REPLACEMENT CHARACTER, which is visible and usually rendered as a question mark in a diamond. There is also a visible picture symbol, U+241A SYMBOL FOR SUBSTITUTE, that some tools use to show where a SUB would be; it is a printable stand-in, not the control code itself.

Item | Code point | Visible? | Typical role
SUB control | U+001A | No | Legacy substitution marker, legacy end-of-file marker
Replacement character | U+FFFD | Yes | Unicode placeholder for undecodable or unmappable input
Symbol for substitute | U+241A | Yes | Printable picture used to display where a SUB occurs
Caret notation ^Z | Two characters: ^ and Z | Yes | Display convention in some editors and terminals, not stored as one character

Where U+001A usually comes from

  • Legacy end-of-file markers: CP/M recorded file sizes in 128-byte records, so text files marked their real end with ^Z, and MS-DOS software kept the convention for compatibility. Old files may still end with one or more SUB bytes.
  • Encoding conversion: some converters write the byte 1A when the target legacy character set has no equivalent for a source character, so a SUB in the middle of text can mark a character that was lost.
  • Console input on Windows: pressing Ctrl+Z and then Enter signals end of input in the Windows console. On Unix-like terminals, Ctrl+Z normally suspends the running program instead of inserting a character.
  • Binary data treated as text: a byte with value 1A inside binary content will show up as U+001A if that content is decoded as text.

The origin matters for the meaning. A trailing SUB at the very end of an old file is usually harmless padding. A SUB in the middle of a word more likely marks a character that a conversion could not represent, which means the original content has already been lost and cannot be recovered from the SUB alone.

Will the text stay readable and usable after copying or sharing?

Copy and paste: because it is a real character, U+001A is often carried along invisibly when text is copied. Some applications strip control characters on paste and others keep them; behavior differs by program and was not tested for this review, so do not assume a given destination will clean it up.

Display: depending on the software, it may be invisible, shown as an empty box, shown as an abbreviation such as SUB, shown as ^Z, or replaced with a placeholder symbol. One clean rendering in one viewer says nothing about how another viewer will treat the same text.

Search and comparison: a hidden SUB inside a word makes the stored string different from what is visible, so exact-match searches, deduplication and equality checks can fail even though the two values look identical.

Editing: cursor movement and deletion can behave unexpectedly around an invisible character, for example requiring an extra keypress to delete what appears to be nothing.

Strict formats: XML 1.0 does not allow U+001A anywhere in a document, so a file containing it is not well-formed. JSON requires control characters inside strings to be escaped, so a raw SUB produces invalid JSON, while the escaped form is valid. HTML treats control characters in the input stream as parse errors, although browsers generally continue rendering. Software that reads files in a legacy text mode may stop reading at the first 1A byte and silently drop everything after it.

Accessibility: no documentation or scoped screen reader test was supplied for this review, so how individual assistive technologies announce or skip U+001A remains unverified. Because the character carries no readable meaning either way, a plain-text version without it is the dependable choice for anything that must be accessible.

How to check whether a file contains it

Since the character is invisible, inspect the bytes rather than relying on how the text looks. Reading in binary mode avoids any legacy end-of-file handling. The following Python snippet counts occurrences and reports their byte positions:

with open("input.txt", "rb") as f:
    data = f.read()

positions = [i for i, b in enumerate(data) if b == 0x1A]
print("SUB count:", len(positions))
print("First positions:", positions[:10])
print("Only at end of file:", bool(positions) and data.rstrip(b"\x1a") == data[:positions[0]])

On Unix-like systems, a quick command-line check counts the lines that contain at least one SUB, and an octal dump shows it as 032:

grep -c $'\x1a' input.txt
od -c input.txt | grep 032

Remove, replace or keep?

  • Remove it when it appears only at the end of a legacy file; it is padding and carries no content.
  • Investigate before removing when it appears mid-text; re-convert from the original source with the correct encoding if you can, because the SUB marks a character that was lost.
  • Replace it with U+FFFD if you need a visible marker that something was unrepresentable, since that is the Unicode convention and readers can see it.
  • Keep it only when a specific legacy system or protocol documents that it expects the character, and keep that data separate from text meant for people.
  • Escape it as \u001a when it must be preserved inside JSON or similar formats that forbid raw control characters.

What this review could not verify

No subject-specific test results were supplied, so this article relies on documented standards and widely established conventions rather than measured observations. It does not confirm how particular messaging apps, word processors, content management systems or screen readers handle U+001A. If your workflow depends on a specific destination, run a small scoped test: paste a sample containing the character, then inspect what was stored at the destination at the byte level, not just what appears on screen.