Skip to content
Server-sideDeleted in 30 minutes

Remove Line Breaks From Text

Text copied out of a PDF, a terminal, or an old email arrives chopped at the original layout's line width — hard returns mid-sentence, words split with hyphens at the margin. This tool undoes the layout: lines flow back into paragraphs, hyphenated fragments become whole words again, and the blank lines that mark real paragraph boundaries are kept. Nothing you paste is stored — it is reflowed and discarded per request.

Use this without the search next time. Prathom Workbench puts Prathom's tools in your toolbar.

Add to Chrome — free
Input
Result

What it does

  • Reflows hard-wrapped lines into paragraphs
  • Rejoins words hyphenated across line ends by PDF layout
  • Keeps or discards paragraph boundaries, your choice
  • Join with a space, a comma, or nothing at all

How to use Remove Line Breaks

  1. 1

    Paste the broken text

    Straight from the PDF viewer, terminal, or email client. Carriage returns, bare line feeds, and mixed conventions are all understood.

  2. 2

    Choose what survives

    "Paragraph breaks" treats blank lines as real boundaries and only merges the wrapped lines inside each block. "One block" flattens absolutely everything into a single run of text.

  3. 3

    Pick the joiner

    A space suits English prose. "Nothing" is for languages written without spaces, where inserting one per break would corrupt the text. A comma turns a vertical list into an inline one.

  4. 4

    Check hyphenated words

    With the PDF option on, fragments like "quar-" at a line end are glued back to their continuation. Skim the result for compound words that legitimately owned their hyphen.

How it works

All three newline conventions are first normalized to one. If hyphen repair is on, the tool then looks for the specific fingerprint of a typesetter's split — a letter, a hyphen, a line break, a letter — and welds the two fragments back into one word, discarding both the hyphen and the break. Doing this before anything else matters: once lines are joined with spaces, the fingerprint is destroyed and "quar- ters" can no longer be told apart from two real words.

Then comes the reflow. In paragraph mode the text splits at blank lines into blocks; within each block every line is trimmed and the lines are joined with your chosen separator. Blocks are reassembled with exactly one blank line between them, which also normalizes sources that used three or four. In one-block mode the entire text is treated as a single block.

The break counter compares line breaks in against line breaks out, so it reports the number actually removed rather than the number of lines touched.

Why the hyphen call is a judgment

There is no marker distinguishing a hyphen a layout engine added from one the author wrote. The tool bets on the layout engine, because in text copied from PDFs that is overwhelmingly the right answer — authors write compounds mid-line far more often than layouts break at them. The bet loses only when a line happens to end exactly at an authored hyphen, which is why the feature is a visible checkbox rather than silent behavior: you can see the bet being made and turn it off for hyphen-dense text.

When you'd use this

Rescuing a quotation from a paper PDF before pasting it into your own document. Fixing an email that arrived hard-wrapped at 72 characters. Preparing OCR output for a translation tool that treats every line break as a sentence end. Turning a column of values from a spreadsheet into a comma-separated line. Any moment where text remembers the shape of the box it used to live in.

Paragraph mode needs blank lines to work with

The two modes differ in one assumption, and knowing which your source satisfies saves a lot of confusion.

Paragraph mode splits on blank lines. It is the right choice for text that already marks its paragraphs that way — most emails, most plain-text exports, anything that has been through a text editor. Each block is reflowed on its own and the structure survives.

The awkward source is text with no blank lines at all, which is what a great many PDF extractions produce. Every line ends in a break and paragraphs are indicated by indentation, or by nothing whatever. Paragraph mode sees one block and joins the entire document into a single line — technically correct and not what anyone wanted.

There is no reliable way to detect paragraphs in that text. An indent might be a new paragraph or a quotation; a short line might end a paragraph or be the last line of one that happened to fit. Guessing produces a result that is right most of the time and wrong invisibly, which is worse than being obviously wrong.

The practical approach is to add blank lines where the paragraphs actually belong — one pass through the text, faster than it sounds — and then reflow. Alternatively use one-block mode deliberately for a single quotation, where there is only one paragraph anyway.

Check the joins on justified text

Text taken from a justified column carries one more artifact that reflowing exposes rather than fixes.

Justification works by stretching the spaces on each line so both margins line up. When that text is extracted, the stretched spacing sometimes comes through as several literal spaces, and the reflow preserves them — so a joined paragraph ends up with double and triple gaps scattered through it at what used to be line ends.

The break counter will not show this, because no line breaks are involved. The result reads correctly and looks wrong, which usually gets noticed only after it has been pasted somewhere.

Running the output through the whitespace remover collapses those runs to single spaces and finishes the job. For text from a two-column academic PDF it is worth doing as a matter of course — that layout produces both problems at once, and the hyphen repair here handles only the first of them.

Examples

A sentence chopped by PDF layout

The proposal covers three quar- ters of the fiscal year and in- cludes a revised budget.
The proposal covers three quarters of the fiscal year and includes a revised budget. Breaks removed: 2

Both breaks here carried a typesetter's hyphen, so the fix rejoins "quarters" and "includes" and removes the hyphens along with the breaks. A plain join would have produced "quar- ters" — worse than the input, because now the fragments look like words.

Paragraphs kept, wrapping removed

Dear Ms Rao, Thank you for the quick turnaround on the draft. Best regards, Anil
Dear Ms Rao, Thank you for the quick turnaround on the draft. Best regards, Anil

The blank lines survive as paragraph boundaries while the wrapped sentence heals. Note the sign-off: "Best regards," and "Anil" sat on adjacent lines with no blank line between them, so they merged too — the tool cannot tell a signature from a wrapped sentence. Insert a blank line between lines you want kept apart.

Frequently asked questions

How does it tell a real paragraph from a wrapped line?

By the blank line, and only by the blank line. A single break is assumed to be layout — the consequence of some earlier container's width — while an empty line between blocks is assumed to be authorial. That heuristic matches how PDFs and emails actually break text, but it has a known blind spot: addresses, signatures, and poetry use single breaks meaningfully, and those will merge unless you separate them.

Will rejoining hyphens ever remove a hyphen that belonged there?

Occasionally, yes. If a justified layout happened to break exactly at the hyphen of a compound like "well-known", the tool sees letter, hyphen, break, letter — the same signature as a typesetter's split — and produces "wellknown". This is rare because layout engines prefer breaking at existing hyphens without adding ambiguity, but it is why the option can be turned off and the result deserves a skim.

When would I join lines with nothing instead of a space?

For languages that do not separate words with spaces — Japanese and Chinese above all. A PDF of Japanese text wraps lines mid-word by design, and joining those fragments with spaces would insert separators the writing system never uses. Joining with nothing restores the original unbroken flow of characters exactly.

What does the comma joiner actually produce?

Each line becomes an item in an inline list: a column of names turns into "Anita, Bhavesh, Carlos" on one line. It is a small feature that replaces a surprisingly annoying manual chore — pasting a vertical list into a sentence, an email, or a function call that wants its values comma-separated.

Is my text kept anywhere?

No. The splitting and joining runs on this site's own server, so the text is sent over an encrypted connection to be processed — but nothing is written to disk, logged, or retrievable afterward. It exists only for the moment it takes to reflow it, then the request ends and it is gone.