AAllMyToolsa pocketful of little tools
WS

Whitespace remover

Text & WritingNo. 82 / 84

Strip tabs, line breaks and repeated spaces from any text with separate switches for each, then copy the clean result in one click.

whitespace is invisible until it ruins the paragraph you just pasted.

work surface

Math, not advice — results are indicative.Read the disclaimer.

most-used utilities

Clean a pasted paragraph

Flatten the line breaks a PDF left mid-sentence and collapse the gaps in one pass.

Tidy CSV cells

Strip tabs and trim each row before dropping values into a spreadsheet.

Flatten an address

Turn a four-line mailing address into one line with single spaces.

pro tips

Copied from a PDF? Remove line breaks first, then collapse spaces. That order fixes mid-sentence breaks without gluing words together.

For code or poetry, leave line breaks alone and trim each line only. It removes trailing indentation without destroying the structure.

Check the result before pasting into a content editor. Some editors treat a double space as intentional formatting until you publish and find out otherwise.

what it does

Paste messy text and switch on the cleaning you need. The five options are independent: collapse runs of spaces, remove tabs, remove line breaks, trim each line, or trim the whole text. The result updates instantly in the box below, and your original stays untouched.

The usual suspects are copied PDFs, emails forwarded through three clients, spreadsheet cells with padded columns, and code snippets that arrived with a side of indentation. Turning line breaks into spaces is the fastest fix for a sentence shattered across six lines.

Take a pasted block with double spaces around a word, a pair of tabs before the next one, a blank line, then one more sentence. Switch on tabs, line breaks and repeated spaces and it all becomes a single tidy line. A 240-character block copied from a PDF typically loses around 30 characters and keeps every word.

The order is deliberate: tabs and line breaks become spaces first, then runs of spaces collapse, then the trims run. Regular spaces, tabs and Windows or Unix line endings are handled. Non-breaking spaces and other exotic characters may survive, which is often the exact invisible gremlin causing trouble.

quick answers

Does it delete every space?

No. Collapsing turns runs of two or more spaces into one, which is usually what you want. Switch that option off and every single, double and triple space stays exactly as it was.

Can I remove only line breaks?

Yes. Leave every other switch off and enable remove line breaks. Each break becomes a space so words do not run together, and blank lines disappear.

Does it change the original text?

No. The top box is yours to edit; the cleaned version appears in the read-only box below. Copy it out when it looks right, or keep tweaking the switches.