Skip to content

Remove Line Breaks - Join Lines Online

Replace line breaks withReplace with
Result

Join Broken Lines Back Together

Text copied from PDFs, old emails, terminal output and some web pages often arrives with a hard line break at the end of every visual line. Paste it here and the line breaks are replaced as you type. Choose what goes in their place: a space for normal text, a comma for turning a list into a single line, or nothing for data that was wrapped at a fixed width. Blank lines never produce empty gaps or stray commas.

Worked Example

This was copied from a PDF:

The quarterly report shows revenue
grew by 12% compared with the
previous quarter.

Costs stayed flat, mainly because
of lower shipping prices.

With Space and Keep paragraph breaks on, the result is:

The quarterly report shows revenue grew by 12% compared with the previous quarter.

Costs stayed flat, mainly because of lower shipping prices.

With Keep paragraph breaks off, both paragraphs are merged into a single line. With Comma and a list like red, green, blue on separate lines, the result is red, green, blue.

Options

  • Replace with Space joins lines into flowing text. Use it for prose.
  • Replace with Comma puts a comma and a space between items. Use it to build a comma-separated list.
  • Replace with Nothing joins lines directly. Use it for wrapped keys, hashes, base64 data and long URLs.
  • Keep paragraph breaks keeps blank-line paragraph breaks and only removes the breaks inside each paragraph.
  • Trim each line removes indentation and trailing spaces first, so you do not end up with double spaces.

Things to Watch For

  • Hyphenated line ends. PDFs often split a word across lines with a hyphen. infor- followed by mation on the next line becomes infor- mation. Search the result for - to find and fix these.
  • Lists and headings. Bullet points and short headings copied from a PDF have no blank line after them, so with Keep paragraph breaks on they are joined into the paragraph below. Add a blank line after any line you want to keep separate.
  • Wrapped data. PEM keys, base64 blobs and long URLs split at 64 or 76 characters should be joined with Nothing, never Space, or they will not decode.

Line Endings

Windows uses a carriage return and a line feed (CRLF) at the end of each line, while macOS and Linux use only a line feed (LF). Both are handled, so you will not be left with stray carriage-return characters when you paste text that came from a Windows file.

Related Tools

Going the other way? Use Add Prefix and Suffix to quote each item before joining them, or Sort Lines to order a list first. To count the words in the cleaned text, paste it into the Word Counter. All processing happens in your browser and nothing is uploaded.

Related Tools

Frequently Asked Questions

Why does text copied from a PDF have line breaks in the middle of sentences?
PDFs store text as positioned lines, not as flowing paragraphs. When you copy, each visual line usually ends with a hard line break. Pasting that into an email or document leaves short broken lines. Removing the line breaks joins them back into normal paragraphs.
What does Keep paragraph breaks do?
It treats a blank line as the end of a paragraph. Single line breaks inside a paragraph are removed, but the blank lines between paragraphs are kept, so you get one line per paragraph with an empty line between them. Turn it off to merge everything into a single line.
How do I turn a list into a comma-separated line?
Paste the list with one item per line and choose Comma. The items are joined as 'a, b, c'. Blank lines are skipped so you do not get empty items. This is useful for SQL IN clauses, tag fields and spreadsheet formulas.
Will words get stuck together?
Only if you choose Nothing. Space is the default and is right for prose. Nothing is for data that was wrapped at a fixed width, such as a long base64 string, a key or a URL split across several lines, where adding spaces would break it.
What does Trim each line do?
It removes spaces and tabs at the start and end of each line before joining. Without it, indented or padded lines leave double spaces in the result. Turn it off if leading spaces matter.