← All posts
BasicsAug 20, 2026

How to remove zero-width spaces from pasted text

A zero-width space is a Unicode character with no visible glyph. It sits inside a word, takes up a position in the string, and renders as nothing. The fastest way to remove it is to paste your text into the cleaner on this site and copy the clean version back. Invisible characters are stripped automatically, while every visible word stays exactly as it was.

What a zero-width space does to your text

The character is U+200B ZERO WIDTH SPACE. A word like helloworld with a U+200B in the middle is eleven characters long, not ten. Search for the plain ten-character word and the match fails, because the two strings differ by one character you cannot see. Word count, spell-check, double-click word selection and exact-match imports fail for the same reason. They read the string, not the picture your screen draws of it.

Zero-width space is the most common offender, but it travels with company. U+200C and U+200D add zero-width joiner behavior, U+FEFF leaves byte-order marks at the start of files, and U+2060 glues words together where a normal space was expected. Non-breaking space (U+00A0) causes a related failure: it looks like a space but compares as a different character. Any of these can ride along in a single copy-paste from a chat tool, a web page or a PDF export.

Where they come from

Chat tools, web pages, word processors and PDF exports all insert invisible bookkeeping characters for their own layout needs. Copying the rendered text carries those characters along as if they were part of the content. There is no way to tell by looking whether a pasted paragraph is clean, because the whole problem is that the characters are invisible. If text started life anywhere other than a plain-text editor, assume it needs one cleaning pass before anything exact happens to it.

How to remove them

Paste your text into the cleaner at the top of the homepage. The scan runs in your browser and highlights every invisible character in place, with its code point and a running count. Copy the clean version, or download it as a file for longer documents. Code blocks wrapped in backticks pass through byte-identical, so snippets survive untouched. The same engine powers the command line tool for whole files, with identical results.

What is deliberately kept

A blanket strip of everything invisible would damage real text. The same U+200D that is junk between two Latin letters is mandatory between two Devanagari consonants, where it changes the rendered ligature. Emoji sequences depend on joiners too, and one variation selector decides whether a character renders as emoji at all. The cleaner looks at the characters on either side before deciding, and keeps joiners where they carry meaning. For the full reasoning, read why your search box cannot find a word you can clearly see.

When to run this pass

Run it before text goes anywhere a machine must match it exactly. That means code editors, spreadsheets, CSV imports, CMS slugs, JSON payloads and anything you plan to diff or search. One paste through the cleaner takes seconds and turns an invisible mismatch into a string that is exactly what it appears to be.