Remove Empty Lines

Remove the blank lines that build up when you copy text from emails, PDFs, web pages and spreadsheets. Paste your text, choose whether lines with only spaces count as empty, and the tool returns the same text with every empty line taken out and the remaining lines in their original order. Copy or download the result. Your text stays in your browser.

Inputs

Result

Text without empty lines
Shopping list
milk
eggs
bread
butter
Lines before
10
Lines after
5
Empty lines removed
5

How it is calculated

  1. Text without empty lines: start from the text, then convert Windows and old Mac line endings to standard line breaks, then remove lines that are empty or hold only spaces
  2. Lines before: start from the text, then convert Windows and old Mac line endings to standard line breaks, then count lines
  3. Lines after: start from the text without empty lines, then count lines
  4. Empty lines removed = lines before − lines after

Resources for your next step

Helpful downloads

View all text & lists downloads
Store coming soon

We are preparing practical spreadsheets, planners, and guides. Explore the store page for what is next.

What counts as an empty line

An empty line has nothing between two line breaks. Lines that hold only spaces or tabs look empty too, even though they contain invisible characters. With the default setting, both kinds are removed. Turn the option off to remove only lines that are completely empty and keep space-only lines, which can matter in code or preformatted text.

In the example, the shopping list has 10 lines: a title, four items, and five blank lines, one of which holds three spaces. Removing them leaves the title and four items, so the result has 5 lines and the tool reports 5 empty lines removed.

Line endings are handled for you

Different systems mark the end of a line differently. Windows uses a carriage return followed by a line feed, older Mac software used a carriage return alone, and Linux and macOS use a line feed. The tool converts all of them to standard line breaks first, so a blank line is recognized no matter where the text came from.

A line break at the very end of your text creates an empty final line, and it is removed along with the others. The result never ends with a blank line, which makes it ready to paste into a form, a spreadsheet column or a list field.

Keeping paragraphs readable

Removing every empty line joins paragraphs into one continuous block. That is what you want for lists and data, but for prose you may prefer to keep one blank line between paragraphs. The remove extra spaces tool has an option that keeps at most one empty line in a row instead of removing them all.

Text inside each line is never changed. Spaces, tabs, punctuation and capital letters stay exactly as they were. If the remaining lines have stray spaces at their ends or repeated items, follow up with the remove extra spaces or remove duplicate lines tools.

Common uses

People use this to tidy addresses and lists copied from documents, to prepare items for import into another program, to clean up text extracted from a PDF, and to compact log output before sharing it. The counts make it easy to confirm how much was removed.

Up to 200,000 characters can be processed at once. Nothing is uploaded or saved, so you can use it with private notes and internal data. Close the page or press Reset to clear your text.

Frequently asked questions

Does it remove lines that contain only spaces?

Yes, by default. Turn off the option to remove only lines that are completely empty.

Will it change the text on other lines?

No. Only empty lines are removed; every other line stays exactly as it was and in the same order.

How do I keep one blank line between paragraphs?

Use the remove extra spaces tool with its option to keep at most one empty line in a row.

Why does the line count change by one more than I expected?

A line break at the very end of your text counts as an empty last line, and it is removed too.

Does it work with text from Windows?

Yes. Windows and old Mac line endings are converted to standard line breaks first.

Is my text sent anywhere?

No. All processing happens in your browser.

Sources

Text is processed in your browser and never sent anywhere. Check the result before you replace your original.

All text & lists tools