Skip to contentSkip to the inputSkip to the result

Fix line breaks

Join broken lines into paragraphs

Loading tool

Instructions

Fix line breaks

How to use

  1. Enter text and choose a mode.
  2. Paragraph mode treats blank lines as paragraph breaks.

Supported input

  • Up to 200,000 characters.
  • Spaces at line ends are removed and lines are joined with one space.
  • An English word split with a hyphen at a line end (infor-mation) is rejoined, and Hangul broken across lines can be joined without a space.

Input example

A line
was broken.

Result example

A line was broken.

Troubleshooting

  • Nothing is produced for empty input.
  • Split very long text into parts.

Limitations

  • A hyphenated word that happens to break at its hyphen (well-known) loses the hyphen too.
  • Joining Hangul without a space also joins lines that broke between words, so check the result.

How it works

  • Joins text that was broken on every line, as when copied from a PDF or email, or puts each sentence on its own line.

Putting text copied from a PDF or an email back into paragraphs

Why the lines arrive broken

A PDF does not store paragraphs; it stores lines of text at positions on a page. Copy from it and you get a line break wherever the line ended on screen, often in the middle of a sentence.

Plain-text email does something similar. RFC 5322, the Internet message format, recommends lines of no more than 78 characters, and many mail programs wrap plain text near that width. Paste such a message into a document or a translator and every sentence is cut into pieces.

Lists keep their lines

Join into paragraphs treats blank lines as paragraph breaks and joins the lines inside each paragraph with one space. A line that starts with a list marker, such as “- ”, “* ”, “• ” or “1. ” or “1) ”, starts a new line instead, and a line without a marker joins the item above it.

So “The report covers”, “three areas:”, “- sales in the”, “north region”, “- costs”, a blank line and “See page 4.” become “The report covers three areas:”, then “- sales in the north region” and “- costs” on lines of their own, then the last paragraph. The broken item finds its other half.

The three modes compared

  • Join into paragraphs: sentences are whole again, blank lines between paragraphs stay, list items stay on their own lines.
  • All on one line: the paragraph breaks go too, and list markers end up in the middle of the line, so it suits short text without lists, such as a caption or a field that takes one line.
  • One sentence per line: everything is joined first, then a new line starts after each sentence end followed by a space. List items with no full stop merge into one line, so the list is lost. “He said "Hi!" Then left. Version 2.0 is out.” gives three lines, the decimal in 2.0 untouched.

Hyphens at line ends

When a line ends with a letter and a hyphen and the next line starts with a small letter, the two halves are joined without the hyphen: infor- and mation become information. If the next line starts with a capital, the hyphen is kept and a space is added, so “CEO-” followed by “And” stays “CEO- And”.

For Korean text a separate option joins lines that both end and begin in Hangul without a space, because Korean PDFs break inside words; it also joins words that were split at a space, so read the result through.

Clean these up first

  • Quote markers in replies: “> as you said” and “> last week” join into “> as you said > last week”. Remove them first in find and replace with the regular expression ^> ? replaced by nothing.
  • Page numbers and running headers: copying several PDF pages at once leaves them between paragraphs, where they get joined into the middle of a sentence. Delete those lines before joining.
  • Text with hard line breaks you want, such as addresses or poetry: join only the parts that need it, or the line structure is lost.

Checked

Frequently asked questions

How do I remove the line breaks from text copied out of a PDF?

Join into paragraphs replaces each line break with one space and keeps blank lines as paragraph breaks. To drop the paragraph breaks too, choose All on one line.

What happens to a line that was broken in the middle of a word?

When a line ends in an English word and a hyphen (infor-) and the next starts in lower case, the hyphen is dropped and the word rejoined: information. For Korean, set Hangul line ends to Join without a space so 안녕하세 and 요 become 안녕하세요; lines that broke between words are then joined too, so check the result.

How does one sentence per line decide where a sentence ends?

A full stop, question mark or exclamation mark (including 。!?) followed by a space starts a new line. A decimal such as 3.5 and the full stop after a list number such as '1. apples' are not split, but an abbreviation such as 'Mr. Kim' is split after the full stop.