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.

Use this step

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 whitespaceSpaceU+0020PreserveTakes up visible width.
Special whitespaceNBSP and ideographic spaceU+00A0, U+3000PreserveCan be converted to a regular space or removed.
Zero-widthZero-width space (ZWSP)U+200BRemoveOften causes search and comparison failures.
JoiningZWNJ, ZWJ, Word JoinerU+200C, U+200D, U+2060PreserveRemoval may split emoji or alter letter shaping.
LayoutTab, LF, CR\t, \n, \rPreserveRemoval merges indentation, lines, and paragraphs.
ControlsNUL, ESC, backspace and C0/C1 controlsU+0000–U+001F, U+007F–U+009FRemove except Tab/LF/CRMay interfere with processing or terminals.
DirectionBiDi marks, overrides, and isolatesU+061C, U+200E–U+200F, U+202A–U+202E, U+2066–U+2069PreserveControls display order in mixed-direction text.
EncodingBOMU+FEFFRemoveA BOM embedded in text often breaks matching.
TypographySoft hyphenU+00ADPreserveMay become visible when a line wraps.
Glyph selectionVariation selectorsU+FE00–U+FE0F, U+E0100–U+E01EFPreserveSelects text, emoji, or other glyph variants.

Recommended use

Preview the result before copying it when enabling options that are off by default.

Example

Input

Hello​ world

Output

Hello world