Remove Empty Lines

Delete blank lines from any text, or squash big gaps down to a single blank line so paragraphs stay readable. Free, instant, runs in your browser.

Blank lines pile up in the strangest ways. Export a list from a spreadsheet and every other row comes out empty. Copy an email thread and each quoted message arrives with three lines of air above it. Paste from a PDF and a blank line shows up wherever the original had a page break. Eventually you have a list of forty items with sixty empty lines mixed in, and the thing you are pasting it into either chokes or looks wrong.

This tool takes those lines out. There are two ways to do it, and the difference is worth a moment’s thought.

Remove all of them, or keep one

“Remove all of them” deletes every empty line outright. That is what you want for lists: one name per line, one URL per line, one SKU per line. Nothing between the entries means nothing to trip over later.

“Keep at most one in a row” is for running text. Paragraphs usually need a blank line to separate them, but nobody needs four. This setting squashes any run of blank lines down to a single one and leaves the paragraph structure alone. It also trims blank lines off the very end of the text, which is the thing that makes a copied block drag an odd gap behind it.

What counts as empty

A line that is completely empty, and also a line that has nothing but spaces or tabs on it. That second case catches most of what you cannot see. A “blank” line full of spaces looks the same as an empty one on screen, but plenty of software treats it as a real line with content. The tick box for trailing spaces cleans the end of the remaining lines too, so a line like “Total: “ is tidied at the same time.

The stats under the result show lines before, lines after, and how many were removed, which is a quick way to check the tool did what you expected. If the number is smaller than you thought, the rest of the gaps are probably single line breaks inside a paragraph, and remove line breaks is the tool for that.

Good partners for this tool

Empty lines usually travel with other mess. After clearing them, run the list through remove duplicate lines and sort lines, and you have a clean, unique, ordered list. If you are only after some of the lines, filter lines keeps or deletes lines by keyword. And before any of that, a pass through remove extra spaces stops “apple” and “apple “ being treated as different entries.

Frequently asked questions

Why do my blank lines come back when I paste the result somewhere?

Some editors and web forms add their own spacing between paragraphs when they render a pasted line break. Check the plain text in a basic editor like Notepad first. If it is clean there, the extra space is added by the destination, not left over from this tool.

Can I keep blank lines between paragraphs and remove the rest?

Yes. Choose "Keep at most one in a row". Paragraph breaks stay, and long gaps shrink to a single blank line.

Does it remove lines that only contain spaces?

Yes. A line with nothing but spaces or tabs counts as empty.