Whitespace Cleaner
Remove trailing spaces, tabs and extra blank lines in one click.
What this tool does
Text picked up from web pages and PDFs is often full of stray spaces, tabs and blank lines. This tool scrubs that mess away so your text is clean, consistent and ready to use.
How to use this tool
- 1
Paste the text
Include the whole block, not just the part that looks wrong.
- 2
Choose what to clean
Trim trailing spaces, collapse blank lines, or turn tabs into four spaces.
- 3
Copy the result
Paste it back and check that intentional indentation survived.
When to use it
- You pasted text from a website and it has weird indentation and extra spaces.
- You want to trim trailing spaces from every line before committing code or copy.
- You need to collapse blank lines in a block of notes.
- You are preparing text for a system that is fussy about formatting.
How to understand this tool
The problems this fixes are invisible: a trailing space at the end of a line, a tab where a space was expected, three blank lines where one was meant. They matter because validators, diffs, CSV importers and code linters treat them as real characters. Turning tabs into spaces uses four spaces per tab, which is the common convention in code but not in every editor.
What it will not do
- It does not touch leading indentation unless you convert tabs, so deliberately indented code keeps its shape.
- It does not remove non-breaking spaces, which look like spaces and are a different character.
Questions people ask
Will it change my line breaks?
Only if you choose the option to remove blank lines; normal line breaks stay by default.
Is my text uploaded?
No. Cleaning happens in your browser and nothing is sent to a server.
One thing worth knowing
Paste with formatting stripped first if your source is a web page — most editors accept plain text with Ctrl+Shift+V.