Remove Empty Lines is a free tool that deletes blank lines from text, including lines that only contain spaces or tabs. It tells you how many were removed. The text is processed in your browser and never uploaded.
How to remove blank lines
- Paste your text into the left box, or open a text file.
- The text without empty lines appears on the right.
- Copy or download the result.
When this helps
- Text copied from a web page or PDF that has gaps between every line.
- Lists exported from spreadsheets with empty rows.
- Preparing data for import, where blank lines would create empty records.
- Tidying code or configuration files.
Lines that look empty but aren’t
Text copied from websites, Word documents and chat apps often contains “blank” lines that hold invisible characters: spaces, tabs, non-breaking spaces or zero-width spaces. Simple find-and-replace can’t see them, so the gaps stay. With Treat lines with only spaces as empty turned on (the default), all of these lines are removed. Turn it off to delete only lines that are completely empty, for example when indentation-only lines matter in code.
Keeping paragraphs
Removing every blank line also joins paragraphs together. If you just want to reduce big gaps to a single blank line, use Remove Extra Spaces instead.
Frequently asked questions
Does it remove lines with only spaces?
Yes, by default. Untick the option to remove only lines that are completely empty.
I only want single blank lines between paragraphs, not none.
Use Remove Extra Spaces with “Collapse repeated blank lines”, which keeps one empty line between paragraphs.
Why are some blank lines not removed by other tools?
They aren’t truly empty: they contain invisible characters such as non-breaking spaces, tabs or zero-width spaces, often left behind by web pages and Word documents. This tool treats those lines as empty as well.
Last updated