Find invisible Unicode characters without breaking text
Diagnose zero-width spaces, no-break spaces, joiners and presentation selectors. Identify the exact character before deciding whether to replace it.
ON THIS PAGE
Identify the gap before removing it
When a copied word will not match a search, or a line refuses to wrap, an invisible character may explain it. That does not make every invisible character an error. Some keep a number with its unit, help a writing system join correctly, or form an emoji. Inspect the sequence first and decide using the document’s language and purpose.
invoice-number | 12 kg | 👩💻Keep the original
Make a local copy before changing imported text. Copying only the visible portion may omit the character you are investigating.
Inspect
Paste the sample into Unicode Inspector. The Invisible / spacing count includes ordinary spaces as well as formatting controls; it is not an error score.
Read the marker
Select the relevant grapheme or scan the code-point table. Read the U+ value and Unicode name, rather than judging the width of the rendered gap.
Compare deliberately
If you edit a local copy, compare it with the original. Confirm the exact changed character and test the destination again.
Similar-looking gaps have different roles
| Character | Typical reason it is present | Decision to make |
|---|---|---|
| U+0020 SPACE | Ordinary separation | Keep ordinary word spacing unless the format requires otherwise. |
| U+00A0 NO-BREAK SPACE | Keeps adjacent text together at a wrap point | Replace only if normal wrapping is wanted. |
| U+200B ZERO WIDTH SPACE | Adds a break opportunity without a normal visible gap | Check whether it belongs in that language or copied identifier. |
| U+200C ZERO WIDTH NON-JOINER | Controls joining behavior | Do not remove from language text without reviewing the result. |
| U+200D ZERO WIDTH JOINER | Controls joining; can connect an emoji sequence | Removing it may change the displayed sequence. |
| U+FE0F VARIATION SELECTOR-16 | Requests emoji presentation in supported sequences | Preserve it when that presentation was intended. |
| U+FEFF | May come from a file signature or legacy text | Check its position and the original file encoding first. |
Why trim may leave the problem
JavaScript trim operates on a defined set at the ends of a string. It does not remove every character with no visible ink and does not clean the middle of a word. For example, U+200B between invoice and -number survives trimming. Treat a failed trim as a clue to inspect the actual value, rather than repeatedly applying broader replacements.
Preserve meaningful sequences
In the sample, ZWJ is part of 👩💻. Removing it separates the woman and laptop code points instead of preserving the original emoji sequence. In 12 NBSP kg, replacing NBSP with SPACE changes line-break behavior. Those are different editorial decisions even if both characters appeared in an invisible-character report.
GlyphIndex marks characters using pinned Unicode categories and default-ignorable data. The marker is explanatory text in the results, not a character inserted into your input. A blank-looking glyph outside those categories may require manual code-point inspection. This is not a malware scan, a complete bidirectional-text audit or a guarantee that a username is safe.
The tool processes up to 10,000 UTF-16 units locally. It does not offer automatic strip-all. Keep an untouched original, especially when handling multilingual text, identifiers, or a document where exact text is part of the record.
Sources and method
- Unicode Standard Annex #14: Unicode Line Breaking Algorithm — Line endings and spacing controls.
- Unicode Technical Standard #51: Unicode Emoji — Joiners and presentation selectors in emoji sequences.
- MDN: String.prototype.trim() — Trimming removes defined whitespace at the ends of a string.
- Unicode FAQ: UTF-8, UTF-16, UTF-32 and BOM — Encoding units, well-formed text and byte order marks.