Remove Empty Lines
Delete all blank and empty lines from your text.
Was this tool helpful?
Thanks for the feedback!
This tool deletes every blank line in your text, including lines that look empty but actually hold spaces or tabs, and returns the remaining lines one after another with no gaps. It is the quickest way to tighten a list copied from a PDF, an email thread or a web page before pasting it into a spreadsheet or another tool.
What counts as an empty line
The text is split at each line break, and a line is dropped if nothing is left after trimming whitespace from both ends. That covers:
- truly empty lines;
- lines containing only spaces or tabs, which are invisible in most editors;
- lines holding only non-breaking spaces, which often arrive with text copied from websites and Word documents.
A line with any visible character, even a lone full stop or dash, is kept. Kept lines are not modified at all: indentation at the start and spaces at the end stay exactly as they were, and line order does not change.
Before and after
Shopping list Rice (5 kg) Dal Oil
becomes
Shopping list Rice (5 kg) Dal Oil
The line under "Rice" contained three spaces and was removed; the two-space indent before "Rice" was preserved; the trailing blank line at the end is gone too.
When removing every blank line is too much
Blank lines often carry meaning, so think about the destination before you run this:
- Prose: paragraphs are separated by blank lines. Removing them all stacks the paragraphs into one block. If you want to keep exactly one blank line between paragraphs while squeezing out the extra ones, use the Text Cleaner instead.
- Markdown: consecutive lines without a blank line between them are joined into a single paragraph when rendered, and some lists and headings need a blank line before them.
- Code: blank lines rarely change how a program runs, but they separate functions and logical blocks, so a file stripped of them becomes hard to read.
Jobs this tool is good at
- Double-spaced PDF text: some PDFs copy out with a blank line after every line. One click puts the lines back together.
- Spreadsheet imports: pasting a list with gaps into Excel or Google Sheets leaves empty rows. Remove the gaps first and every item lands in consecutive cells.
- Preparing lists for other line tools: sorting, shuffling and counting are cleaner without blank entries. After this step, the line counter gives you the true number of items.
- Form responses and exports: survey answers or contact lists exported with empty fields often leave blank lines scattered through the file.
The tool does not remove duplicate lines, trim spaces inside lines or join lines together; each of those is a separate job with its own tool.