Text tool
Remove Extra Spaces and Line Breaks
Remove extra spaces and line breaks: collapse repeated spaces, trim each line, or join a block of text into one line without gluing words together. Free.
Your file never leaves your device.
Runs locally in your browser
Your text is not uploaded.
Simple steps
How it works
- 01
Paste the text you want to clean.
- 02
Choose how spaces and line breaks should be handled.
- 03
Copy the cleaned text from the output.
Four clean-up modes
Collapse repeated spaces turns runs of spaces and tabs into one space and keeps every line break. Trim each line does the same and also removes spaces at the start and end of every line. Join lines turns line breaks into single spaces, so a paragraph broken into short lines becomes one line. Collapse all whitespace turns every run of spaces, tabs and line breaks into one space.
When to use which
Text copied from a PDF often has a line break at the end of every printed line; Join lines makes it flow again, though paragraph breaks are joined too, so check where paragraphs should start. Text from emails and websites often has double spaces and indentation; Trim each line keeps the line structure while tidying it.
Code and poetry depend on their spacing, so clean them carefully or not at all.
Characters to watch
A non-breaking space looks like a normal space and often comes from web pages or word processors. Only Collapse all whitespace treats it as whitespace everywhere; the other modes tidy ordinary spaces and tabs, so use that mode if stubborn gaps remain.
Good to know
Frequently asked questions
Can I keep paragraph breaks?
Choose Collapse repeated spaces or Trim each line to keep line breaks.
How do I make one continuous line?
Choose Join lines or Collapse all whitespace to replace line breaks with spaces.
Does this remove tabs?
Repeated spaces mode cleans repeated spaces and tabs; all-whitespace modes also process line breaks.
Will words be joined together?
Line-joining modes insert a space between lines to keep neighboring words separate.
Is text processed locally?
Yes. Text cleanup runs in your browser without uploading your input.