Blank line remover
Delete blank lines from text, optionally treating whitespace-only lines as blank too. Normalises CRLF/CR/LF and reports how many lines were removed and kept — all locally.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
CRLF, CR and LF are all recognised and the output uses LF. Whether whitespace-only lines count as blank is controlled by the switch below.
Result
Non-blank lines keep their content and order; only blank lines are removed.
Enter text to process
Input lines: 0 · Removed: 0 · Kept: 0
What this tool does
- Strip layout blank lines from text copied out of PDFs, chat apps or web pages
- Compact log files and lists by removing every blank line
- Switch between keeping indentation-only lines and clearing them as well
Example
Input
a b c
Output
a b c
With the default "whitespace-only lines count as blank" setting, five input lines lose two (the empty line and the two-space line) and keep three; turning the switch off keeps the two-space line.
Frequently asked questions
Do lines with only spaces or tabs count as blank?
By default yes, they are removed because they look blank to the eye. If you want to keep indentation-only lines, untick "Also remove lines that contain only spaces or tabs" and only lines of length zero will be deleted.
What happens to the line endings?
Windows CRLF, classic Mac CR and Unix LF are all recognised, and the output always uses LF (\n). The result therefore has no stray blank lines in any editor, but the original line-ending style is not preserved.
Are non-blank lines rewritten?
No. The tool does exactly one thing: drop whole lines. Non-blank lines keep their content, their leading and trailing spaces and their order — nothing is trimmed, merged or re-tabulated.
What about empty input?
It returns empty text with zero lines instead of raising an error. Non-string input or invalid options raise explicit invalid-input / invalid-options errors.
Keywords:blank line removerremove empty linesnl-trim