Developer tools

Whitespace Visualizer & Cleaner

Whitespace Visualizer and Hidden Character Remover

Reveal tabs, NBSP, zero-width characters and mixed line endings, then clean them.

About this tool

About Whitespace Visualizer & Cleaner

When a string comparison fails for no visible reason, a YAML file refuses to parse or a password copied from an email does not work, the culprit is usually a character you cannot see. Paste the text here and the Revealed view marks every one of them: dots for spaces, arrows for tabs, labelled badges for no-break and narrow no-break spaces, thin and other Unicode spaces, zero width spaces and joiners, byte order marks, soft hyphens and the bidirectional controls used in Trojan Source attacks. Each line ending is shown as LF, CRLF or CR, and the tool warns when a file mixes them or when lines carry trailing spaces or mixed tab and space indentation. Choose what to fix, such as removing invisible characters, turning NBSP into normal spaces, trimming line ends, converting tabs with a 2, 4 or 8 column width or normalising line endings, then check the Cleaned view and copy or download the result. Emoji joiners are kept so emoji stay intact, and everything runs locally.

Built and maintained by Abhi JainUpdated

How to Find and Remove Hidden Whitespace

  1. 1

    Paste or open text

    Paste text into the Text box, open a file, or click Sample to see common problems.

  2. 2

    Review what was found

    The Revealed view marks each hidden character, and the summary under it counts them by type with any line-ending warnings.

  3. 3

    Choose the fixes

    Tick options such as Remove zero-width & BOM, NBSP → space and Trim line ends, and pick Line endings and Tabs.

  4. 4

    Copy the cleaned text

    Switch to Cleaned to check the result, then use Copy cleaned or download it.

Whitespace Visualizer & Cleaner: questions and answers

What is a zero width space and why is it a problem?

U+200B is a character with no width that marks a possible line break. It is invisible, so text that contains it looks identical to text that does not, yet string comparisons, searches, URLs and code identifiers break. It often arrives through copy-paste from web pages, chat apps and PDFs.

How do I convert CRLF to LF?

Paste the text, set Line endings to LF (Unix, macOS) and copy the cleaned output. CRLF is the Windows convention (carriage return plus line feed), LF is used by Linux, macOS and most Git repositories.

What is a non-breaking space?

U+00A0 looks like a normal space but stops a line break between two words. Word processors and web pages insert it, and code or spreadsheets then fail to match it against a normal space. The NBSP → space option replaces it and other Unicode spaces with U+0020.

What are bidirectional control characters?

Characters such as U+202E (right-to-left override) change the display order of text. In source code they can make code look different from how it runs, an attack known as Trojan Source. Remove them unless your text really needs right-to-left formatting.

Will removing zero width joiners break emoji?

No. Joiners between two emoji, as in family or profession emoji, are kept. Only stray joiners in ordinary text are removed.