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
\nand\r\nis 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.
| Mode | Result |
|---|---|
| Remove all | line one line two Paragraph two. |
| Preserve paragraphs | line one line two + blank line + Paragraph two. |
| Replace with space | line one line two Paragraph two. |
Windows-style input behaves the same way once normalised: foo\r\nbar becomes foo bar in every mode — the tool converts \r\n and lone \r to \n before applying any of the three rules, so a paste that mixes line-ending styles is still handled consistently.
Edge cases and limitations
- Hyphenated words split across a line wrap. A PDF or newspaper-style column often hyphenates a word at the point it wraps —
hyphen-on one line,atedon the next. Removing the break only turns the newline into a space, givinghyphen- ated, nothyphenated. Rejoining split words reliably needs a dictionary lookup, which this tool doesn't attempt, so check hyphenated text by eye afterwards. - "Preserve paragraphs" trusts your blank lines. It keeps every run of two or more newlines as a paragraph break. If the source has stray blank lines — a page break, a running header, a footnote sitting on its own line — those become paragraph breaks too, even though they aren't really one.
- Pre-existing multiple spaces are collapsed as well. All three modes collapse any run of two or more spaces to one, not just spaces created by removing a line break. Text that intentionally uses double spaces after a full stop will have them reduced to one.
- The transformation is one-way. Once a line break becomes a space, nothing marks where it used to be, so the original breaks can't be recovered from the output.
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.
Will it collapse spaces that were already there, not just ones from line breaks?
Yes. Every mode collapses any run of two or more spaces down to one, regardless of whether those spaces came from a removed line break or were already in the text.
Does it trim blank lines from the start or end of the text?
No. A leading or trailing newline is converted the same way as any other — it becomes a leading or trailing space (or folds into a paragraph gap in "Preserve paragraphs" mode) rather than being stripped outright.
Can I undo the change and get my line breaks back?
No. Once a break becomes a space there's no way to tell it apart from a space that was already there. Keep a copy of the original text if you might need the line breaks again.