Remove Line Breaks

Remove or replace line breaks from text — join lines into one, or preserve paragraph gaps.

AdvertisementAd slot #1 · below the result

Why unwanted line breaks appear

Text copied from a PDF, email, or web page often arrives with hard line breaks baked in — the source wrapped lines at a fixed column width rather than letting the paragraph flow. When you paste that text into a document, CMS, or code file, each line break becomes a hard return and the paragraphs won't reflow.

The same problem appears when exporting data: many tools write one record per line, and a multi-line field breaks the format. Stripping those line breaks is a routine pre-processing step.

What each mode does

Remove all
Every \n and \r\n is replaced by a single space, then consecutive spaces are collapsed to one. Use this when you want everything on one line — a URL, a snippet of code, or a paragraph stripped of all wrapping.
Preserve paragraphs
Runs of two or more consecutive newlines (the blank line that separates paragraphs) are kept as a single blank line. Single newlines within a paragraph — the mid-paragraph line wraps — become a space. Use this when pasting from a PDF or email where paragraphs are visible but internal lines are wrapped.
Replace with space
Every newline (single or double) is replaced by a space, then multiple spaces are collapsed. Similar to "Remove all" but preserves the rhythm of the original text where blank lines between paragraphs become a single space rather than nothing.

Worked example

Input: line one
line two

Paragraph two.

ModeResult
Remove all line one line two Paragraph two.
Preserve paragraphsline one line two + blank line + Paragraph two.
Replace with space line one line two Paragraph two.

Frequently asked

Does it handle Windows line endings?

Yes. Windows uses \r\n (carriage return + newline); the tool normalises these to \n before processing, so pasting from Notepad or Outlook works correctly.

Is anything sent to a server?

No. All processing happens in your browser. Nothing you paste is transmitted anywhere.

What if I just want to collapse multiple spaces?

Any mode will collapse multiple spaces that result from line-break removal. If your text has no line breaks but has extra spaces, "Replace with space" or "Remove all" will still tidy them up.

AdvertisementAd slot #2 · after the explainer