Text Tools

Remove extra whitespace from text

Strip Whitespace cleans up spacing in pasted text in three ways, chosen with "Mode". "Collapse to single spaces" (the default) turns every run of spaces, tabs and line breaks into one space and trims the ends, so padded or multiline text becomes one clean line. "Trim each line" removes leading and trailing spaces from every line and keeps the line breaks. "Remove all whitespace" deletes every space, tab and line break. Letters and punctuation are never touched.

How to use Strip Whitespace

  1. Open Strip Whitespace in the Toolbox101 app.
  2. Paste text with double spaces, tabs or stray line breaks into the Input box.
  3. Pick Mode: collapse to single spaces, trim each line, or remove all whitespace.
  4. Read the cleaned text in the Output box. In the default mode newlines between words become one space. Click Copy to take it.

Worked example

Strip Whitespace returns the output below for this input.

Input

Hello    world
this    is    indented

Output

Hello world this is indented

Check it yourself: open Strip Whitespace and enter the same input.

Frequently asked questions

Does it also remove line breaks between paragraphs?

In the default Collapse to single spaces mode, yes: any whitespace run, including a newline, becomes one space, so multi-paragraph text turns into one line. Pick Trim each line to keep the line breaks and only strip the padding on each line.

Can it join words with no space at all?

Yes: Remove all whitespace deletes every space, tab and line break, so a b\tc becomes abc. Use it for things like cleaning a pasted key or card number, not for prose, since words run together.

How is this different from the Remove Empty Lines tool?

Remove Empty Lines deletes only the lines that are entirely blank and leaves every other line, its indentation and the line structure alone. Strip Whitespace changes the spacing inside lines and, in its default mode, joins everything into a single line.

Use Strip Whitespace now

Runs in your browser. Nothing you type is uploaded.