Hidden Character Checker: How to Find and Identify Invisible Unicode Characters

Learn what a hidden character checker does, which invisible Unicode characters it reveals, and how to find, identify and safely clean them without breaking your text.

Text can look clean and still contain characters you cannot see. A zero-width space copied from a web page, a byte order mark at the start of a file, or a direction-control character pasted into source code can break searches, comparisons, passwords, data imports and code. A hidden character checker shows these invisible Unicode characters so you can see exactly what your text contains before you decide what to change.

What a hidden character checker does for your text

A hidden character checker takes plain text as input, either pasted into a box or read from a file, and examines it one character at a time. Instead of rendering the text normally, it reports characters that have no visible shape or that look identical to an ordinary character. The output is usually one of two things: a marked-up view where each hidden character is replaced or highlighted with a visible label, or a list that gives each suspicious character's position, its code point and its official Unicode name.

A code point is the unique number Unicode assigns to every character, written in the form U+ followed by hexadecimal digits. For example, the ordinary space is U+0020 and the zero-width space is U+200B. Seeing the code point and name is what turns a vague suspicion that something is wrong with a line into a precise answer about which character is present and where.

Inspection on its own does not change your text. Some checkers also offer to remove or replace what they find, but that is a separate step, and it is the step where meaningful content can be lost. Treat identification and cleanup as two decisions.

Note on scope: no specific checker product was evaluated for this guide, so it describes what such tools generally do, based on how Unicode itself defines these characters. Individual tools differ in which characters they flag, so check a tool's own documentation for its exact coverage.

Hidden Unicode characters you are likely to encounter

Most hidden characters fall into a few groups: format characters that affect layout or joining but have no glyph, space characters other than the ordinary space, direction controls for right-to-left scripts, and control characters left over from older systems. The table below lists common ones.

Code point | Name | Why it matters
U+200B | ZERO WIDTH SPACE | Invisible break opportunity; often arrives via copy and paste from web pages and splits words for search and matching
U+200C | ZERO WIDTH NON-JOINER | Prevents letters from joining; meaningful in Persian and some Indic scripts
U+200D | ZERO WIDTH JOINER | Joins characters; used to build many multi-part emoji
U+2060 | WORD JOINER | Prevents a line break without adding visible space
U+FEFF | ZERO WIDTH NO-BREAK SPACE | Also used as the byte order mark (BOM) at the start of files; can break parsers and the first field of a CSV
U+00AD | SOFT HYPHEN | Usually invisible unless a line breaks at that point
U+00A0 | NO-BREAK SPACE | Looks like a normal space but does not match U+0020 in searches or comparisons
U+202F | NARROW NO-BREAK SPACE | Similar to the no-break space but narrower
U+3000 | IDEOGRAPHIC SPACE | Full-width space used in East Asian text
U+200E and U+200F | LEFT-TO-RIGHT MARK and RIGHT-TO-LEFT MARK | Invisible direction hints for mixed-script text
U+202A to U+202E | Directional embedding and override controls | Can reorder how text is displayed without changing its stored order
U+2066 to U+2069 | Directional isolate controls | Same concern as the overrides; relevant to source code review
U+E0000 to U+E007F | Tag characters | Invisible; used in some flag emoji sequences but otherwise rarely expected
U+FE00 to U+FE0F | Variation selectors | Choose between text and emoji style or glyph variants

Directional controls deserve particular attention in code. Because they change how a line is displayed but not how it is stored, a line can appear to a reviewer to say one thing while a compiler or interpreter reads something different. Many code review tools and editors now warn about these characters for that reason.

Look-alike characters, called homoglyphs, are a related but separate problem. The Cyrillic letter а (U+0430) and the Latin letter a (U+0061) look the same in most fonts, yet they are different characters. They are visible, so a checker focused only on invisible characters may not flag them. Catching them requires a tool that reports the script of each character or shows every code point, not only the invisible ones.

An illustrative example

Example only, not tested output from any particular tool. Suppose a product code copied from a web page refuses to match the same code typed by hand. Both look like this on screen:

SKU-4471

A checker that labels hidden characters might reveal that the pasted version is actually stored like this, with the invisible characters shown in angle brackets:

SKU-⟨U+200B ZERO WIDTH SPACE⟩4471⟨U+00A0 NO-BREAK SPACE⟩

The typed version contains eight characters; the pasted one contains ten. That difference, invisible on screen, is why the comparison fails. A list-style report for the same input would give positions instead, such as character 5 being U+200B and character 10 being U+00A0.

