Remove line breaks
Turns text broken across many lines back into a clean paragraph.
Text copied out of a PDF, an email or a terminal often arrives chopped into short lines. This joins it back together and tidies the spacing.
Keep your paragraphs, lose the wrapping
Most line-break removers have one setting: flatten everything into a single block. That is wrong for a document, because it runs every paragraph together into one wall of text. The problem is not line breaks in general — it is the extra breaks that wrapping added at the end of each visual line, while the blank lines between paragraphs are structure you want to keep.
"Remove breaks, keep paragraphs" — the default here — knows the difference. A single line break inside a paragraph is treated as wrapping and turned into a space; a blank line between paragraphs is kept. So a PDF chopped into eighty short lines across five paragraphs comes back as five clean paragraphs, not one. Use "Join into one paragraph" only when you genuinely want a single unbroken block.
Replace breaks with something else
Sometimes you do not want the lines joined with spaces but with a separator — turning a column into a comma list. "Replace breaks with commas" does exactly that. For more control over the separator, quoting and deduplication, the list converter is the fuller tool.
Runs entirely in your browser. Your text is never uploaded — open DevTools, Network tab, and you will see zero requests while you use this tool.
How to use it
- Paste the broken text.
- Press "Remove breaks, keep paragraphs" to fix wrapping while keeping paragraph splits.
- Use "Join into one paragraph" only if you want a single unbroken block.
- Copy the result.
What this tool does
Two buttons handle two different problems.
- Remove line breaks deletes every newline and joins the text into one continuous paragraph, inserting a single space where the break was so words do not collide.
- Clean spacing is the gentler option: it collapses runs of spaces and tabs, trims whitespace at the end of each line and reduces long stretches of blank lines to one, while leaving the paragraph structure alone.
Use the second when the text is fundamentally correct but untidy, and the first when the line structure itself is the damage.
Hard breaks versus soft wrapping
The distinction explains why some text reflows nicely in a new window and some does not.
A soft wrap is not stored anywhere. The program decides where to break each line based on the current width, and if you resize the window or change the font, the words rearrange. There is no character in the file at the end of the visual line.
A hard break is a real character in the text — \n on Linux and macOS, \r\n on Windows — put there because someone pressed Enter or because software wrote it. It stays wherever it is no matter how wide the window gets. That is what produces text like this:
The report examined three regions and found
that revenue in the northern territory grew
faster than expected during the second
quarter of the year.
Paste that into a narrow column and the lines break again in the wrong places, producing a ragged mess. Removing the hard breaks restores a single flowing paragraph that wraps correctly wherever it goes.
In word processors there is a third case: Shift+Enter inserts a line break inside the same paragraph, while Enter starts a new paragraph. They look identical on screen but behave differently for spacing, indentation and list numbering.
Why text copied from a PDF breaks apart
A PDF does not store paragraphs. It stores instructions of the form draw this string of glyphs at these coordinates. The visual paragraph you see is an illusion created by placing many separate text runs one under another. When you select and copy, the reader has to guess where each line ends, and it does the safe thing: it emits a hard newline at the end of every visual line.
That is why PDF text pasted into a document arrives chopped into 60- or 70-character lines. The same mechanism produces related damage:
- Hyphenated words split across lines. Justified text hyphenates, so you get
develop-andmenton separate lines. Joining the lines givesdevelop- ment, which you must fix by hand or with a find-and-replace for-. - Page furniture in the middle of a sentence. Headers, footers, page numbers and footnote markers are just more text runs, and they land wherever they were positioned.
- Two-column layouts read as one. Some readers interleave the columns line by line.
- Odd spacing. Kerning implemented as separate runs can copy as extra spaces inside words.
The same applies to plain-text emails, which are traditionally wrapped at 72 or 78 characters with real newlines, and to terminal output, where every line is genuinely its own line.
Examples
| Before | Button | After |
|---|---|---|
| The quick brown fox jumps over the lazy dog. | Remove line breaks | The quick brown fox jumps over the lazy dog. |
| First para. Second para. | Clean spacing | First para. Second para. |
| word word | Clean spacing | word word |
| Line one Line two Line three | Remove line breaks | Line one Line two Line three |
A reliable order for badly broken PDF text: Remove line breaks first to get one block, then Clean spacing to squeeze out the double spaces the join created, then re-insert paragraph breaks by hand where they belong.
Doing it without this tool
- Microsoft Word:
Ctrl+H, click More → Special. Search for^lto match manual line breaks or^pfor paragraph marks, and replace with a single space. Replace^p^pwith a placeholder first if you want to keep real paragraph splits. - Google Docs: Edit → Find and replace, tick Match using regular expressions, search for
\nand replace with a space. - Notepad++: Search → Replace, select Extended mode, find
\r\nand replace with a space. Or use Edit → Line Operations → Join Lines (Ctrl+J) on a selection. - Excel:
=SUBSTITUTE(A1,CHAR(10)," ")removes line breaks inside a cell;CHAR(13)for the carriage return. - Command line:
tr '\n' ' ' < file.txt, orpaste -sd' ' file.txt. To join only wrapped lines and keep blank-line paragraph breaks,awk 'BEGIN{RS="";ORS="\n\n"}{gsub(/\n/," ");print}' file.txt.
Privacy: your text never leaves your browser
The joining and trimming are JavaScript string operations on the page. Nothing is uploaded, nothing is stored, and closing the tab discards the text.
Since the text people fix here usually came out of a PDF — contracts, research papers, statements, internal reports — that is the point. A local tool means the document never becomes somebody else's log entry.
Related tools
Frequently asked questions
Remove line breaks joins everything into a single block. If you want to keep paragraph splits, use Clean spacing instead, which only collapses runs of blank lines.
A PDF stores the position of each line rather than flowing text, so the reader inserts a hard newline at the end of every visual line when you copy.
A hard break is a real newline character stored in the text and stays put forever. Word wrap is decided by the display width and rearranges itself when the window changes.
Joining the lines leaves "develop- ment". Search and replace the hyphen followed by a space to repair those, checking that you do not merge genuine hyphenated compounds.
Clean spacing collapses runs of spaces and tabs into one space and trims trailing whitespace at the end of each line.
Press Ctrl+H, open More and Special, search for ^l for manual line breaks or ^p for paragraph marks, and replace with a single space.
Yes. Both \r\n and \n are recognised, so text from any operating system joins correctly without leaving stray characters.