FormatterHQ

Remove Line Breaks

Join broken lines from PDFs, emails and terminals into flowing text, optionally keeping the breaks between paragraphs.

Input TEXT
Output TEXT
Ready.

How to use the Remove Line Breaks

  1. Paste the text that has unwanted line breaks.
  2. Choose what replaces each break: a space, nothing, a comma or your own separator.
  3. Enable paragraph mode if blank lines between paragraphs should stay.
  4. Copy the joined text.

Remove Line Breaks and Rejoin Sentences

Text copied from a PDF, a plain-text email or a terminal is often hard-wrapped: each line ends where the page did, not where the sentence does. This tool will remove line breaks and turn those fragments back into continuous text.

Example

Input:
Text copied from a PDF often
breaks in the middle of
sentences like this.

A second paragraph
also wraps.

Output (keep paragraph breaks):
Text copied from a PDF often breaks in the middle of sentences like this.

A second paragraph also wraps.

Without paragraph mode, both paragraphs become a single line.

Options explained

  • Space (default): each break becomes one space. Use this for prose.
  • Nothing: lines are glued together directly. Useful for long URLs, keys or Base64 that were wrapped.
  • Comma: each break becomes a comma and a space, so a column of values turns into red, green, blue.
  • Custom text: any separator you type, such as | , a semicolon or OR for building search queries.
  • Keep paragraph breaks: blank lines are treated as paragraph boundaries and kept as one blank line; only the breaks inside each paragraph are joined.

How spacing is handled

Spaces and tabs around each line break are absorbed, so you never get double spaces at the join. Several line breaks in a row are replaced by a single separator, and whitespace at the very start and end of the result is trimmed.

Common problems

  • Hyphenated words. PDFs often split words with a hyphen at the end of a line. “infor-” followed by “mation” becomes “infor- mation” with a space, or “infor-mation” with nothing. Check such words, or fix them with the Text Replacer.
  • Lists and headings. Bullet points and headings are joined into the surrounding text too. Remove those sections first or add blank lines around them and use paragraph mode.
  • Comma mode after periods. A line ending in a period gets a comma as well, so “this.” becomes “this.,”. Use a space when joining full sentences.

Related tools

Multiline to Single Line offers quoting options for turning lists into code-ready values. After joining, Remove Extra Spaces tidies any leftover double spaces inside lines.

Recipes for common jobs

GoalSettingResult
IDs for an SQL IN clauseComma101, 102, 103 → wrap in IN (…)
Quoted values for codeCustom text ', 'a', 'b', 'c → add a quote at each end
Wrapped Base64 or a long URLNothingOne unbroken string
Search query from keywordsCustom text OR red OR green OR blue
Poem or lyrics quoted inlineCustom text / line one / line two

For the Base64 and URL cases, make sure the lines do not end in trailing spaces you want to keep, since spaces around each break are absorbed during joining.

Privacy

The text stays in your browser while it is processed.

Frequently asked questions

How do I remove line breaks but keep paragraphs?
Turn on the option to keep paragraph breaks. Lines inside a paragraph are joined, and blocks separated by a blank line remain separate paragraphs.
Why does text copied from a PDF have line breaks in the middle of sentences?
PDFs store text line by line as it appears on the page, not as flowing paragraphs. When you copy it, each visual line ends with a real line break.
Can I turn a list into comma-separated values?
Yes. Choose comma as the replacement and each line break becomes “, ”. Choose custom text if you need a different separator, such as a semicolon without a space.
What happens to several empty lines in a row?
Consecutive line breaks are replaced by one separator, so blank lines do not create doubled commas or spaces. In paragraph mode they become a single blank line between paragraphs.

Last updated October 3, 2026

Related tools