Find Hidden Characters in Text
How a hidden character finder reveals zero-width, direction and lookalike characters, when removing them helps or harms, and how to check text yourself.
Hidden characters are code points that sit in stored text but show little or nothing on screen. Examples include zero-width spaces, joiners, direction marks, byte order marks and non-breaking spaces. A hidden character finder exposes them so you can decide whether each one belongs. This review covers what inspection shows, what removal changes, when cleaning text helps or harms, and how to find a method that fits your situation.
Is a hidden character finder the right tool for your text?
Inspecting text is almost always safe, because it reads the text without altering it. Removing characters is where you need judgment. The main benefit of inspection is that it explains problems that otherwise look impossible. A search fails on a word that is plainly there. A password or identifier looks correct but is rejected. Code behaves differently from how it reads. A line refuses to wrap.
The decisive tradeoff is that some invisible characters are noise and others carry meaning. A zero width joiner holds multi-part emoji together. A zero width non-joiner is part of correct spelling in Persian and several Indic scripts. Direction marks keep mixed left-to-right and right-to-left text in readable order. Soft hyphens and non-breaking spaces record typographic intent. A blanket pass that removes every invisible character can damage that kind of text while fixing nothing.
Plain text is the better choice when text will be compared exactly or parsed by software. That means no format characters and only ordinary spaces. It applies to source code, identifiers, usernames, passwords, URLs typed into fields, spreadsheet keys and database values. For natural-language text, especially in non-Latin scripts or with emoji, inspect first. Then remove only characters you can name and have a reason to remove.
What inspection reveals and what removal changes
Digital text is a sequence of code points. What you see is a font and layout engine's rendering of that sequence. A hidden character is in the sequence but renders in one of three ways: as nothing, as ordinary-looking whitespace, or only as an effect on its neighbors, such as joining, breaking or reordering them. An inspector lists the sequence itself. For each character it typically shows the position, the code point in U+XXXX form, the Unicode name and the general category. This makes the gap between stored and displayed text visible.
Inspection changes nothing that is stored. Removal or replacement does. Afterward the string contains different code points, which can change its length, equality comparisons, hashes, line breaking, and emoji or script shaping. Editor options that show whitespace or invisibles are presentation only. They draw markers on screen without inserting anything into the text.
| Code point | Name | Effect | Usually safe to remove? |
| U+200B | ZERO WIDTH SPACE | Invisible line-break opportunity | Yes in code and data; may be a deliberate break hint in scripts written without spaces |
| U+200C | ZERO WIDTH NON-JOINER | Prevents adjacent letters from joining | No in Persian and some Indic text; yes in code and data |
| U+200D | ZERO WIDTH JOINER | Joins emoji sequences and some script forms | No inside emoji or complex scripts; yes in identifiers |
| U+2060 | WORD JOINER | Prevents a line break | Usually yes in data |
| U+FEFF | ZERO WIDTH NO-BREAK SPACE / byte order mark | Signals encoding at the start of a file; elsewhere usually stray | Depends on whether the consuming software expects it |
| U+00A0 | NO-BREAK SPACE | Looks like a space but prevents wrapping | Yes for matching and data; may be intentional typography |
| U+00AD | SOFT HYPHEN | Shows only when a word breaks at line end | Yes, at the cost of losing hyphenation hints |
| U+200E, U+200F | LEFT-TO-RIGHT MARK, RIGHT-TO-LEFT MARK | Adjust direction in mixed-direction text | No in bidirectional prose; suspicious in code |
| U+202A to U+202E, U+2066 to U+2069 | Bidirectional embeddings, overrides and isolates | Reorder how text is displayed | Rarely needed outside bidirectional prose; treat as suspect in code |
| U+FE0E, U+FE0F | VARIATION SELECTOR-15, VARIATION SELECTOR-16 | Request text or emoji presentation | Removal may change how a symbol displays |
| U+E0001, U+E0020 to U+E007F | Tag characters | Used in some flag emoji sequences; otherwise invisible | Yes outside emoji sequences |
The Unicode format category, Cf, covers many of these characters but not all. A no-break space is a space separator (Zs). Tabs and carriage returns are control characters (Cc). A finder that checks only one category will miss some cases.
How hidden characters relate to reversed, mirrored and font-styled text
Words like reverse, mirror and font are used loosely. Inspecting the text is the quickest way to tell which mechanism a sample actually uses.
- Character reversal: the code points really are stored in reverse order. An inspector shows the reordered sequence and nothing hidden.
- Bidirectional override: the stored text is in normal order, but a control such as U+202E RIGHT-TO-LEFT OVERRIDE makes it display backward. An inspector shows the override code point. If a destination ignores or strips bidirectional controls, the text may appear forward again.
- Mirrored, upside-down or fancy-font text: letters are replaced with different code points that resemble flipped or styled letters, such as mathematical alphanumeric symbols or letters from other scripts. Nothing is hidden, but an inspector shows these are not the ordinary Latin letters they resemble.
- CSS transforms and styling: presentation on a web page only. Copying usually yields the original characters.
If you reverse text yourself, account for units made of more than one code point. A letter written as e followed by U+0301 COMBINING ACUTE ACCENT will lose its accent to the wrong neighbor if the code points are reversed one by one. An emoji followed by a skin tone modifier will split into a standalone color swatch and an unmodified emoji. Reverse by grapheme cluster, meaning the user-perceived character, rather than by code point.
Will the text stay usable after copying or sharing?
Hidden characters are part of the text, so copy and paste generally carries them along. That is how they travel from web pages and chats into code, forms and documents. Whether a given destination keeps, strips or converts them depends on that destination. No tests of specific apps, browsers or platforms were available for this review. To check one, paste into it and inspect the result again.
Hidden characters can break both search and editing. A zero-width space or no-break space inside a word or phrase causes exact searches and comparisons to fail even though the text looks identical. Unicode normalization is not a general fix: NFKC converts a no-break space to an ordinary space but leaves zero-width and direction characters in place. When editing, the cursor may seem to pause for an extra keystroke at an invisible character, and deleting it produces no visible change.
Screen readers work from the underlying characters, not the visual appearance. Text displayed through a bidirectional override, or built from lookalike symbols, may be read differently from how it looks, spelled out, or skipped. Behavior varies by screen reader, voice and settings, and no scoped test results are available here. If accessibility matters, test with the assistive technology your audience uses, and provide a plain-text equivalent alongside any styled or reversed text.
In source code and configuration files, hidden and direction characters can make code display differently from how a compiler or interpreter reads it. Lookalike characters can disguise identifiers or addresses. Unicode Technical Standard #39 (security mechanisms) and Unicode Standard Annex #9 (the bidirectional algorithm) describe these issues. For security-relevant text, use plain text and review it explicitly.
Where to find a way to reveal hidden characters
Useful search terms include Unicode character inspector, code point viewer, zero-width character detector, invisible character remover, show invisible characters, render whitespace and bidirectional control characters. Many code editors can display whitespace and control characters, and some development tools warn about bidirectional characters. Option names and menu locations differ by product and version and were not verified for this review, so check your editor's documentation.
Web-based inspectors are convenient for text that is not sensitive. A page's design or marketing does not tell you whether it processes text only in your browser or what it keeps. For passwords, private messages or proprietary code, use a local method instead.
The following Python script uses only the standard library. It lists the position, code point, category and name of each character that is likely to be invisible or confusable as whitespace.
import unicodedata
SUSPECT = {"Cf", "Cc", "Co", "Cn", "Zs", "Zl", "Zp"}
def find_hidden(text):
for i, ch in enumerate(text):
if ch in " \n\t":
continue
cat = unicodedata.category(ch)
if cat in SUSPECT:
name = unicodedata.name(ch, "<no name>")
print(f"{i}\tU+{ord(ch):04X}\t{cat}\t{name}")
find_hidden("pass\u200bword\u00a0ok")
For the sample string, the script reports the zero-width space between "pass" and "word" and the no-break space before "ok":
4 U+200B Cf ZERO WIDTH SPACE
9 U+00A0 Zs NO-BREAK SPACE
Combining marks (category Mn) are not flagged, because they are common in legitimate accented text. Add Mn to the set if you are looking for stacked or stray marks. The Unicode data the script uses depends on the Python version, so very recently assigned characters may show as unassigned (Cn) on an older interpreter.
On a command line, GNU grep with PCRE support and a UTF-8 locale can flag lines that contain common invisible characters:
grep -nP '[\x{00A0}\x{00AD}\x{200B}-\x{200F}\x{202A}-\x{202E}\x{2060}-\x{2064}\x{2066}-\x{2069}\x{FEFF}]' file.txt
This command checks only the listed ranges. It does not catch tag characters, variation selectors or lookalike letters, and some grep builds do not support the -P option.
A practical cleanup workflow
- Inspect the text and list every flagged code point by name.
- Decide for each character whether it is noise or meaningful, using the destination and the script or emoji context.
- Remove or replace specific code points rather than whole categories, and convert no-break spaces to ordinary spaces only where exact matching matters.
- Inspect again to confirm that only the intended characters changed.
- Paste the result into the real destination and check search, display and, where relevant, screen reader output.