Invisible Character Checker (find and remove zero width spaces, NBSP, BOM and control characters)

Completely free, with no extra charges. You may freely use the output commercially.

About this tool

This tool finds characters you cannot see on screen, and characters that look like an ordinary space but are something else, in text or code you have copied. It shows where each one is and what it is called, and removes them. It handles the zero width space (U+200B), the no-break space (NBSP, U+00A0), a BOM at the start of a file (U+FEFF), characters that change text direction (such as U+202E), control characters, text hidden in Unicode tag characters, and more.

Use it when something breaks and you cannot see why: Python reports SyntaxError: invalid non-printable character U+200B, an Excel VLOOKUP or comparison fails to match, or a JSON parser fails at the very first character. Zero width joiners that hold emoji together and the tag characters inside flag emoji are kept intact. All processing happens entirely in your browser (no data is sent).

Check text

Where the invisible characters are

Each character found is shown as a marker such as ZWSP. Hover over or focus a marker to see its code point and name. Characters that will be kept have a dashed outline.

Remove and clean up

Characters to remove or replace

How to use

  1. Paste text or code into “Text to check”, or choose a text file with “Load file”. “Insert example” fills in example text that contains invisible characters.
  2. The table lists each character found: its code (such as U+200B), its Unicode name, its type, how many there are, and the positions of the first 20. A position of “3:12” means line 3, character 12.
  3. Under “Where the invisible characters are”, check where each one sits, with markers in place of the characters.
  4. In “Remove and clean up”, choose which characters to process, then use “Copy result” or “Save as file”.

The example contains a BOM at the start, an NBSP before a price, a zero width space inside the word “Orange”, an RLO that reverses the display order, and an English sentence written in invisible tag characters. The zero width joiners in the family emoji 👨‍👩‍👧 and the tag characters in the England flag emoji are counted as found, but are marked “Keep” and are not removed with the default settings.

What problems these characters cause

  • Zero width space (U+200B): It has no width, so nothing shows on screen. If it is in code copied from a web page, chat or PDF, Python raises SyntaxError: invalid non-printable character U+200B, and in other languages it may become part of an identifier or cause a syntax error. It also makes two strings that look identical fail to match.
  • No-break space (NBSP, U+00A0): HTML’s   turns into this character when you copy text. It looks like an ordinary space but is a different character, so Excel’s TRIM function does not remove it (TRIM only removes ordinary spaces). As a result, VLOOKUP or MATCH fails to find a match, or a number is not recognized as a number. In Python code it causes invalid non-printable character U+00A0.
  • BOM (U+FEFF): A marker at the start of a UTF-8 file. Excel needs it to open a CSV without garbling non-ASCII text, but at the start of a shell script’s #! line, a JSON file or a PHP file it causes parse errors or stray output.
  • Direction control characters (such as U+202E): These exist to display Arabic and Hebrew correctly, but inside English text they reorder what you see. They have been used to disguise file extensions and in attacks that make source code look different from what it actually does (Trojan Source, CVE-2021-42574).
  • Control characters: NUL (U+0000), ESC (U+001B), and fragments of the color escape sequences that come along when you copy from logs or terminal output. XML 1.0 does not allow C0 control characters other than tab and line breaks, so they cause errors when generating or parsing XML.
  • Special line breaks (U+2028, U+2029): These can come in when copying from Word and similar programs. They look like line breaks, but many tools do not count them as such, and before ES2019 JavaScript treated them as a syntax error inside string literals.
  • Tag characters (U+E0000 range): They exist to encode flag emoji (such as 🏴󠁧󠁢󠁥󠁮󠁧󠁿) and display as nothing in most environments. Because each one maps to a single ASCII letter or digit, they can be used to embed invisible sentences, and they have been used to hide instructions in text fed to generative AI (prompt injection). This tool decodes tag characters that are not part of a flag emoji and shows them as ASCII text.

Characters detected and characters kept

The tool detects zero width characters (U+200B–200D, U+2060, U+FEFF in the middle of text, U+180E), special spaces (U+00A0, U+1680, U+2000–200A, U+202F, U+205F), the full-width space (U+3000), direction control characters (U+061C, U+200E/200F, U+202A–202E, U+2066–2069), control characters other than tab and line breaks (U+0000–001F, U+007F–009F), special line breaks (U+0085, U+2028/2029), other invisible formatting characters (soft hyphen U+00AD, U+034F, U+2061–2064, U+206A–206F, U+FFF9–FFFC and others), characters that look blank (Hangul filler, Braille blank U+2800), tag characters, variation selectors, and the replacement character (U+FFFD).

The full-width space (U+3000, also called the ideographic space) is the wide space that Japanese and Chinese input methods type. It is normal in Japanese and Chinese text, so the tool only counts it and leaves it unchanged by default. It often slips into code or SQL copied from East Asian documents, where it causes errors; in that case turn on “Full-width spaces to normal spaces”.

When “Keep what emoji and letter shaping need” is on, the following are not removed:

  • Zero width joiners (ZWJ) between emoji. 👨‍👩‍👧 and 🧑‍💻 are several emoji joined with ZWJ; removing it splits them into separate emoji.
  • ZWJ and ZWNJ between letters of Arabic, Persian, Indic scripts and similar. In these languages they are the correct way to control how letters connect.
  • Tag characters in a flag emoji that starts with 🏴 and ends with U+E007F.

Variation selectors are used for U+FE0F, which makes a character such as ❤️ display as an emoji, and for U+E0100 and above, which select a kanji variant such as “葛󠄀”. Removing them can change how text is displayed, so they are kept by default. A variation selector following a Latin letter may indicate that it is being used to embed hidden information.

Notes

Files are read as UTF-8. Files in other encodings such as Shift_JIS or Windows-1252 are not read correctly and show many U+FFFD characters. In that case, convert the file to UTF-8 with the Character Encoding Converter first. Saved files are UTF-8 without a BOM.

This tool only checks the type of each character. It does not detect different characters that look alike, such as “0” and “O”, or Latin “a” and Cyrillic “а”. To fix mixed full-width letters and digits use the Full-width / Half-width Converter, and to check character and byte counts use the Character Counter.