Zero-Width Character Detector
Detect and remove invisible Unicode characters — zero-width spaces, joiners, BOM, and more.
Why do zero-width characters appear in text?
Zero-width Unicode characters are used legitimately for text rendering — joining or separating scripts, controlling line breaks, or marking byte order. They are invisible but can cause issues in code, databases, and search matching. They are sometimes used maliciously to watermark documents or bypass content filters. Common offenders include the Zero Width Space (U+200B), Zero Width Joiner (U+200D), and the Byte Order Mark (U+FEFF). This tool scans your text character-by-character, highlights every invisible character, and produces a clean version with all of them stripped. Nothing leaves your browser.
Built and maintained by Meet Shah · Last updated
What this tool is used for
- Finding the invisible character that is breaking an exact-match comparison.
- Cleaning text pasted from a source that inserted zero-width joiners.
- Auditing user input for hidden characters before storing it.
- Diagnosing a string whose length disagrees with what you can see.
- Removing a byte-order mark that is making the first character illegal.
Frequently Asked Questions
- Which characters are invisible?
- Zero-width space (U+200B), non-joiner (U+200C), joiner (U+200D), word joiner (U+2060), the byte-order mark used as a ZWNBSP (U+FEFF), and soft hyphen (U+00AD). All render as nothing and none are matched by a plain space check.
- Why do they cause bugs that look impossible?
- Because two visually identical strings compare unequal. A password, API key or config value with a pasted zero-width character fails validation while looking perfectly correct — and no amount of staring at it reveals why.
- Can they be used to hide information?
- Yes. Zero-width steganography encodes bits as a sequence of these characters and survives copy-paste, which is why it has been used to watermark documents and trace leaks back to a specific recipient.
- Are they ever legitimate?
- Often. ZWNJ prevents unwanted ligatures in Persian and Arabic, ZWJ forms emoji sequences and Indic conjuncts, and ZWSP marks a permitted break point in a long unspaced string. Blind removal breaks real text.
- How should I strip them safely?
- Target the specific code points rather than the whole Cf category, and never strip from text in scripts that need them. For credential and identifier fields, stripping all of them on input is the right defensive default.
- How does a zero-width character end up in code?
- Usually by copy-paste — from a web page, a chat client, or a PDF. The result is a syntax error pointing at a line that looks correct, or worse, two identifiers that render identically and are not equal.
- Can they be used to fingerprint a document?
- Yes, and this is a real technique — encoding an identifier as a pattern of zero-width characters marks a copy invisibly. It survives copy-paste, which is precisely what makes it effective and worth detecting.
Common errors and gotchas
- Removing zero-width joiners from emoji sequences or Indic scripts, where they are required.
- Assuming a clean-looking string is clean, which is exactly what these characters defeat.
- Stripping a soft hyphen that was there deliberately for hyphenation.
- Treating detection as sanitisation, when the characters may be legitimate in some scripts.
- Removing the characters without recording that they were there, which loses the diagnosis.