Special Character Checker: How to Find Invisible and Hidden Unicode Characters in Text

Learn what a special character checker does, how to detect invisible Unicode characters like zero-width spaces, and how to clean text safely.

Text can look perfectly normal and still contain characters you cannot see: zero-width spaces, non-breaking spaces, byte order marks, directional controls or letters from another alphabet that look identical to Latin ones. These hidden characters break searches, cause form validation to fail, make code compile with mysterious errors and produce duplicate entries that look the same. A special character checker makes them visible so you can decide what to keep, replace or remove.

What a special character checker does for your text

A special character checker, sometimes called a special character detector or text character identifier, takes plain text as input and reports every character that is not ordinary visible text. Instead of showing you the rendered result, it shows what is actually stored: each character's Unicode code point (a unique number written as U+ followed by hexadecimal digits, such as U+200B), often its official Unicode name, and its position in the text.

The output is typically one of two things: a marked-up view of your text in which hidden characters appear as visible symbols or labels, or a list of flagged characters with their code points. Some tools also offer a cleaning step that removes or replaces selected characters. Inspection alone never changes your text; only the cleaning step does, and that is where unintended changes can happen.

Note on scope: this guide explains the general method and the Unicode characters involved. It does not test or compare specific checker products, so it makes no claims about the accuracy, limits or features of any particular tool.

Characters a checker should reveal

The table below lists common invisible or easily confused characters. Code points and names come from the Unicode standard; the UTF-8 bytes are what you would see in a hex view of a UTF-8 file.

Character | Code point | UTF-8 bytes | Typical source or effect
Zero-width space | U+200B | E2 80 8B | Copied from web pages or chat apps; splits words invisibly and breaks exact-match searches
Zero-width non-joiner | U+200C | E2 80 8C | Required in some scripts such as Persian; otherwise invisible noise
Zero-width joiner | U+200D | E2 80 8D | Joins emoji into combined sequences; meaningful inside emoji
Word joiner | U+2060 | E2 81 A0 | Prevents line breaks; invisible
Byte order mark / zero-width no-break space | U+FEFF | EF BB BF | Added at the start of files by some editors; can break scripts, CSV headers and config files
No-break space | U+00A0 | C2 A0 | Looks like a normal space but does not match it in searches or comparisons
Soft hyphen | U+00AD | C2 AD | Invisible unless a line breaks at that point
Left-to-right mark / right-to-left mark | U+200E / U+200F | E2 80 8E / E2 80 8F | Controls text direction; invisible
Right-to-left override | U+202E | E2 80 AE | Reverses the display order of following text; can disguise file names or code
Cyrillic small a | U+0430 | D0 B0 | Looks like Latin a (U+0061); causes lookalike words and failed matches

Some code editors show a notice along the lines of "this document contains many invisible unicode characters" when a file includes a large number of characters like those above. That notice tells you hidden characters exist; a checker tells you which ones and where.

How to detect invisible and special characters step by step

  • 1. Copy the exact text you want to check. Copy from the original source rather than retyping it, because retyping removes the very characters you are looking for.
  • 2. Paste it into a checker or run one of the offline methods below. Keep the original unchanged in a separate copy.
  • 3. Review every flagged character: note its code point, its name and where it sits in the text.
  • 4. Decide for each character whether it is meaningful or accidental (see the next section).
  • 5. Remove or replace only the accidental characters.
  • 6. Run the check again on the cleaned text and confirm that only the characters you intended to keep remain.

Example of what you are looking for. The two strings below look identical when rendered, but the second contains a zero-width space, shown here explicitly as [U+200B]:

invoice2026
invoice[U+200B]2026

A search for invoice2026 will not find the second string, and a database will treat them as different values. A lookalike example works the same way: in p[U+0430]ypal the second letter is Cyrillic, so the word looks familiar but does not match the Latin spelling.

Checking text offline

If the text is confidential, consider inspecting it locally instead of pasting it into a website you do not control. The snippets below are illustrative examples; they have not been run against your data, and exact behavior depends on your system, locale and tool versions.

Example: a short Python script that lists every non-ASCII or non-printable character with its position, code point, Unicode category and name.

import unicodedata

text = open("input.txt", encoding="utf-8").read()

for i, ch in enumerate(text):
    if ch in "\n\t":
        continue
    if not ch.isascii() or not ch.isprintable():
        name = unicodedata.name(ch, "<unnamed>")
        print(i, f"U+{ord(ch):04X}", unicodedata.category(ch), name)

In the category column, Cf means a format character (zero-width characters, directional marks and the byte order mark fall here) and Zs means a space separator (the no-break space falls here). These two categories cover most invisible characters worth reviewing.

Example: finding lines that contain common invisible characters with GNU grep. This requires a grep build with Perl-compatible regex support (the -P option) and a UTF-8 locale.

grep -nP '[\x{00A0}\x{00AD}\x{200B}-\x{200F}\x{202A}-\x{202E}\x{2060}\x{FEFF}]' input.txt

Example: viewing the raw bytes of a file so you can match them against the UTF-8 column in the table above.

xxd input.txt | head

Deciding what to keep before you clean

Not every special character is a mistake. Removing everything a detector flags can change meaning, so check the context first:

  • Zero-width joiner inside emoji: removing it splits a combined emoji (for example, a family or profession emoji) into separate pictures.
  • Zero-width non-joiner in Persian and some Indic scripts: it controls how letters connect, so removing it changes how words are spelled and displayed.
  • Directional marks in Arabic or Hebrew text mixed with numbers or Latin words: they keep punctuation and numbers in the right visual order.
  • No-break spaces in typeset text: they may be deliberate, such as keeping a number and its unit on the same line. Replace them with ordinary spaces only if the text is going into data fields, code or searches.
  • Non-Latin letters: a Cyrillic or Greek letter is correct in Russian or Greek text and suspicious only in a word that should be entirely Latin.

Characters that are almost always safe to remove in data, code, URLs, usernames and identifiers include stray zero-width spaces, word joiners, soft hyphens and a byte order mark that is not required by the program reading the file. A right-to-left override in source code or a file name deserves particular attention, because it can make text display in a different order from how it is actually stored.

Removing versus normalizing

Some cleanup tools offer Unicode normalization (forms named NFC, NFD, NFKC and NFKD) as an alternative to deleting characters. Normalization is a different operation: it converts equivalent ways of encoding the same character into one consistent form. NFC is generally the conservative choice. The compatibility forms, NFKC and NFKD, go further and can change visible content, for example turning a superscript 2 into a regular 2 or a ligature such as fi into the letters f and i. Normalization also does not remove zero-width spaces or convert lookalike Cyrillic letters into Latin ones, so it does not replace a character check.

Verifying the result

After cleaning, run the same check again on the output. The result is correct when the only flagged characters left are the ones you chose to keep. For extra confirmation, compare the original and cleaned text with a diff tool or compare their lengths: if you removed three zero-width spaces, the cleaned text should be exactly three characters shorter. Finally, test the text where the problem appeared, such as rerunning the search, resubmitting the form or recompiling the code.