Skip to content
RightYantra
Text & developer

Remove Line Breaks

Paste text that arrives in short broken lines — from a PDF, an old email, a terminal or a hard-wrapped document — and get it back as flowing paragraphs. Paragraph breaks are kept, doubled spaces disappear, and words split by a hyphen at the end of a line are put back together.

How to use it· 4 steps
  1. Paste the broken text, or open a text file.
  2. Leave Keep paragraph breaks on to preserve the blank lines between paragraphs.
  3. Choose what goes between joined lines — a space, nothing, a comma or your own separator.
  4. Copy the result, and open “How hyphens at line ends were handled” to check any rejoined words.
Remove Line BreaksRuns on your device

Step by step

How to use the remove line breaks

  1. 1Paste the broken text, or open a text file.
  2. 2Leave Keep paragraph breaks on to preserve the blank lines between paragraphs.
  3. 3Choose what goes between joined lines — a space, nothing, a comma or your own separator.
  4. 4Copy the result, and open “How hyphens at line ends were handled” to check any rejoined words.

Why pasted text arrives in pieces

A PDF does not contain paragraphs. It contains instructions to draw text at positions on a page, and when you copy from it the viewer has to guess the structure back. Most guess the simple way: every visual line becomes a line of text with a hard break at its end. Paste that into an email or a document and you get a column of short lines that refuses to reflow.

Email does the same thing for a different reason. Plain-text email has long been wrapped at around 72 to 78 characters — RFC 5322, the Internet Message Format, recommends no more than 78 — and a message that has been forwarded or quoted a few times arrives with breaks in the middle of sentences. Terminal output, text exported from older systems and some ebook conversions carry the same hard wraps.

Removing the breaks by hand is slow and error-prone, and replacing every line break with a space destroys the paragraph structure along with them. This tool tells the two kinds of break apart.

Paragraphs survive; lines are joined

A blank line between two blocks of text is treated as a paragraph break and kept — however many blank lines there are, the result has exactly one. Every other line break is replaced by a space, so each paragraph becomes one long line that your editor can wrap however it likes.

If the source has no blank lines between its paragraphs — common in text copied out of a PDF — the structure cannot be recovered from line breaks alone, and everything joins into one block. Insert a blank line where each paragraph should end before joining, or, if you still have the original file, convert it with the PDF to Word tool, which rebuilds paragraphs from the spacing on the page itself.

Untick Keep paragraph breaks and the whole text becomes a single line, which is what you want for a value pasted into a spreadsheet cell, a form field or a command.

Spaces at the ends of each line are always dropped before joining, so the joins never produce double spaces. Collapse repeated spaces also tidies runs of spaces and tabs inside lines, which are common in text extracted from justified PDFs.

Hyphenated words: the rule this tool follows

When a typesetter breaks a long word across lines, it adds a hyphen: infor- on one line, mation on the next. Pasted into a document that hyphen is wrong, and the word should be rejoined. But some words contain a real hyphen, and when “well-known” happens to break at its hyphen the result looks exactly the same: well- at the end of one line, known at the start of the next. Nothing can tell the two apart with certainty without a dictionary, so this tool follows a stated rule.

It rejoins the word — information — unless there is evidence that the hyphen is real. The hyphen is kept, and the gap closed, when the next line starts with a capital letter or a digit (Anglo-Saxon, COVID-19, pre-1990); when only a single letter comes before it (x-ray, e-mail — typesetting software does not leave one letter behind at a break); when the word is already hyphenated (state-of-the-art); or when the same hyphenated word appears whole on a line elsewhere in your text. That last check is what catches well-known in most real documents, where such words rarely appear only once.

A hyphen after a space, or a doubled hyphen, is read as a dash and the lines are joined with a normal space. Soft hyphens — the invisible U+00AD character some PDFs insert for exactly this purpose — are always removed. Every decision is listed under the result, so you can check the few words that matter, and if you would rather fix hyphens yourself, turn the option off.

Separators and line endings

Joining with a space is right for prose. Joining with nothing glues lines together exactly, which repairs long strings that were wrapped for display: a Base64 block from an email, a URL broken across two lines, a key printed in rows. Joining with a comma and a space turns a column of values copied from a spreadsheet into a single list, ready for an SQL IN clause, an email's To field or a sentence. Choose Something else for any other separator, such as a semicolon or a pipe.

Whatever goes in, the line endings come back the way they arrived: a file with Windows line endings (CRLF) keeps them, and if the text ended with a line break, so does the result.

Answers

Frequently asked questions

Will this remove my paragraph breaks?

Not unless you ask it to. Blank lines between paragraphs are kept by default; untick Keep paragraph breaks to join everything into one line.

How do I turn a column of values into a comma-separated list?

Paste the column, untick Keep paragraph breaks, and choose “A comma and a space” as the separator.

Why did a hyphenated word lose its hyphen?

It looked like a word broken by line wrapping. The hyphen is kept only when there is evidence it is real, and every rejoined word is listed so you can check it. Turn hyphen repair off to handle them by hand.

Why were some hyphens kept?

Because the word continued with a capital or a digit, had a single letter before the hyphen, was already hyphenated, or appears hyphenated elsewhere in your text.

Does it work with Windows line breaks?

Yes. It reads Windows (CRLF), Unix (LF) and old Mac (CR) line endings, and writes the result with the kind it received.

Is there a size limit?

No set limit. Long documents are processed in proportion to their length; very large files are limited only by your device's memory.

Is my text uploaded?

No. It is processed entirely in your browser.