Remove Empty Lines

Paste your text, choose which lines count as empty, and press Remove empty lines. Every other line stays exactly as it was.

Try an example
Remove

About this empty line remover

Text copied from web pages, PDFs, and emails often arrives with extra blank lines, and exported CSV or log files can contain empty rows that break imports. This tool deletes those lines in one step. By default it removes both truly blank lines and lines that only look blank because they contain spaces or tabs. Choose Blank lines only to keep lines with whitespace, for example when indentation inside code matters. Lines with any other content are never changed.

How to remove empty lines

  1. Paste your text. Paste text, code, or data, or press an example. An example only fills the box.
  2. Choose what to remove. All empty lines also removes lines with only spaces or tabs; Blank lines only keeps them.
  3. Press Remove empty lines. The cleaned text appears below with the number of lines before and after.
  4. Copy or download. Press Copy text, or Download to save the result as a text file.

Frequently asked questions

What counts as an empty line?

With All empty lines, any line that is empty or contains only spaces and tabs. With Blank lines only, just the lines with nothing at all on them.

Can I keep one blank line between paragraphs?

Not with this tool; it removes every empty line. To shrink runs of blank lines to one, use Find and Replace Text with Regex on, find \n{3,} and replace with \n\n.

Is indentation inside the remaining lines kept?

Yes. Only whole empty lines are removed. Spaces and tabs at the start or end of lines with content stay as they are.

What happens to a line break at the very end?

A final line break creates an empty last line, so it is removed too and the result ends with your last line of content.

Does it handle Windows line breaks?

Yes. Windows (CR + LF) and old Mac (CR) line breaks are read correctly, and the result uses standard line breaks.