Unicode cleanup
How to Remove Zero-Width Characters From Text
Find and remove zero-width spaces and other invisible Unicode characters while protecting normal text, emoji and useful formatting.
Zero-width spaces, byte-order marks and directional controls can arrive through copied web text, PDFs, messaging apps or generated data. They may break search, validation, usernames and exact comparisons even though the text looks normal.
Why invisible characters appear
Zero-width spaces, byte-order marks and directional controls can arrive through copied web text, PDFs, messaging apps or generated data. They may break search, validation, usernames and exact comparisons even though the text looks normal.
Common invisible characters
| Character | Code point | Typical effect |
|---|---|---|
| Zero-width space | U+200B | Hidden word boundary |
| Zero-width non-joiner | U+200C | Changes script shaping |
| Zero-width joiner | U+200D | Joins emoji or letters |
| Byte-order mark | U+FEFF | May appear inside pasted text |
Clean without damaging meaning
Inspect the code points first when working with names, multilingual scripts or emoji. A zero-width joiner can be necessary for an emoji sequence or writing system, so use the preserve option when visual meaning matters.
Verify the cleaned result
Compare character counts, search for a known word and paste the result into the destination’s validator. Keep the original if the text is evidence, source code or data whose exact bytes may matter.
Diagnosing failed matches and identifiers
If two strings look identical but compare differently, inspect their lengths and code points. Unicode normalization combines equivalent forms; invisible-character removal targets hidden controls. They solve related but distinct problems.
Validate cleaned usernames, URLs and database keys against the destination. In multilingual prose, reread boundaries where a zero-width space may have separated words. Keep a reviewable copy rather than overwriting source evidence.
Quick answers
Frequently asked questions
Why can’t I delete the character manually?
The cursor may not reveal its position. A code-point viewer can expose and identify it.
Will removal change emoji?
It can if joiners are removed. Preserve emoji joiners when combined emoji must remain intact.
Is a nonbreaking space zero-width?
No. It occupies visible spacing but behaves differently from an ordinary space.
Can hidden characters be malicious?
They can be used to confuse display or validation, but many appear accidentally through ordinary copying.
Continue with a tool