Skip to content

Remove Empty Lines

Delete the empty lines of your text, or squeeze several blank lines into one.

Empty line remover
Paste text; blank lines disappear.

Result
Text without empty lines
line one
line two
line three
5
Lines removed
3
Lines left

Private: Everything runs in this page. Nothing you type is sent anywhere or saved.

On this page
  1. Empty line examples
  2. Formula
  3. How the empty line remover works
  4. What this tool does not do
  5. Frequently asked questions
  6. Related tools

Empty line examples

Text (empty lines shown as gaps)Result
a, , ba | b
a, , , ba | b
a, ba | b
, a, a
a, , ba | b

Formula

keep a line only if it has something in it

How the empty line remover works

  1. Step onePaste your text into the box.
  2. Step twoChoose whether lines with only spaces count as empty, and whether to keep a single blank line between blocks.
  3. Step threeCopy the result. The tiles show how many lines were removed.

What this tool does not do

  • It removes whole lines only; it does not join lines or remove spaces inside them.
  • It does not remove duplicate lines; use the duplicate remover for that.
  • A line holding only an invisible character such as a zero-width space is not seen as empty.

Frequently asked questions

Can I keep paragraph spacing?

Yes. Tick the option that keeps one empty line between blocks. Longer gaps shrink to one line and the gaps at the very start and end are dropped.

Does it remove spaces at the end of lines?

No. Use the trim whitespace tool for that.

Does it change the order of lines?

No. The remaining lines keep their order.