Zero-Width Space Generator

Insert, detect, and remove zero-width Unicode characters in text. Useful for invisible watermarking and debugging. Free.

Preparing private browser tool…

Your file will stay on this device.

What zero-width characters are and why they exist

Zero-width characters are real Unicode code points that occupy no horizontal space when rendered. They are not a trick or a bug: each was added to solve a specific typesetting problem, and several are essential to writing systems that hundreds of millions of people use daily.

U+200B, the zero width space, marks a permitted line break inside a long unbroken run of characters, such as a URL, without adding a visible gap. U+200C, the zero width non-joiner, prevents two adjacent letters from forming a ligature or a cursive join, which is grammatically required in Persian and in several Indic scripts. U+200D, the zero width joiner, does the opposite and forces a join; it is also the glue between the components of composite emoji, so the family and profession emoji are sequences of ordinary emoji separated by ZWJ.

U+FEFF began life as the byte order mark at the start of a file and doubles as a zero width no-break space. This tool labels it ZWSP in its interface. When it appears in the middle of text it is almost always an artefact of a file that was concatenated or re-encoded rather than an intentional character.

What this tool detects, and what it does not

The detector searches for exactly four code points: U+200B, U+200C, U+200D and U+FEFF. It reports how many of each it found, marks their positions in an annotated copy of your text, and the remove mode deletes those same four. That is a useful set, because they are the ones that turn up most often in copied text, but it is deliberately narrow.

It will not flag several other invisible or confusable characters. Among them are U+2060 word joiner, U+00AD soft hyphen, U+180E Mongolian vowel separator, the bidirectional control characters U+202A through U+202E, the variation selectors U+FE00 to U+FE0F, and the Unicode tag characters in the U+E0000 block that have been used to smuggle hidden text into messages. Non-breaking space U+00A0 is also untouched, since it is visible as a space but behaves differently from one.

So a clean result from this tool means no zero-width characters from that set of four, not that the text is free of invisible characters. If you are investigating a text you actively suspect of carrying hidden content, inspect it with a hex dump or a script that enumerates every code point rather than relying on a targeted detector.

Removing them safely, and when not to

Stripping ZWJ and ZWNJ destroys correct text. Removing ZWNJ from Persian or Hindi can change the meaning of a word, and removing ZWJ from an emoji sequence splits a single glyph into its parts, so a family emoji becomes several separate people. Before running remove mode over text in a script you do not read, check what it actually contains in detect mode first.

ZWS and a stray U+FEFF are usually safe to remove, and are often worth removing. They commonly arrive from pasting out of a word processor, a design tool or a website, and they break equality comparisons, defeat search, and can cause a form value or a database key to mismatch in a way that is invisible in every log and every screenshot. The classic symptom is a string that looks identical to another and still fails to match.

The removal count shown is in UTF-16 code units, which is exact for these four characters since each is a single unit. Note that the surrounding text is left untouched, so this is not a general text sanitiser: it will not normalise Unicode forms, collapse whitespace or strip bidirectional controls.

Invisible watermarking and its limits

The watermark action inserts a zero width space between every character of your text. The visible result is unchanged while the byte sequence is entirely different, which makes it possible to tell two copies of the same document apart. The general technique, encoding a hidden identifier as a pattern of invisible characters, is sometimes used to trace which recipient leaked a document.

It is a weak mechanism and should be understood as such. The marks survive a plain copy and paste but are destroyed by retyping, by screenshotting, by most Markdown and HTML sanitisers, by conversion to PDF text layers in many pipelines, and by anyone who runs the text through a remover such as this one. Anybody who suspects a watermark can strip it in seconds.

There is also an ethical and legal dimension. Marking text so that a specific person can be identified later is a form of covert tracking, and in some jurisdictions and workplaces it carries notification obligations. Detection matters more than insertion for most people: if you are pasting text from an unknown source into code, a commit message or a configuration file, checking for invisible characters first is a sensible habit.

Frequently asked questions

Which characters does the detector actually look for?
Four: U+200B zero width space, U+200C zero width non-joiner, U+200D zero width joiner, and U+FEFF. It does not flag word joiner, soft hyphen, variation selectors, bidirectional controls or Unicode tag characters, so a clean result is not proof that text contains no invisible characters at all.
Is it safe to remove all zero-width characters from any text?
No. ZWNJ and ZWJ carry meaning in Persian, Arabic and Indic scripts, and ZWJ binds the parts of composite emoji. Removing them can change words and split emoji into separate glyphs. Run detect mode first and check what the text actually contains before stripping.
Why does my string comparison fail when the text looks identical?
An invisible character is almost always the cause. A trailing U+FEFF or an embedded U+200B makes two visually identical strings different byte sequences, which breaks equality checks, lookups and search while showing nothing in a log or a screenshot. Paste both values into detect mode to find it.
Can zero-width watermarks be detected and removed?
Yes, trivially. Any tool that lists or strips these code points removes the marking, and retyping, screenshotting or running the text through a sanitiser destroys it as well. Treat it as a light deterrent, never as a reliable tracing mechanism.
Where do stray zero-width characters usually come from?
Copying out of word processors, design tools, PDFs and websites, and from files that have been concatenated or re-encoded, which is where a mid-text U+FEFF typically originates. They also appear in text that has passed through systems that use them for line-breaking hints.
Does this tool send my text anywhere?
No. Insertion, detection and removal all run in the page on your device, and nothing is transmitted or stored.