Remove invisible characters
Remove zero-width, control, and other invisible Unicode characters
“Invisible characters” is an umbrella term for whitespace, control, and formatting characters rather than one Unicode category. The defaults remove common copy-and-match troublemakers, while potentially destructive options remain opt-in.
Characters covered
“Invisible characters” is an umbrella term for whitespace, control, and formatting characters. Some affect spacing, line breaking, text direction, glyph joining, emoji, or string comparison even though they have no standalone visible glyph.
| Category | Characters | Code / notation | Default | Notes |
|---|---|---|---|---|
| Regular whitespace | Space | U+0020 | Preserve | Takes up visible width. |
| Special whitespace | NBSP and ideographic space | U+00A0, U+3000 | Preserve | Can be converted to a regular space or removed. |
| Zero-width | Zero-width space (ZWSP) | U+200B | Remove | Often causes search and comparison failures. |
| Joining | ZWNJ, ZWJ, Word Joiner | U+200C, U+200D, U+2060 | Preserve | Removal may split emoji or alter letter shaping. |
| Layout | Tab, LF, CR | \t, \n, \r | Preserve | Removal merges indentation, lines, and paragraphs. |
| Controls | NUL, ESC, backspace and C0/C1 controls | U+0000–U+001F, U+007F–U+009F | Remove except Tab/LF/CR | May interfere with processing or terminals. |
| Direction | BiDi marks, overrides, and isolates | U+061C, U+200E–U+200F, U+202A–U+202E, U+2066–U+2069 | Preserve | Controls display order in mixed-direction text. |
| Encoding | BOM | U+FEFF | Remove | A BOM embedded in text often breaks matching. |
| Typography | Soft hyphen | U+00AD | Preserve | May become visible when a line wraps. |
| Glyph selection | Variation selectors | U+FE00–U+FE0F, U+E0100–U+E01EF | Preserve | Selects text, emoji, or other glyph variants. |
Recommended use
- Use the defaults to clean unexpected characters pasted from web pages, PDFs, or AI responses.
- When string matching fails, also inspect special whitespace and bidirectional controls.
- Keep ZWJ, ZWNJ, and variation selectors when the content contains emoji or complex writing systems.
- Use the dedicated whitespace or line-break steps when that is the only cleanup needed.
Preview the result before copying it when enabling options that are off by default.
Example
Input
Hello world
Output
Hello world