Remove Line Breaks

Strip unwanted line breaks from copied text with one click. Choose whether to replace newlines with a space, collapse them while keeping paragraph breaks, or remove them entirely. Ideal for cleaning up text pasted from PDFs, emails, or documents.

Paste text above to remove line breaks

How It Works

When you copy text from a PDF, an email client, or a word processor, the result often contains hard line breaks at every line wrap. These breaks look fine in the source document but create broken, ragged paragraphs when pasted elsewhere. This tool gives you three ways to handle them.

Mode 1 — Replace with space:
Every line break (\n, \r\n, or \r) is replaced by a single space. Multiple consecutive breaks are also collapsed to one space. This is the most common option when you have a single column of text that has been artificially broken at 60–80 characters.

Example input:
"The quick brown fox
jumps over the lazy
dog."

Result: "The quick brown fox jumps over the lazy dog."

Mode 2 — Keep paragraph breaks:
Sequences of two or more line breaks are treated as a paragraph boundary and collapsed to a single blank line. Single line breaks within a paragraph are replaced by a space. This preserves the document's paragraph structure while removing the mid-paragraph wrapping.

This mode is useful for articles, emails, and blog posts that have both hard-wrapped lines and deliberate blank lines between sections.

Mode 3 — Remove all:
Every line break is deleted with no replacement character. Words that were separated only by a line break will run together, so use this mode when you know there is always punctuation or a space before each break, or when you want to join lines in a code or data context.

You can also enter a custom replacement character in the text field — for example a pipe "|", a tab, or a semicolon — to join lines with that separator instead.

Frequently Asked Questions

Why does copied PDF text have so many line breaks?

PDFs store text as positioned glyphs rather than flowing paragraphs. When you copy, the PDF reader inserts a newline at every visual line end. The "Replace with space" mode is designed specifically for this situation.

What is the difference between \r\n and \n?

\r\n (carriage-return + line-feed) is the Windows line ending. \n alone is the Unix/Mac line ending. \r alone is an old Mac OS 9 ending. This tool handles all three.

Can I keep paragraph breaks but remove single line breaks?

Yes — that is exactly what "Keep paragraph breaks" mode does. Two or more consecutive newlines are treated as a paragraph separator and kept (collapsed to one blank line), while single newlines within a paragraph are replaced with a space.

Can I use a custom separator instead of a space?

Yes. Select "Replace with space" mode and then type any character into the custom separator field. Leave it blank to replace with a space, or enter a pipe, comma, semicolon, or any other character.

Does this tool change my text in any other way?

No. Only newline characters are affected. Spacing, punctuation, capitalisation, and all other characters are left exactly as you pasted them.