Line break and space cleanup
Remove line breaks and extra spaces from copied text with this tool. Text copied from PDFs or web pages often has extra spaces at line ends and repeated blank lines. This tool trims spaces at the start and end of each line, reduces repeated blank lines to one, and removes blank lines at the very start and end.
Spaces between words are left unchanged.
Turn on "Remove line breaks and join into one line" to get a single line, with one space where each line break was.
How to use
- Paste the text you want to clean into the input box.
- The cleaned text appears in the output box.
- Copy the output for use.
How it works
The tool trims spaces and tabs at the start and end of each line. Repeated blank lines become one, and blank lines at the very start and end of the text are removed. Spaces between words stay as they are, and different line break styles (Windows, Mac, Linux) are handled the same way.
With the join option on, it trims each line, discards blank lines, and joins the remaining lines with a single space to make one line.
Example
A line " Hello " followed by three blank lines and " World " becomes "Hello", one blank line, and "World". With the join option on, "line one", "line two", a blank line, and "line three" become "line one line two line three".
Good to know
- By default one blank line is kept to separate paragraphs. Use the join option to remove every line break.
- The join option puts one space between the old lines. Check the result if the text had words split across lines.
- It works well for text copied from PDFs and web pages.
Frequently asked questions
Are spaces between words removed?
No. Only spaces at the start and end of each line are removed.
Can I remove all blank lines and line breaks?
Yes. Turn on "Remove line breaks and join into one line" to get a single line. Without it, one blank line is kept to separate paragraphs.
Is my text saved?
No. Everything is processed in your browser.
Last updated: 2026-10-22