Remove Empty Lines
Strip every empty (or whitespace-only) line from your text. Browser-only.
0 characters
0 characters
About Remove Empty Lines
This tool removes lines whose content is empty or made entirely of whitespace. Non-blank lines stay in their original order. It's the cleanup move when you've got a list or output that's been padded with stray blank lines.
When to use it
- Tidying a list pasted from a poorly formatted source
- Compacting output for a single-screen view
- Removing whitespace-only lines that look empty but aren't
- Pre-processing data where blank lines would break a parser
How it works
Lines are split on LF/CRLF, lines whose trimmed value is empty are filtered out, and the remaining lines are joined with LF.
Examples
foo bar baz
foo bar baz
Frequently asked questions
- Are lines with only spaces removed?
- Yes. Any line whose trimmed contents is empty is dropped — including ones with only spaces, tabs, or other whitespace.
- What if I want to keep at most one blank line between blocks?
- Use collapse-blank-lines instead — it limits consecutive blanks rather than dropping all of them.