A blank-line compressor
The tool looks for runs of `N+2` or more newline characters in a row and replaces each run with exactly `N+1` newlines - which is `N` blank lines between items. So with `N = 1` (the default), three or more consecutive blank lines become one; with `N = 2`, four or more become two; and so on.
Line endings are normalised first. Windows CRLF (`\r\n`) and old Mac CR (`\r`) are converted to Unix `\n` before the collapse pattern runs. That means a mixed-ending paste produces cleanly consistent output. If you need CRLF in the output for a specific consumer, post-process with a line-ending-conversion tool.
Items themselves are not touched - no trimming, no case changes, no dedup. Only the blank lines between items are compressed. If you also need to clean up leading/trailing whitespace or remove duplicates, chain with trim, Remove empty items, or Dedupe.
How to use collapse multiple blank lines in a list
- 1Paste your list into the input panel
- 2Set Keep at most N blanks to the maximum blank-line run you want to allow (default 1)
- 3Runs longer than that get compressed; shorter runs pass through unchanged
- 4Copy or download the result from the output panel
Keyboard shortcuts
Drive ListShift without touching the mouse.
What this tool actually does
One option, a couple of fixed normalisations.
Caps consecutive blank lines at N
Every run of `N+2` or more newlines in a row is replaced with `N+1` newlines (= `N` blank lines between content). Shorter runs are not touched, so lists with already-tidy spacing pass through unchanged.
CRLF normalisation
Before the collapse, `\r\n` and bare `\r` are converted to `\n`. That way a mixed Windows/Unix paste produces consistent output. Most downstream tools prefer `\n` anyway.
Items are not modified
Only blank lines are compressed. Item content is emitted verbatim - no trimming, no dedup, no reordering. This tool does one thing.
Setting N to 0 removes all blank lines
With Keep at most 0 blanks, the tool collapses every run of `\n\n` or more down to a single `\n`. That is equivalent to dropping every blank line in the list.
The reverse operation
To add uniform spacing to a list that currently has none (or inconsistent spacing), use Add line breaks instead. This tool is for reducing; that one is for adding.
Worked example
With `N = 1`, runs of 2 or 3 blanks collapse to a single blank line.
Apples Oranges Cherries Plums
Apples Oranges Cherries Plums
Settings reference
How the cap value shapes the output.
| Setting | What it does | Effect on the sample |
|---|---|---|
| Keep at most 1 blank (default) | Collapses runs of 2 or more blank lines down to exactly 1 | All gaps become a single blank line |
| Keep at most 2 blanks | Collapses runs of 3 or more down to 2; 0-2 blank runs unchanged | Two-blank gaps pass through; the three-blank gap compresses to two |
| Keep at most 0 blanks | Removes every blank line - effectively drops all empty separators | Four items stacked with no spacing between them |
| CRLF normalisation (automatic) | `\r\n` and `\r` are converted to `\n` before collapsing | Windows pastes produce Unix-style output |