Skip to content
ToolsNow
Guides All tools
Text

Remove extra spaces, tabs and blank lines

Clean up messy spacing: collapse repeated spaces, trim the ends of every line, remove blank lines and normalise the invisible non-breaking spaces that break search and layout.

Runs in your browser — your input is not uploaded to ToolsNow.

Input
0 chars0 words0 lines
Result
0 chars0 words0 lines

How to use

  1. Paste your text. Often something pasted out of a spreadsheet, CMS or web page.
  2. Choose what to clean. The common defaults are on already: trim each line, collapse repeated spaces, collapse runs of blank lines.
  3. Copy the result. The tool reports how many characters of whitespace it removed.

Questions

What is a non-breaking space and why does it matter?

It is an invisible character (U+00A0) that looks identical to a normal space but is not treated as one. It gets pasted in from web pages and Word, and it silently breaks search, sorting and code. This tool converts them to ordinary spaces.

What is the difference between collapsing and removing blank lines?

Collapsing reduces any run of blank lines to a single one, preserving paragraph breaks. Removing deletes them all, producing a solid block of lines.

Will it break code indentation?

Yes, if you collapse repeated spaces or trim lines — both destroy leading indentation. For code, use only the "Tabs → 2 spaces" option and leave the rest off.

What does "remove all whitespace" do?

Strips every space, tab and line break, joining everything into one unbroken string. It is useful for cleaning a copied hash, key or serial number.

Examples and checks

Use this for prose or lists copied from a PDF, spreadsheet or web page. Start with the least destructive options and compare the result before replacing your original.

Clean a line

Input or situation
red apple
Result
red apple

With Trim each line and Collapse repeated spaces enabled, the ends are trimmed and the three internal spaces become one.

Keep paragraph boundaries

Input or situation
First paragraph Second paragraph
Result
First paragraph Second paragraph

Collapse blank lines keeps one empty line between paragraphs. Remove blank lines removes that separator completely.

Before you use the result

Published by ToolsNow. How tools and sources are checked · Report a problem

Related tools