Whitespace Remover

Tidy messy text: trim lines, collapse double spaces, drop blank lines — or strip every last bit of whitespace.

How it works

Trimming removes invisible spaces and tabs from the start and end of every line without touching the words themselves. Collapsing turns any run of spaces or tabs into a single space, fixing double-spaced typing and ragged indentation. Removing empty lines drops rows that contain nothing but whitespace, compacting pasted lists and logs. The nuclear option strips every whitespace character everywhere — useful for minifying or joining tokens. Pick any combination; the result updates as you type.

How to use

  1. Paste your messy text into the input box.
  2. Tick "Trim each line" to strip spaces and tabs from the start and end of every line.
  3. Tick "Collapse multiple spaces" to turn any run of spaces or tabs into a single space.
  4. Tick "Remove empty lines" to drop blank rows — or "Remove ALL whitespace" to strip every space, tab, and newline (this overrides the other options).

Frequently asked questions

What is the difference between trimming and collapsing?

Trimming cleans the edges of each line without touching the words; collapsing fixes the interior, turning double-spaced typing and ragged indentation into single spaces. Most messy pastes benefit from both.

What does "Remove ALL whitespace" do?

It strips every space, tab, and line break, so "Hello world" becomes "Helloworld". It overrides the other three options, so use it only when you truly want zero whitespace — for example, compacting a token or key.

What counts as an empty line?

Any line containing nothing but spaces or tabs. The remover drops those rows entirely, closing up the gaps in lists copied from documents with stray blank lines.

When is this useful?

Cleaning text pasted from PDFs, spreadsheets, or web pages — the classic sources of mystery spacing, trailing tabs, and stray blank lines that break formatting downstream.

Will it change the words themselves?

No. Trimming and collapsing only touch whitespace — letters, punctuation, and numbers are never altered. Only "Remove ALL whitespace" changes word shapes, by deleting the spaces between words entirely, so the other modes are always text-safe.