The zero-width space is exactly what its name says: a space with no width. It renders as nothing, takes up no room on the line, and is completely undetectable by eye. Unicode calls it U+200B ZERO WIDTH SPACE, and it exists for a good reason that has nothing to do with any of the trouble it causes.
hello
the string in memoryhelZWSPlo
What it is actually for
Some scripts do not put visible spaces between words. Thai, Khmer, Lao and Myanmar run words together, and text engines need a hint about where a line may wrap. The zero-width space is that hint: an invisible marker that says "you may break here" without displaying anything. In those languages it is not junk; it is load-bearing punctuation.
The same character also gets used as a soft wrap point in long technical strings, letting a URL or a serial number break across lines in an email without inserting a visible hyphen.
Why it ruins your day everywhere else
In English and most European text, a zero-width space serves no purpose, and because it is invisible, it produces the most confusing class of bug there is: everything looks right and nothing works.
- Search stops matching.
hellowith a ZWSP in the middle does not match a search forhello. Ctrl+F fails on text you are looking directly at. - Deduplication fails. Two spreadsheet rows look identical; one has an invisible passenger, so your dedupe pass keeps both.
- Validation lies. A username field that "looks empty" isn't. A 10-character code counts as 11. Password fields are especially cruel here.
- Code breaks. A ZWSP pasted into an identifier is a syntax error that looks exactly like working code. Reviewers approve it because there is literally nothing to see.
- Diffs go red. Version control flags a line as changed when no visible character differs.
How it gets into your text
You never type it. It arrives by copy-paste: from websites that insert zero-width characters as an anti-scraping measure or as a per-reader fingerprint, from chat apps and AI tools with their own formatting layers, from PDFs, and from CMS editors. Once it is in a document, it propagates: every copy of the text carries it forward. That is why the clipboard is the right place to stop it; it is the one checkpoint every paste passes through.
How to find and remove it
To confirm one is there, paste the text into an editor or inspector that renders invisibles; we walk through five free methods in How to see hidden characters in any text.
To remove it once, any decent editor's find-and-replace accepts in regex mode:
find:
replace: (nothing)
To never deal with it again, clean at the clipboard. CopyClean strips zero-width spaces from every copy automatically, with one important nuance: it preserves them for the languages that genuinely need them (and it never touches the zero-width joiners that hold emoji together). Invisible junk should die; invisible meaning should live. The difference between those two is the whole job.