Remove Line Breaks

Remove unwanted line breaks and extra spaces from text copied from PDFs, emails and documents. Keep paragraphs or join everything. Free and private.

You copy a paragraph from a PDF, paste it into an email, and it’s chopped into short lines that stop mid-sentence. Or you receive text full of double spaces and stray breaks from a scanned document. Fixing it by hand is slow. This tool rebuilds clean text in a click.

How to use it

Paste your text into the first box. The cleaned version appears below. Pick what line breaks should become:

A space (keep blank-line paragraphs) is the setting you’ll want most of the time. Single line breaks, the ones that cut sentences in half, become spaces so lines run together. Blank lines between paragraphs are preserved, so your paragraphs stay separate.

A space (join everything) turns all line breaks, including blank lines, into spaces and gives you one long paragraph.

Nothing removes line breaks entirely without putting a space in their place. Use it for text such as codes or long strings that were wrapped across lines and should be glued back together, but be careful with ordinary prose, since words on either side would run together.

The extra options

Trim spaces around lines removes leading and trailing spaces from each line. Indented lines and lines with a trailing space are a common side effect of copying from documents.

Collapse repeated spaces replaces runs of two or more spaces or tabs with one. It’s the quickest way to clean up justified text that was padded with extra spaces.

Delete blank lines first removes every empty line before the joining happens. Combined with “join everything” it flattens text completely; combined with “keep paragraphs”, it removes the paragraph breaks too, so use it deliberately.

Where messy line breaks come from

PDFs. The biggest culprit. PDFs hold lines of text positioned on a page, so copying produces a break at the end of every visual line. Hyphenated words that were split across lines remain hyphenated, so you may need to fix those by hand or with find and replace: search for a hyphen followed by a space and replace with nothing.

Emails. Older email clients wrap lines at a fixed width, often 72 characters, and forwarded messages gain extra line-leading symbols.

Code and logs. Wrapped output from a terminal often needs unwrapping before you paste it into a document.

Scanned documents. Optical character recognition tends to add breaks and double spaces wherever the scan was uneven.

Poetry and lyrics are the reverse: line breaks are meaningful, so don’t run them through this tool unless you want a single paragraph.

A few workflow ideas

Clean first, count after. Run the text through this tool, then check it with the word counter, because stray breaks and spaces can skew line and paragraph counts. If you need each sentence on its own line afterwards, find and replace with a regular expression can insert a break after each full stop. For turning a tidy paragraph into a list, find a separator such as a semicolon and replace it with \n in regex mode.

If your goal is the opposite, preparing a list as one comma-separated line, use add text to each line with the join option on.

For a full explanation with examples, read our guide on cleaning up text copied from a PDF.

Limits

The tool can’t know which line breaks were meant. A heading on its own line, a bulleted list or an address block may be merged with the text around it, because to the tool they look like ordinary line breaks. If your document has structure like that, clean one section at a time, or use the keep-paragraphs option and fix the few remaining spots by hand.

The opposite job, and tidying afterwards

If a paragraph now runs too long for the place you are pasting it into, the text wrapper breaks it back into lines of a set width without cutting words. The usual follow-ups after joining lines are remove extra spaces for double spaces and remove empty lines for stacks of blanks. To turn one long line into a list instead, the text splitter cuts at commas, tabs or sentence ends.

Frequently asked questions

Why does text copied from a PDF have so many line breaks?

A PDF stores text as lines positioned on a page, not as flowing paragraphs. When you copy, each visual line becomes a line break. Removing single line breaks and keeping blank lines rebuilds the paragraphs.

How do I keep the paragraphs?

Leave the first option on A space (keep blank-line paragraphs). Single line breaks become spaces, but a blank line between paragraphs is kept.

What is the difference between a line break and a carriage return?

They are old typewriter terms. Windows ends lines with a carriage return plus a line feed, while Mac and Linux use only a line feed. This tool treats all of them as line breaks.

Can it also remove double spaces?

Yes. Tick Collapse repeated spaces and runs of spaces or tabs become a single space.