Home / Text Cleaning / Remove Line Breaks

Remove Line Breaks Online

Copying text from a PDF or email often leaves a \n or \r\n hard return at the end of every line, breaking clean paragraphs into fragments. Paste your text above to strip them out, keep paragraph spacing intact, replace breaks with a space, or convert a stacked list into a comma-separated line. Nothing leaves your browser.

Preserve Paragraphs
Join Lines With
TEXT INPUT
0 words · 0 chars
FORMATTED OUTPUT Download .txt
Result will appear here…

Related text cleaning tools

About this tool

How it works

Paste your text into the left panel. Choose how the removed breaks should be handled, then hit run and copy from the output panel. The “Preserve Paragraphs” toggle keeps intentional double line breaks in place while stripping everything else.

What the three modes do

Preserve Paragraphs removes single line breaks while leaving the double ones untouched. Those double breaks are what create the visual gap between paragraphs, so your text keeps its structure. Good for fixing PDF exports and email bodies where the paragraphs themselves are fine but the lines inside them are broken up.

Join with a space replaces each line break with a single space so no two words accidentally merge together. If the output still has doubled spaces between some words, the remove extra spaces tool cleans those up in one more pass.

Join with a comma converts a stacked list into a comma-separated string. This works the same way as the newline to comma tool but built directly into the line break removal step, so you do not need to run two separate operations. Paste a column of values from a spreadsheet and you get a single line ready to drop into a SQL IN() clause or a CSV field without any editing.

Where this problem comes from

PDFs are the most common source. A renderer inserting a \r\n at the end of every visual line rather than every sentence is standard behaviour. Extract a few pages and you end up with hundreds of hard returns scattered through paragraphs that were perfectly readable in the original file.

Older email clients wrap lines at 72 or 76 characters for compatibility reasons. Forward that message a couple of times, paste it anywhere modern, and breaks land in the middle of sentences.

Spreadsheet exports create this when cells contain multi-line content. The \n characters inside those cells get preserved on export, which turns individual values into fragments the moment you paste them somewhere else.

Frequently asked questions

Unix \n (LF), Windows \r\n (CRLF), and old Mac \r (CR). Also Unicode line separator U+2028 and paragraph separator U+2029. You do not need to know which type your source text uses, the tool detects them all.
Preserve Paragraphs only targets single line breaks. Double line breaks stay in place so your paragraph structure stays intact. Removing everything takes out every break character with no exceptions and gives you one continuous block of text.
Not with Join with a space. Each removed break gets replaced with a space so the last word of one line and the first of the next stay separated. Only Join with nothing merges them directly.
Yes. Select Join with a comma, paste your list, and each line becomes a comma-separated value. If the list has duplicate entries worth cleaning out first, run it through the remove duplicate lines tool beforehand.
No enforced limit. Processing is local so very large inputs depend on your device memory. A few megabytes of plain text processes without any issue on a modern browser.
No. Everything runs client-side in your browser using JavaScript. Nothing is transmitted and nothing is stored.
Yes, on current iOS and Android browsers.