Remove Empty Lines

Delete blank and whitespace-only lines from any text in one click, or collapse long runs of blank lines into a single gap. Free, instant and private — everything runs in your browser.

0
Blank lines removed
0
Lines kept

How to remove empty lines

  1. Paste your text. Drop in a list, a document or exported data that has too many blank rows.
  2. Pick a mode. Remove every blank line for a tightly packed result, or collapse consecutive blank lines into a single spacer to keep paragraphs readable.
  3. Copy or download. The cleaned text and a count of how many blank lines were removed appear instantly.

About this tool

This free remove empty lines tool cleans up text that is padded with unwanted blank rows — a common problem after copying from PDFs, exporting spreadsheets, or pasting code and lists between apps. Deleting those gaps makes lists compact, tidies data before importing it into a spreadsheet, and removes the awkward double-spacing that creeps into pasted content. By default it also removes lines that only contain spaces or tabs, which look empty but are not, so you get a genuinely clean result.

If you would rather keep some structure, switch to Collapse to one, which reduces any run of blank lines down to a single blank line — perfect for normalising the spacing between paragraphs without gluing them together. All processing happens locally in your browser using JavaScript, so your text is never uploaded, stored or logged, and the tool works even when you are offline.

Frequently asked questions

Does it remove lines that only contain spaces or tabs?

Yes, when "Treat whitespace-only lines as blank" is enabled (the default). Those lines look empty but actually contain invisible spaces or tabs; the tool strips them out. Turn the option off to only delete truly empty lines.

What does "Collapse to one" do?

Instead of deleting every blank line, it reduces each run of consecutive blank lines down to a single blank line. This keeps a readable gap between paragraphs while removing excessive spacing.

Will it change the lines that contain text?

By default your non-blank lines are left exactly as they are. If you enable "Trim trailing spaces on kept lines", the tool also removes stray spaces and tabs at the end of each kept line, which is handy for cleaning data.

Is my text uploaded to a server?

No. The cleanup runs entirely in your browser with JavaScript. Your text never leaves your device, so it is safe for private lists, notes and confidential documents.