Remove Line Breaks

Remove the line breaks that ruin text copied out of a PDF, an email or a terminal. The default mode joins hard-wrapped lines into flowing paragraphs while keeping genuine paragraph breaks, so the result reads properly.

Your files never leave this device

Reflow your text Live · Three modes

Mode

Keep paragraphs joins wrapped lines but leaves blank-line breaks alone.

Tidying

How to remove line breaks

  1. Paste the badly wrapped text into the box above.
  2. Leave the mode on Keep paragraphs for anything you intend to read.
  3. Switch to Remove every break when you need one continuous line.
  4. Leave tidying on so the joins do not leave double spaces behind.
  5. Copy the reflowed text, or download it as a file.

What each mode does

  • Keep paragraphs: joins wrapped lines but preserves blank-line paragraph breaks.
  • Remove every break: produces one continuous line, for CSV fields and single-line inputs.
  • Remove blank lines only: closes up spacing while keeping every line separate.
  • Automatic collapsing of the double spaces that joining creates.
  • Correction of stray spaces left before commas and full stops.
  • A count of how many line breaks were removed.

Where broken text comes from

Copy a paragraph out of a PDF and paste it anywhere else and you get something like a poem: every line ends after eight or nine words, in the middle of a sentence, for no reason connected to the meaning. The same happens with text from plain-text emails, terminal output, and anything that was formatted for a fixed column width.

The cause is that these formats store text as it appears on the page rather than as it flows. A PDF has no concept of a paragraph. It has characters at coordinates, and a "line" ends because the layout ran out of width. Older email clients hard-wrapped at 72 or 78 characters for the same reason. Copy that text into a word processor, which wraps automatically, and you get both sets of breaks fighting each other.

Why the default mode is the right one

Naively removing every line break destroys the structure along with the problem: paragraphs merge into one enormous block, headings run into the text below them, and lists become sentences.

Keep-paragraphs mode distinguishes the two kinds of break. A single line break inside a block of text is treated as wrapping and joined. A blank line, two breaks in a row, is treated as a genuine paragraph separator and preserved. That heuristic matches how almost every writing tool represents paragraphs, and it handles the overwhelming majority of pasted text correctly.

When to use the other two modes

  • Remove every break: pasting into a CSV cell, a single-line form field, a JSON string, or anywhere a newline would break the format.
  • Remove blank lines only: closing up double-spaced text while keeping each line separate, which suits lists and code.

The tidying option matters more than it looks

Joining two lines can leave two spaces where there was a space at the end of one line and the start of the next. Text from PDFs also frequently carries a stray space before a comma or full stop, because the extractor read them as separate positioned elements.

Leaving tidying on collapses runs of spaces to one and pulls punctuation back against the preceding word. The result reads as properly typeset text rather than as something obviously reassembled. Turn it off only if the spacing is meaningful, such as in aligned code or ASCII tables.

What it cannot fix

Some text loses information that no reflowing can recover. Words hyphenated across a line break in the original arrive as "hyphen-" and "ated"; joining gives "hyphen- ated" and there is no reliable way to tell that apart from a genuine hyphenated compound. Multi-column PDFs sometimes interleave columns during extraction, and no amount of reflowing will unpick that.

If the text came from a PDF, extracting with the line-break option turned off in the PDF to text tool avoids the problem at source. For other formatting debris, smart quotes, invisible characters, stray tabs, the text cleaner is the better tool, and everything here runs locally with no upload.

Frequently asked questions

Will it merge all my paragraphs into one block?

Not in the default mode. A single line break is treated as wrapping and joined; a blank line is treated as a paragraph break and kept. Only Remove every break merges everything.

Why does text from PDFs break so badly?

A PDF stores characters at positions on a page rather than as flowing paragraphs, so a line ends where the layout ran out of width. Extraction reproduces those breaks literally.

What does the tidying option do?

It collapses the double spaces that joining creates and pulls stray spaces back from before commas and full stops, which is a common artefact of PDF extraction.

Can it fix words hyphenated across a line break?

No. There is no reliable way to distinguish a hyphen inserted by the layout from a genuine hyphenated compound, so those need fixing by hand.

Is my text uploaded?

No. All processing happens in your browser, so extracted documents and drafts never leave your device.