About the Remove Empty Lines
Delete every blank line, including lines that contain only spaces or tabs.
Key features
- Deletes every blank line
- Also removes lines containing only spaces or tabs
- Keeps all other lines exactly as they are
- Handles Windows (CRLF) and Unix (LF) line endings
- Instant results for large pastes
- Private, in-browser
Delete blank lines in one click
Text copied from PDFs, emails, websites, chat apps and code editors often arrives with empty lines everywhere: between every line, after every paragraph, or scattered at random. Remove Empty Lines deletes every blank (or whitespace-only) line and leaves the rest untouched.
Example
First item
Second item
Third item
Fourth item
becomes
First item
Second item
Third item
Fourth item
When you need it
- Lists copied from documents or websites.
- Code and config files with excessive spacing.
- CSV and data exports with blank rows that break imports.
- Log files before counting or sorting lines.
- Poems and lyrics formatted with extra spacing.
Command-line equivalents
grep -v '^[[:space:]]*$' file.txt
sed '/^[[:space:]]*$/d' file.txt
Related tools
Tidy spaces within lines with Remove Extra Spaces, join lines into paragraphs with Remove Line Breaks, or de-duplicate with Remove Duplicate Lines.
How to use the Remove Empty Lines
- Type or paste your text into the input box.
- Choose the options you want.
- The result updates instantly as you type.
- Copy the output or download it as a .txt file.