Whitespace Remover for Text, Tabs and Empty Lines
Trim, collapse, or strip extra spaces, tabs, and blank lines from any text.
About Whitespace Remover
Whitespace Remover tidies the spacing in pasted text. It has four checkboxes: Trim each line and Collapse repeated spaces, both ticked by default, plus Remove blank lines and Remove all whitespace. Click Clean and the tidied text appears in the second box, ready for the Copy button. The text in the top box is never changed.
Text copied from PDFs, emails, chat messages or web pages often arrives with stray indents, double spaces and empty lines. People use this tool to tidy an assignment or report before submitting it, to prepare a list pasted from a spreadsheet, to clean up OCR output from scanned notes, or to strip padding from a value before pasting it into a form.
Remove all whitespace stands apart from the other three: when ticked it overrides them and deletes every space, tab and line break, joining the text into one string. Collapse repeated spaces handles only ordinary spaces and tabs, not non-breaking spaces, and Remove blank lines deletes every empty line rather than leaving one between paragraphs.
How to use Whitespace Remover
- Paste the messy text into the top box.
- Pick your options. Keep Trim each line and Collapse repeated spaces ticked for general cleanup, and tick Remove blank lines to delete empty lines.
- Tick Remove all whitespace only if you want no spaces, tabs or line breaks at all; it takes priority over the other three options.
- Click Clean.
- Check the result in the bottom box, then click Copy and paste it where you need it.
- To try other settings, change the checkboxes and click Clean again; the output box is rewritten only when you do.
Tips for best results
- Remove all whitespace suits values pasted with gaps, such as phone or account numbers. It strips spaces, tabs, line breaks and non-breaking spaces, but leaves zero-width characters like the joiner some Urdu and Persian spellings rely on.
- Collapse repeated spaces turns every run of spaces or tabs into one space, so a lone tab also becomes a space. Non-breaking spaces from web pages and Word files stay as they are.
- With Trim each line off and Collapse repeated spaces on, an indent shrinks to one space instead of disappearing. Keep both ticked to remove indentation completely.
- Think before ticking Remove blank lines when paragraph breaks matter: it deletes every empty line, including those with only spaces, and there is no way to keep a single one.
- None of the line-based options joins lines together. To turn several lines into one, use Find & Replace with Regex ticked, \n in Find and a single space in Replace with.
Frequently asked questions
What's the difference between the options?
Trim removes leading/trailing spaces per line, collapse reduces repeated spaces to one, and remove blank lines deletes empty lines entirely.
Can I combine multiple options?
Yes, you can tick several options before cleaning and they work together, with one exception: Remove all whitespace overrides the others.
Does Remove all whitespace also delete line breaks?
Yes. Every space, tab and line break goes, so multi-line text comes out as one unbroken string.
Why are some double spaces still there after cleaning?
They are probably non-breaking or other special spaces, which Collapse repeated spaces ignores. In Find & Replace, tick Regex, put \u00a0 in Find and a normal space in Replace with, then run Clean again.
Does it remove the empty line at the end of my text?
Not unless Remove blank lines is ticked. A final line break leaves an empty last line, which Trim each line does not delete.
What happens if no box is ticked?
The text is copied to the output unchanged.