Remove empty lines
Delete blank lines from a block of text, optionally collapsing runs to one.
How it works
Removes blank lines from pasted text. Lines containing only spaces or tabs count as blank, which is what people usually want — a line that looks empty but holds a stray space is still clutter.
The collapse option is the gentler version: instead of removing every blank line, it reduces runs of two or more down to a single blank, so paragraph breaks survive while double and triple spacing does not.
This tool runs entirely in your browser. Nothing you enter is sent to a server, logged or stored, and the page keeps working with the network disconnected.
Common questions
- Does a line with only spaces count as empty?
- Yes. Lines containing nothing but whitespace are treated as blank, since that is almost always the intent.
- How do I keep paragraph breaks?
- Use the collapse option, which reduces runs of blank lines to one instead of removing them all.
Related pages
- Word and character counter Words, characters, sentences, paragraphs and reading time, counted as you type.
- Typing speed test Measure words per minute and accuracy on a one, two or five minute test.
- Remove duplicate lines Strip repeated lines from a list, keeping the first occurrence of each.
- Sort lines alphabetically Sort a list of lines A–Z, Z–A, by length, or numerically.
- JSON formatter and validator Pretty-print, minify and validate JSON, with the exact position of any error.
- Text compare Compare two blocks of text and see which lines were added, removed or changed.
- Regex tester Test a regular expression against sample text, with matches and capture groups shown.
- Case converter Convert text between upper, lower, title, sentence, camel, snake, kebab and other cases.
- Find and replace Replace every occurrence of a string in pasted text, with optional regex.
- Readability checker Flesch Reading Ease and grade level, with sentence length and passive voice flagged.