Collapse Consecutive Newlines (Keep One Blank Line)

Clean up pasted text by collapsing repeated blank lines without removing meaningful single line breaks.

You can also treat whitespace-only lines as blank lines and switch the output to LF or CRLF.

Everything runs locally in your browser. Your text is never sent to a server.

What this tool does

This tool is for text that became too airy after copy and paste. It keeps normal line breaks in place, compresses only runs of blank lines, and lets you choose whether to keep one blank line, keep more, or remove blank lines entirely.

How to use

  1. Paste text into the input area.
  2. Choose the blank-line limit and decide whether whitespace-only lines should count as blank.
  3. Click Compress, then copy or download the result.

Examples

Keep one blank line

Input

Paragraph 1\n\n\nParagraph 2\n\n\n\nParagraph 3

Output

Paragraph 1\n\nParagraph 2\n\nParagraph 3

Remove blank lines entirely

Input

A\n\n\nB\n\nC

Output

A\nB\nC

Treat whitespace-only lines as blank

Input

Heading\n(space-only line)\n(tab-only line)\nBody

Output

Heading\n\nBody

Glossary

Blank line

A line with no actual content. This tool can optionally treat whitespace-only lines as blank lines too.

Consecutive newlines

In practice, this means a run of blank lines. A single line break inside normal text is not the main target.

LF / CRLF

Two common line-ending formats. LF is typical on the web and Unix-like systems, while CRLF is common in Windows editors.

FAQ

Does it remove every line break?

No. By default it keeps single line breaks and collapses only repeated blank lines. If you choose Remove blank lines, it removes empty lines while keeping normal line separation between content lines.

Can it treat space-only lines as blank lines?

Yes. It is enabled by default. Lines that contain only spaces, tabs, NBSP, or full-width spaces can be compressed as blank lines.

Can it trim blank lines at the start and end?

Yes. In advanced options, switch Leading/trailing blank lines between Trim and Keep.

Can I output CRLF for Windows tools?

Yes. Change Output line ending from LF to CRLF in advanced options.

Is my text uploaded anywhere?

No. The transformation happens entirely in your browser, and the tool does not send your text to a server.

Notes

  • This tool does not reflow paragraphs or join single line breaks into sentences. It is intentionally focused on blank-line cleanup.
  • If Treat whitespace-only lines as blank is off, lines containing only spaces or tabs remain untouched.
  • If Trim trailing spaces is off, invisible end-of-line spacing may remain in the output.