Remove Line Breaks - Join Lines Online
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 bymationon the next line becomesinfor- 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
Markdown Preview
Write Markdown and see the rendered HTML output in real time.
Lorem Ipsum Generator
Generate placeholder text in paragraphs, sentences, or words.
List Deduplicator
Remove duplicate lines from a list with options for case sensitivity and sort order.
List Diff / Compare
Compare two lists and find items unique to each, shared between both, or missing from one.