Remove Empty Lines

Strip blank lines out of a list or block of text in one click.

The remove empty lines

Paste text with gaps in it and every empty line is removed, so the lines that hold text close up in their original order. With Treat lines with only spaces as empty, which is on by default, a line of spaces or tabs is removed too; turn it off to delete only lines with nothing on them at all. The number of lines removed shows above the result.

About removing empty lines

The WordBench empty line remover deletes blank lines from your text and closes up the gaps, leaving a tidy block with no wasted vertical space. Paste a list or a passage riddled with blank rows and get back only the lines that actually contain something.

Empty lines pile up whenever text is copied out of a document, exported from a tool, or assembled from several sources. They break imports that expect one item per line, they inflate a list with rows that hold nothing, and they simply look untidy. Removing them by hand is tedious once there are more than a few.

You can decide how strict to be. By default, a line that contains only spaces or tabs is treated as empty and removed too, since a whitespace-only line is rarely meaningful. Turn that option off to keep any line that has characters on it, even if they are only spaces. Order is always preserved.

Who uses it

Data and ops teamsClean a pasted list down to real rows before an import that expects one item per line.
DevelopersStrip blank lines from config, seed data, or a snippet without opening an editor.
Writers and editorsCollapse the extra blank lines left behind after copying text from a PDF or email.
Anyone with a messy listTidy a copied list so every line holds something and nothing is left blank.

Worked example

Try it with fictional text

Paste a short list where blank lines sit between acme, globex, initech, and umbrella.

The tool removes the empty rows and returns the four names on consecutive lines. If one of the gaps was actually a line of spaces, the default setting still treats it as empty and removes it, so nothing invisible is left behind.

Frequently asked questions

Does it remove lines that only contain spaces? By default yes. A line made of only spaces or tabs is treated as empty and removed. Turn off that option if you want to keep whitespace-only lines and delete only truly blank ones.

Does it remove lines that only contain spaces?

By default yes. A line made of only spaces or tabs is treated as empty and removed. Turn off that option if you want to keep whitespace-only lines and delete only truly blank ones.

Will it change the order of my lines?

No. The remaining lines stay in their original order. Only the empty ones are dropped, and the surviving lines close up the gaps between them.

Can it also remove duplicate lines?

Not on its own. This tool only removes blank lines. To also drop repeats, run the result through the remove duplicate lines tool afterward.

Is my text uploaded anywhere?

No. The cleanup runs in your browser with JavaScript and nothing is sent to a server. Your text is kept in this browser's local storage so a refresh does not lose it, and Clear removes it.

Exactly what this tool counts, and why the result can differ from your word processor, is written out on the methodology page. Platform character limits, with the unit each one counts in and the date it was checked, are on the character limits pages.


Related tools