Whitespace Cleaner

Normalize spacing, blank lines, and invisible Unicode characters.

Tool options

Enter text to get started.

How to use Whitespace Cleaner

  1. Paste or type your input. You can also load the example below.
  2. Adjust the available options. Results update after you finish typing; for very large inputs, select Run.
  3. Review the result, then copy it or download it to your device.

How this tool works

Line endings become LF. Trimming line starts and collapsing repeated spaces can remove code indentation. Disable those options when alignment matters.

Input and output stay in the current page. Refreshing or closing the page clears them. For very large inputs, use Run to start processing; a task that takes too long is stopped so you can change the input.

Frequently asked questions

Can I remove invisible characters and non-breaking spaces?

Yes. Remove invisible characters removes supported zero-width and formatting characters. Normalize Unicode spaces converts supported spaces, including non-breaking spaces, to ordinary spaces.

How can I avoid damaging code indentation?

Disable Collapse repeated spaces and Trim line starts when leading alignment matters. Keep Convert tabs to spaces off to retain tabs. Disable Trim line ends if trailing whitespace is significant.