OnlineTextLab
Esc

Remove Line Breaks Online

Fix text that arrives with a break at the end of every line, while keeping the paragraphs you meant to keep.

What to do with line breaks

Runs on your device. Your files and text are not uploaded.

About Remove Line Breaks

Copy a paragraph out of a PDF or an old email and it pastes as a stack of short lines. Each line ends where the original page ended, so the text will not reflow in your document, your form or your slide. Fixing it by hand means deleting a break from each line, and on a long passage that takes a while.

Paste the text here and the cleaned version appears beside it as you type. The default keeps real paragraph gaps and removes only the breaks inside them, which is what you want for most copied text. Words that were split across two lines with a hyphen are put back together too.

How it works

All the different line ending characters (Windows, old Mac, Unicode line separators, form feeds) are converted to one kind first. In Keep paragraphs, a blank line marks the start of a new paragraph, and every single break inside a paragraph is replaced. Remove all flattens everything into one block. One sentence per line flattens first, then starts a new line after a period, question mark or exclamation mark when the next word begins with a capital letter or a digit.

Hyphen repair is deliberately cautious. A hyphen at the end of a line is removed only when there is a lowercase letter on both sides of the break, so la- followed by zy becomes lazy. When the next line starts with a capital, as in a place name pair, the hyphen stays. Spaces at the start and end of each line are always trimmed, and runs of spaces collapse to one unless you turn that off.

How to use Remove Line Breaks

  1. Paste into Text with unwanted breaks, or press Try an example.
  2. Under What to do with line breaks, choose Keep paragraphs, Remove all or One sentence per line.
  3. Adjust the options if needed: Rejoin words split by a hyphen, Collapse repeated spaces and Replace each break with.
  4. Press Copy, or use Download, to take the cleaned text.

A real run with the default settings

Input
The quick brown
fox jumps over a la-
zy dog.

Second paragraph
ends here.
Output
The quick brown fox jumps over a lazy dog.

Second paragraph ends here.

The gap between paragraphs survives, and the split word is whole again. Remove all on the same input gives one line, and One sentence per line puts each of the two sentences on its own line.

When it helps

  • Pasting a passage from a PDF into a Word document or a slide without broken lines
  • Cleaning up quoted text from an old email, where each line was wrapped at a fixed width
  • Getting a poem or address block onto one line, with a comma between the parts
  • Preparing text for a translator or a review, with each sentence on its own line

Tips for a better result

  • If the pasted text has no blank lines between paragraphs, Keep paragraphs has nothing to go on and gives you one block. Add blank lines where you want the splits, then run it again.
  • Use Replace each break with set to a comma and space to turn a list of lines into one comma-separated line.
  • Set it to Nothing for text where breaks fall inside long codes or numbers, such as a wrapped key copied from an email.

Good to know

  • It cannot tell a heading from body text. A heading with no blank line after it merges into the next paragraph.
  • When a line ends in a hyphen and the next starts with a capital, the hyphen stays and the joiner still goes in, so Paris- and London come out as Paris- London. Fix those by hand.
  • A compound word that truly had a hyphen and split right there, such as co- and op, loses it and becomes coop. Rules alone cannot know which you meant.
  • Sentence splitting relies on punctuation and capitals, so abbreviations such as Dr. Smith get split in the wrong place.
  • Tables and multiple columns copied from a PDF arrive mixed together. That is a problem with the copy, and it cannot be fixed afterward.

Questions people ask

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

PDF files store text as positioned lines, not as flowing paragraphs. When you copy, each line usually arrives with its own break. Pulling text with PDF to Text has the same cause, and this page is the next step for fixing it.

How do I keep my paragraphs separate?

Use Keep paragraphs, the default. It treats a blank line as a real paragraph gap and joins everything else. If your text has no blank lines, there is no signal to work from, so add them first.

What does Collapse repeated spaces do?

It turns runs of two or more spaces or tabs into a single space, which removes the gaps left by justified text. Turn it off if the spacing matters, such as in a code sample.

Can I put something other than a space between lines?

Yes. Replace each break with offers a space, nothing, a comma and a space, or a pipe character.

What to use next

Last reviewed . Read our editorial policy.