Remove Empty Lines
Clean up spacing in a block of text. Drop every empty or whitespace-only line, collapse runs of blank lines down to a single separator, or just remove blank lines hanging off the end.
🔒 100% Client-Side & Private — processed locally in your browser. Files never leave your device.
Options
Your result will appear here
Type or paste your input above, adjust the options, then press Run. Tip: press Ctrl+Enter to run, and ? for every shortcut.
How it works
What counts as a blank line
The cleaner works on newline-separated text and treats any line holding nothing but spaces, tabs or other whitespace as blank. In “Remove all blank lines” each such line is deleted and the survivors are joined back with single newlines; the stats report exactly how many lines went. This is the mode for pasted spreadsheet columns, CSV exports and transcript dumps, where a stray empty row breaks the structure. Lines are split on plain newlines, so a Windows file keeps its carriage returns on the lines that survive.
Collapsing runs instead of deleting them
When paragraph boundaries carry meaning, “Collapse runs to one blank line” keeps a single separator wherever two or more blank lines appeared — including a run at the very start of the text — so the rhythm survives while triple-spaced documents still shrink.
Trimming just the tail
“Trim trailing blank lines” strips blank lines hanging off the end and touches nothing in the body, leaving files that already have deliberate internal spacing exactly as they were.
Edge cases and where the text goes
Empty input returns empty output rather than an error, and lines the tool keeps are copied verbatim with their indentation intact. The whole transformation happens in your browser; the text you paste is never transmitted, logged or stored.
Questions
Does a line with only spaces or tabs count as blank?
Yes. In every mode a line is "blank" when it contains nothing but whitespace.
What does collapse do to leading blank lines?
Any run of consecutive blank lines anywhere in the text — including at the start — is reduced to a single blank line.
Does it rewrite the lines it keeps?
No. Surviving lines are copied exactly as they arrived, keeping their indentation and any trailing carriage returns from a Windows file. Only whole blank lines are dropped, collapsed or trimmed, depending on the mode.
Related tools
See categoryRemove Duplicate Lines
Delete repeated lines from a list, keeping the first or last occurrence.
Add Line Numbers
Prefix every line with a running number, with configurable start, separator, zero-padding.
Sort Lines
Sort lines alphabetically, numerically, by length, naturally, or shuffle them.
Find and Replace
Replace text by plain string, whole word, or regular expression, with optional case folding.