Remove Empty Lines
Delete blank lines from text.
Try it
Output
The result appears here.
About Remove Empty Lines
A remove empty lines tool deletes the blank lines from a block of text. Blank lines often come from copying text out of a web page or PDF, from exports with a blank row after every record, or from a list edited by hand that was left with gaps.
Removing them leaves a compact list that imports cleanly into a spreadsheet, a database or a script. The tool removes only empty lines, so the text on the other lines stays exactly as it was.
How to use Remove Empty Lines
- Paste the text with blank lines into the input box.
- Run the tool to remove every empty line.
- Check the count of lines removed in the output panel.
- Decide whether you need blank lines between paragraphs, and keep them if so.
- Copy the cleaned text into its destination.
Empty and blank are not the same
A line that holds nothing is empty. A line that holds only spaces or tabs looks blank but is not empty to a strict tool, so it may survive a simple clean. If a result still has gaps, check for lines that contain whitespace only, and clean the spacing first with the extra spaces tool.
Blank lines can also carry meaning. In prose they separate paragraphs, and in a poem they mark stanzas. Removing every blank line flattens that structure, so use the tool on lists and data, and keep the blank lines in writing that depends on them.
Clean data and clean text
In a data file, a blank row can break an import. Many spreadsheet and database tools stop reading at the first empty row, or treat the rows after it as a new table. Removing empty lines before import prevents that and keeps row numbers consistent.
Check the cleaned file before using it. Compare the first and last rows with the original, and make sure no real record was lost along with the gaps. A record that spans several lines needs a different approach, because removing its blank lines can merge two entries.
If the file has a header row, keep it in mind during the clean. A header separated from the data by a blank line is a common export quirk, and removing the gap joins the header to the first record, which is usually what the importer expects.
Frequently asked questions
Does it remove lines with only spaces?
A strict match removes only truly empty lines. Clean spacing first if lines with only spaces should go too.
Will it change the text on other lines?
No. Only empty lines are removed. Other lines keep their wording and spacing.
Why are my paragraphs joined together?
All blank lines were removed, including the ones between paragraphs. Keep those when you clean prose.
Is my text stored?
No. The result is produced on the page and cleared when you leave.
Related tools
Tools that pair well with this one.