Empty lines and lines that only look empty
A truly empty line has nothing on it at all. But many "blank" lines aren't empty: they hold a space, a few spaces, or a tab, which you can't see on screen. They come from people pressing the space bar before Enter, from documents that indent empty paragraphs, and from PDFs that pad lines to line up columns.
The option "Remove empty lines" deletes only lines with nothing on them. "Remove empty and whitespace-only lines" also deletes lines made of spaces and tabs. The second is what most people want; the first is useful when a stray space on a line is meaningful, for example in some data formats.
Worked example: text pasted from a PDF
Below, a dot stands for a space and an arrow for a tab, so you can see what's hiding on the "blank" lines:
Dear·Mere,
Thanks·for·the·quote.
·
We'd·like·to·go·ahead
→
from·1·March.
Kind·regards
Removing only empty lines leaves 7 lines, because two of the gaps contain a space or a tab. Removing whitespace-only lines as well leaves 5:
Dear·Mere,
Thanks·for·the·quote.
We'd·like·to·go·ahead
from·1·March.
Kind·regards
The words inside each line, including the comma after "Dear Mere", are untouched.
Line-ending quirks
Windows ends each line with two invisible characters (carriage return and line feed, CRLF), while macOS, Linux and the web use one (LF). Very old Mac files used a lone carriage return. Some tools treat a stray carriage return as text, so a line that looks blank isn't removed. This cleaner converts every kind of line break to one standard before looking for blank lines. For example, the Windows text "one, blank, two" comes out as 2 lines. If you're pasting the result back into a Windows program that expects CRLF, choose it under "Split, join and line endings".
Mistakes to avoid
- Removing paragraph breaks you wanted. In an email or a story, blank lines separate paragraphs. Removing them all runs the paragraphs together. If you only want to tidy double gaps, remove blank lines, then add them back where they belong.
- Forgetting trailing spaces on text lines. Removing blank lines doesn't trim the lines that have words on them. Turn on "Trim spaces" too if they matter.
- Expecting the last line break to count. A newline at the very end of a pasted text isn't treated as an extra blank line.
The tool reports how many blank lines it removed. Everything stays in your browser. For other tidying in the same pass, open the text cleaner; to get rid of repeated lines too, see remove duplicate lines.
Questions people ask
Why are some blank lines not removed?
They probably contain spaces or tabs. Choose "Remove empty and whitespace-only lines" and they'll go too.
Will this join my paragraphs together?
Removing blank lines leaves each line as it is, but paragraphs that were separated by a blank line will now sit directly on top of each other. Keep a copy if you need the gaps.
Last reviewed: