Remove Empty Lines
Remove blank lines from text, optionally retaining lines that contain spaces or tabs.
Loading tool…
How to use Remove Empty Lines
Compact a pasted list or document without changing the text on retained lines. Choose whether whitespace-only lines count as empty.
- Paste text that contains unwanted blank lines.
- Choose whether to remove whitespace-only lines too.
- Run the tool and copy the compact output.
Good to know
- Retained lines keep their indentation and surrounding whitespace.
- CRLF and CR line endings are normalized to LF. A trailing empty line is removed.
Common questions
Will indentation disappear?
No. Only entire matching lines are removed. Text and indentation on retained lines stay unchanged.
What counts as a whitespace-only line?
A line whose contents are all whitespace according to JavaScript trim, including spaces and tabs.
Keep going with related tools
All text →Line Counter
Count total, non-empty, and blank lines in pasted text, including trailing line breaks.
TextText Cleaner
Clean extra whitespace, normalize Unicode accents, or remove non-printing control characters locally.
TextRemove Duplicate Lines
Deduplicate text lines with exact, trimmed, or case-insensitive matching, keeping the first occurrence.
TextText Joiner
Join lines with a custom literal separator, optional trimming, and explicit blank-line handling.
TextSort Lines
Sort text lines ascending or descending with natural numeric ordering, keeping duplicate entries.