Remove extra spaces and blank lines

Clean up repeated spaces, tabs and blank lines. Choose operations without accidentally merging every line into one paragraph.

Your inputs stay herePUFFINMINT

Set your data

Set your data

Paste text and select collapse repeated whitespace, trim each line or remove blank lines.

Result

The result updates as you type.

The values you enter stay on this page. Reloading or closing it clears them.

We count which tools are used most, without including entered values or file contents in the statistics. Privacy

How to use the tool

  1. Turn on “Show invisible characters” to see spaces, tabs and line breaks in the original and result. Copy and download contain the cleaned text without markers. Highlighted markers are distinct from symbols already present in the text.

Method and principles

Consecutive horizontal whitespace, including tabs and non-breaking spaces, becomes one normal space.

Newlines are handled separately.

Practical example

Two spaces between Hello and world become Hello world. Keep blank-line removal off to preserve paragraphs.

Input
  • Original text: A B
  • Collapse consecutive spaces and tabs: Yes
  • Trim each line: Yes
  • Remove blank lines: Yes
Result
A B

Options and limits

These operations can change indentation in code, poetry and tables. Review the output; original formatting is not reconstructed.

Example details

Example details
ParameterValue
Characters including whitespace3

Limits and checks

Limits and checks
ParameterValue
Original text≤ 100000 characters

Favorites