Don's Tools · Text & Writing · Remove Extra Spaces

Remove extra spaces

Tidy up messy spacing, indentation and blank lines, right in your browser. Nothing is uploaded.

Private by design: your text is cleaned in your browser and is never uploaded. The options apply together, so you can tidy spacing, indentation and blank lines in one pass.
Remove Extra Spaces is a free tool that tidies messy spacing entirely in your browser, with nothing uploaded. Collapse runs of spaces into one, trim spaces at the ends of lines, remove leading indentation, turn tabs into spaces, collapse or remove blank lines, and optionally join everything into a single line, then copy or download the cleaned text.

Frequently asked questions

Is my text uploaded anywhere?

No. The text is cleaned entirely in your browser and is never sent to a server.

What does Collapse multiple spaces do?

It turns any run of two or more spaces into a single space, which fixes text that has uneven gaps between words.

How is Collapse blank lines different from Remove all blank lines?

Collapse blank lines reduces several empty lines in a row to a single empty line, keeping paragraph breaks. Remove all blank lines deletes every empty line so the text has no gaps.

Can it remove indentation?

Yes. Turn on Remove leading spaces to strip spaces and tabs from the start of every line.

What does Join into one line do?

It removes all line breaks so the whole text becomes a single line, which is handy for pasting into a single field.

Is there a size limit?

No fixed limit, though very large text is handled in your browser and may be slower on an older device.