Remove Line Breaks and Extra Spaces
Join lines broken by a PDF or email and collapse double spaces.
The remove line breaks and extra spaces
Paste text copied from a PDF, an email or a Word document. Collapse extra spaces, on by default, turns runs of spaces and tabs into one space and trims every line. Join lines removes the hard line breaks inside sentences: Keep paragraphs leaves one blank line between paragraphs, while Join everything puts the whole text on one line. A summary counts what was removed.
About removing line breaks and extra spaces
The WordBench line break remover tidies the whitespace that copying and pasting leave behind. It joins lines that were broken at the edge of a PDF column or an email window back into sentences, collapses doubled spaces and tabs into one space, and trims stray spaces from the start and end of every line, without touching a single word.
Join lines has three settings. Off leaves every line break where it is. Keep paragraphs joins the lines inside each paragraph and keeps one blank line between paragraphs, which is what you want for text pasted from a PDF or an email. Join everything turns every line break into a space, so the whole text ends up on one line, ready for a form field or a spreadsheet cell.
Collapse extra spaces works on its own or together with Join lines. It turns any run of two or more spaces or tabs into one space, removes spaces at the start and end of each line, and reduces several blank lines in a row to a single blank line. A line under the result says what changed, for example Removed 12 line breaks and 7 extra spaces. Your choices are kept in the page link; your text never is.
How do you remove line breaks from text copied from a PDF?
Text copied out of a PDF usually arrives with a hard line break wherever a line ended on the page, so every sentence is broken in several places, and sometimes with doubled spaces as well. Paste the text here, set Join lines to Keep paragraphs and leave Collapse extra spaces ticked. Each paragraph comes back as one flowing block, with a blank line between paragraphs.
Each line break, together with any spaces or tabs around it, becomes a single space, so words never run together. A line holding only spaces counts as blank, so it still separates two paragraphs. A word that the PDF hyphenated across two lines keeps its hyphen; fix those by hand or with find and replace.
Who uses it
Worked example
Paste two short paragraphs about a new Acme Robotics product, copied from a PDF and broken across seven lines, with a few doubled spaces along the way.
With Join lines set to Keep paragraphs, the four lines of the first paragraph join into one block and the three lines of the second into another, with a blank line between them. Collapse extra spaces turns every doubled space into one, and the line under the result reports how many line breaks and spaces were removed.
Switch to Join everything and both paragraphs end up on a single line, which is the shape a form field or a spreadsheet cell expects.
Frequently asked questions
How do I remove extra spaces and line breaks from a Word document? Copy the text out of the Word document, paste it here, and choose what to clean: Collapse extra spaces for doubled spaces and tabs, and Join lines for hard line breaks, with Keep paragraphs if the paragraphs should stay apart. Then copy the result back into Word. It works in any browser, free and with nothing to install, and the text is never uploaded. What comes back is plain text, so bold, italics and headings need applying again.
How do I remove extra spaces and line breaks from a Word document?
Copy the text out of the Word document, paste it here, and choose what to clean: Collapse extra spaces for doubled spaces and tabs, and Join lines for hard line breaks, with Keep paragraphs if the paragraphs should stay apart. Then copy the result back into Word. It works in any browser, free and with nothing to install, and the text is never uploaded. What comes back is plain text, so bold, italics and headings need applying again.
How do I remove double line breaks?
Tick Collapse extra spaces: several blank lines in a row become a single blank line, so paragraphs stay separate without the extra gaps. To remove the blank lines altogether, set Join lines to Join everything, which puts all the text on one line, or use the remove empty lines tool, which deletes blank lines and keeps every other line break.
What is the difference between Keep paragraphs and Join everything?
Keep paragraphs joins only the lines inside each paragraph and keeps one blank line between paragraphs, so the structure of the text survives. Join everything turns every line break into a space, blank lines included, so the whole text ends up on one line.
What does Collapse extra spaces remove?
Any run of two or more spaces or tabs becomes one space, spaces and tabs at the start and end of each line are removed, and three or more line breaks in a row are reduced to one blank line. A single space between words is never touched, and neither are letters, digits or punctuation.
What do the numbers under the result count?
Line breaks is how many fewer line breaks the result has than your text. Extra spaces is how many spaces and tabs were taken out; the spaces that replace joined line breaks are new, so they are not counted against it. When nothing needed cleaning the line says so.
Does it change any of the actual words?
No. Only spaces, tabs and line breaks are affected. Letters, numbers and punctuation are left exactly as they are, including a hyphen at the end of a line.
Exactly what this tool counts, and why the result can differ from your word processor, is written out on the methodology page. Platform character limits, with the unit each one counts in and the date it was checked, are on the character limits pages.