Skip to content

Remove Empty Lines

Delete blank lines, or collapse runs of them down to one.

Quick Tool Overview

Remove Empty Lines strips the blank lines out of a text or list, including the ones that only look empty because they contain a space or a tab — which is exactly the case a find-and-replace misses. You can remove every blank line or collapse runs of them down to one so paragraph breaks survive.

What it does
Removes blank lines or collapses runs of them
You give it
A list or document with unwanted gaps
You get back
Tightened text with a count of the lines removed
Best for
Cleaning pasted lists, exports and copied web content
Text Tools Free, unlimited use No sign-up Runs in your browser

About the Remove Empty Lines

Blank lines arrive with almost every copy-paste. A web page gives you one between every row, a PDF gives you two, and an export gives you a line that looks empty but actually contains a space — which is why the obvious find-and-replace does not catch it.

This tool removes lines that contain nothing, and lines that contain nothing but whitespace, which is the case most tools miss. You can strip every blank line for a tight list, or collapse runs of them down to a single blank line, which is what you want when the blank lines are real paragraph breaks and only the doubled-up ones are noise.

Key features of the Remove Empty Lines

Catches whitespace-only lines

A line containing just a space looks empty and is treated as empty, which is the case a plain find-and-replace never matches.

Collapse instead of delete

Turn runs of blank lines into a single one so real paragraph breaks stay while the extra gaps go.

Trailing newline handled

Blank lines at the end are removed, with a switch to keep the single trailing newline that linters expect.

Content lines untouched

Everything that is not blank passes through exactly as it was, indentation included.

Counts the removal

How many lines went, and how many are left, reported alongside the result.

How to use the Remove Empty Lines

  1. 1

    Paste your text or list

    Any text with unwanted gaps between the lines.

  2. 2

    Pick how far to go

    Remove every blank line, or collapse runs of them down to one to keep paragraph breaks.

  3. 3

    Include whitespace-only lines

    Lines containing only spaces or tabs look empty and are removed too, unless you say otherwise.

  4. 4

    Copy the result

    Copy the tightened text, with a count of how many lines were removed.

Frequently asked questions

Because they are not actually empty — they contain a space or a tab. Searching for two consecutive line breaks will not match a line break, a space, and another line break. This tool treats whitespace-only lines as blank.

Reviews of the Remove Empty Lines

What people who use the Remove Empty Lines think of it. Reviews come from visitors and are posted as written.

No ratings yet

Yours would be the first.

  • 5 0 reviews rated 5 stars
  • 4 0 reviews rated 4 stars
  • 3 0 reviews rated 3 stars
  • 2 0 reviews rated 2 stars
  • 1 0 reviews rated 1 star

Write a review

Used this tool? Your rating helps the next person decide.

Your rating

Plain text only — links, email addresses and HTML are not accepted. Your name and review are shown publicly; nothing else is collected. See the privacy policy.

0 reviews

Newest first

No reviews yet

Be the first to rate the Remove Empty Lines. It takes half a minute and no account.

Write the first review

More text tools