By Alex Johnson. Our whitespace cleaner deletes blank lines, but the question I kept running into was the opposite one: how do I join lines that should never have been split? This tool handles that, the PDF and email problem, while keeping the paragraph breaks you actually want.
Paste a paragraph from a PDF into an email and it arrives chopped into short lines, each ending wherever the printed page ran out of room. Deleting the breaks one at a time is slow, and a blanket find-and-replace wipes out the paragraph breaks along with the broken ones. The tool below tells the two apart.
⚡ Quick answer: Paste your text below and leave “Fix copied text” selected. Lines inside each paragraph are joined with spaces, blank lines between paragraphs are kept, and words split with a hyphen at the end of a line are put back together. Copy the result and paste it wherever you need it.
Remove line breaks
Runs in your browserWhy copied text ends up full of line breaks
The breaks come from formats that care about how text looks on a page rather than how it is structured.
- PDFs record where each line of text sits on the printed page, not where sentences and paragraphs start. When you copy from one, many PDF readers turn the end of every printed line into a line break.
- Plain-text emails are often wrapped at a fixed width. The email standard, RFC 5322, says a line must be no more than 998 characters and should be no more than 78, so older mail programs and mailing lists insert breaks to stay under that.
- Scanned documents run through text recognition come out with one line of text for every line on the page, plus hyphens wherever the original typesetter split a word.
- Terminal output, code comments and subtitles are wrapped by hand at a set width and keep those breaks when copied.
The three modes
Fix copied text
The default. Lines inside a paragraph are joined with a single space. A blank line counts as a paragraph break and is kept, and a line that starts with a bullet, dash or number (“1.”, “a)”) starts a new paragraph, so lists survive. Untick “Keep paragraph breaks” to join everything into one block.
Some PDFs put no blank line between paragraphs at all. “Spot paragraphs without blank lines” handles that by ending a paragraph after a line that finishes a sentence and is noticeably shorter than the full-width lines around it, the way the last line of a printed paragraph usually is. It works best on text with long, even lines, and it’s off by default because short lines in poems or addresses can trigger it.
Remove all breaks
Turns the whole text into one paragraph. Useful for a form field that rejects line breaks, a single spreadsheet cell, or a meta description.
Join lines with…
Treats each line as an item and joins them with the separator you choose: comma and space, comma, semicolon, vertical bar, nothing, or your own. Blank lines are skipped. This turns a column copied from a spreadsheet into “apples, pears, plums” for an email, or into a comma-separated value for a tag field.
Hyphenated words at the ends of lines
Printed text splits long words across lines with a hyphen: “infor-” on one line and “mation” on the next. Joining the lines naively leaves “infor- mation.” With “Rejoin words” ticked, the tool removes the hyphen and the break when a line ends in a letter followed by a hyphen and the next line starts with a lowercase letter. If the next line starts with a capital, as in “Anglo-Saxon,” the hyphen stays.
The tool can’t tell a typesetter’s hyphen from a real one, so a compound like “well-known” that happens to break at its hyphen comes out as “wellknown.” The “Words rejoined” count tells you how many joins it made, which makes them quick to check.
Removing line breaks in Word and Excel
Microsoft Word: open Find and Replace (Ctrl+H), type ^p in Find for paragraph marks or ^l (a lowercase L) for manual line breaks, put a space in Replace, and replace all. Replacing ^p also removes the breaks between your real paragraphs, so a common trick is to replace ^p^p with a placeholder like ## first, then ^p with a space, then ## back with ^p.
Excel: a line break inside a cell is the character CHAR(10). The formula =SUBSTITUTE(A1,CHAR(10)," ") returns the text of A1 with every line break replaced by a space; swap the space for ", " to get a comma-separated list.
For anything longer than a few lines, pasting into the tool above is usually faster, and it keeps paragraphs without the placeholder trick.
Line breaks, carriage returns and paragraph marks
“Line break” covers a few different characters. Windows traditionally ends a line with two characters, a carriage return and a line feed (CR LF). macOS, Linux and the web use a line feed (LF) alone. Word distinguishes a paragraph mark from a manual line break (Shift+Enter), and some programs use dedicated Unicode line and paragraph separators. The tool treats all of them as line breaks, so text from any of these sources is handled the same way.
Frequently asked questions
How do I remove line breaks but keep paragraphs?
Paste the text into the tool above with "Fix copied text" selected and "Keep paragraph breaks" ticked. Lines inside a paragraph are joined with spaces, and blank lines between paragraphs are kept. If your text has no blank lines between paragraphs, also tick "Spot paragraphs without blank lines".
Why does text copied from a PDF have line breaks in the middle of sentences?
A PDF records where each line of text sits on the printed page, not where sentences and paragraphs begin and end. When you copy it, many PDF readers turn the end of every printed line into a line break.
How do I remove line breaks in Word?
Open Find and Replace, type ^p in the Find box for paragraph marks or ^l for manual line breaks, and type a single space in the Replace box. Replacing ^p removes your real paragraph breaks too, so this tool is easier when you want to keep them.
How do I remove line breaks in Excel?
Use =SUBSTITUTE(A1,CHAR(10)," ") to replace the line breaks in cell A1 with spaces. CHAR(10) is the line break character Excel uses inside a cell.
How do I turn a list into one line separated by commas?
Choose "Join lines with" and pick comma and space. Each line becomes one item, blank lines are skipped, and the result is a single comma-separated line.
Is my text uploaded anywhere?
No. The tool runs in your browser, so the text you paste never leaves your device.
Fix broken lines in one paste
Keep paragraphs, rejoin split words, or turn a list into one line.
Back to the tool ↑