schwapps.
← All toolsText / 21

Whitespace cleaner

Trim each line and reduce repeated spaces without removing line breaks.

Loading the tool… JavaScript is required for processing on your device. The instructions and examples below are available without JavaScript.

How to use it

Paste text to trim every line and reduce repeated spaces.

Good to know

Blank lines and the original line-break style are preserved.

Tidy pasted text without flattening it

This tool trims the beginning and end of every line and changes runs of spaces or tabs within a line to one space. For example:

Input

  Ada   Lovelace

  wrote  notes.  

Result

Ada Lovelace

wrote notes.

What it deliberately preserves

Line breaks, including blank lines and their original line-break style, remain in place. It does not normalize punctuation, convert case, remove duplicate lines, or change the order of the text.

Do not use it on code, preformatted tables, or prose where repeated spaces and tabs are meaningful. The page accepts up to 100,000 characters.