Advertisement

Remove Zero-Width Spaces and Invisible Characters

Paste text that behaves strangely. Zero-width spaces (U+200B), byte-order marks, soft hyphens and bidirectional controls are deleted on the spot, and you see how many were found.

Clean text
Clean text appears here as you paste. No button needed.
Fine-tune what gets cleaned

Something went wrong loading the cleaner. Reload the page and try again.

🔒 100% private — everything runs on your device; nothing is uploaded or stored.Fixes formatting only; your wording isn't changed.
Advertisement

How it works

  1. PasteDrop in the text, code, CSV cell or password that “looks fine” but doesn’t work.
  2. Check the countThe chips show how many invisible characters were removed. Zero means they weren’t the problem.
  3. CopyUse the clean version. Visible text is untouched.

What is a zero-width space?

A zero-width space (U+200B) is a real character that takes up no visible width. It was designed to mark a place where a line may break, for example in Thai or in very long strings, without showing anything on screen. The problem is that it travels silently: copy text from a web page, a PDF, a rich-text editor or a chat window and it can come along for the ride.

It has several invisible relatives, and they cause the same kind of trouble:

Code pointNameTypical source
U+200BZero-width spaceWeb pages, CMS editors, chat apps
U+200C / U+200DZero-width non-joiner / joinerPersian, Indic scripts; emoji sequences
U+2060Word joinerTypesetting, copied PDFs
U+FEFFByte-order markFiles saved as “UTF-8 with BOM”
U+00ADSoft hyphenWord, hyphenated web text
U+200E / U+200FLeft/right-to-left marksMixed-direction text

Why they break things

  • Strings that look identical don’t match. admin and admin + U+200B are different values, so logins, lookups and de-duplication fail with no visible reason.
  • Spreadsheet imports go wrong. A VLOOKUP misses a row, a pivot table splits one customer into two, a number is treated as text.
  • Pasted secrets stop working. API keys, wallet addresses and passwords copied from a web page can carry one hidden character.
  • Code fails with “invalid character” on a line that looks perfectly normal, or a config key is silently not recognised.
  • Counts and search are wrong. Word counters, Ctrl+F and SEO tools disagree with what you see.

Remove them without this tool

Handy if you need to do it inside the tool you already use:

Excel / Google Sheets:  =SUBSTITUTE(A1, UNICHAR(8203), "")
Python:                 text.replace("\u200b", "")
JavaScript:             text.replace(/\u200B/g, "")

Be careful with the common shortcut of stripping the whole range U+200B–U+200D: it also deletes the joiner that holds emoji sequences together (a family emoji falls apart into separate people) and the non-joiner that Persian and several other scripts need inside words. VS Code highlights most invisible characters by default, which makes them easy to spot in code.

What this tool does and doesn’t touch

  • Removes: zero-width space, word joiner, byte-order mark, soft hyphen, directional marks and embeddings, invisible math operators, Unicode tag characters and stray control characters.
  • Keeps: emoji joiners inside emoji sequences, and the zero-width non-joiner when it sits between letters of non-Latin scripts.
  • Optional: the second preset also turns non-breaking and other odd spaces into regular spaces.
  • Everything runs locally. Nothing you paste is sent anywhere.

Want to see where the invisible characters are before deleting them? Use the Hidden Unicode Checker: it lists every one with line and column.

Advertisement

FAQ

How do I know if my text has a zero-width space?

Paste it into the Hidden Unicode Checker, which lists each hidden character with its line and column. Another clue: the removal count on this page is above zero, or two strings that look identical compare as different.

Does ChatGPT add hidden characters to its text?

Sometimes text copied out of chat interfaces picks up non-breaking spaces or other invisible characters, depending on the app and the copy method. It isn’t a reliable signal of anything, and removing them does not make AI text undetectable.

Is it safe to remove them from code?

Almost always yes: invisible characters in source files are nearly always accidents, and compilers don’t need them. The one exception is a deliberate BOM at the start of a file that a legacy tool expects, which is rare.

Will it change how my text looks?

No. Removing invisible characters doesn’t change visible text. The optional “odd spaces” preset converts non-breaking spaces to regular ones, so a line may wrap slightly differently.

Is my text uploaded?

No. The cleaning runs with JavaScript in your browser. Nothing is sent or stored.

More tools