How to find and identify hidden characters step by step

  • 1. Work on a copy. Keep the original text or file unchanged so you can compare before and after.
  • 2. Paste the text into a hidden character checker, or open the file in a tool that can display invisible characters. Make sure the text is read as UTF-8 or whatever encoding it was saved in; reading it with the wrong encoding produces garbled characters that are not really in the text.
  • 3. Review every flagged character. Note its code point, its name and its position.
  • 4. Decide for each one whether it is accidental or meaningful, using the guidance in the next section.
  • 5. Remove or replace only the characters you have judged accidental. Replace look-alike spaces with an ordinary space rather than deleting them, or words may run together.
  • 6. Run the checker again on the cleaned text to confirm that only the characters you intended to keep remain.
  • 7. Re-test the original problem: repeat the search, comparison, import or build that was failing.

Checking text yourself with a short script

If you prefer not to paste sensitive text into an online tool, you can inspect it locally. The Python script below is an illustrative example rather than a tested tool. It uses the standard unicodedata module to print the line, column, code point, Unicode general category and name of every character in a file that falls into categories that are typically invisible or unusual: format characters (Cf), control characters (Cc), space and separator characters (Zs, Zl, Zp), private use characters (Co) and unassigned code points (Cn). It skips ordinary spaces, tabs and line endings.

import sys
import unicodedata

SUSPECT = {"Cf", "Cc", "Zs", "Zl", "Zp", "Co", "Cn"}

with open(sys.argv[1], encoding="utf-8") as f:
    for line_no, line in enumerate(f, start=1):
        for col, ch in enumerate(line, start=1):
            if ch in "\n\r\t ":
                continue
            cat = unicodedata.category(ch)
            if cat in SUSPECT:
                name = unicodedata.name(ch, "<no name>")
                print(f"{line_no}:{col} U+{ord(ch):04X} {cat} {name}")

Saved as, say, find_hidden.py, it would be run with the file name as its argument. Variation selectors belong to the nonspacing mark category (Mn), which also includes ordinary combining accents, so this script deliberately does not flag them; adding Mn would report every accent in text stored in decomposed form.

On systems where grep supports Perl-style patterns with the -P option and a UTF-8 locale is active, a quick search for some of the most common invisible characters looks like this:

grep -nP '[\x{00AD}\x{200B}-\x{200F}\x{202A}-\x{202E}\x{2060}-\x{2064}\x{2066}-\x{2069}\x{FEFF}]' file.txt

This prints the matching lines with their line numbers but does not say which character matched, so use it to locate problem lines and a checker or the script above to identify the exact character.

Deciding what to keep before you clean

Not every hidden character is a mistake, and removing all of them can damage the text you meant to fix.

  • Zero width joiner (U+200D) inside emoji: removing it splits a single emoji, such as a family or a profession emoji, into several separate ones.
  • Zero width non-joiner (U+200C) in Persian, Hindi and other scripts: it controls correct letter forms, and removing it can change how a word is spelled.
  • Variation selectors (U+FE0E, U+FE0F): they decide whether a symbol shows as text or as an emoji.
  • No-break spaces (U+00A0, U+202F): they are often intentional, for example to keep a number and its unit, or a title and a name, on the same line.
  • Direction marks (U+200E, U+200F): in text that mixes right-to-left and left-to-right scripts, they can be needed for correct display.
  • Byte order mark (U+FEFF) at the very start of a file: some programs expect it and others choke on it, so whether to keep it depends on what will read the file.

Characters that are usually safe to remove are zero-width spaces and soft hyphens that arrived through copy and paste, a byte order mark in the middle of text, and directional override or isolate controls in source code where no right-to-left text is intended.

Be careful with Unicode normalization as a cleanup shortcut. Compatibility normalization (NFKC or NFKD) converts some characters, such as the no-break space, into ordinary equivalents, but it also rewrites other characters, such as full-width letters and certain symbols, and it does not remove format characters like the zero-width space. It is a transformation with its own side effects, not a hidden character remover.

Verifying the result

A cleanup is confirmed when three things hold: a second pass through the checker shows only the hidden characters you chose to keep, the character count of the cleaned text matches what you expect, and the task that originally failed now works. If a comparison still fails after all invisible characters are gone, inspect every code point rather than only the hidden ones, since a look-alike visible character is the next most likely cause.