Skip to content

Remove empty lines

Remove blank lines from text, optionally including lines that contain only spaces, tabs, or other whitespace.

Processed on your device

How it works & useful details

How to use this tool

Paste your text and remove empty lines. The remaining lines keep their spacing and order.

How the result is calculated

An empty line contains no characters. With the extra option enabled, JavaScript whitespace-only lines (including spaces, tabs, and nonbreaking spaces) are also removed. Zero-width space U+200B is not JavaScript whitespace.

Line tools normalize CRLF and CR to LF. A final newline represents an empty final line; empty input has zero lines.

Up to 500,000 UTF-16 code units per input. Text stays on your device.

About this tool

Remove empty lines deletes blank rows from text and can also remove lines that contain only spaces and tabs. It is the cleanup step after exporting a report or pasting content with stray gaps.

Whitespace-only detection is optional so you keep the lines that matter and drop only the ones that would confuse later processing. Cleaning happens locally.

How to use it

  1. Paste the text with blank lines.
  2. Choose whether lines containing only whitespace should also be removed.
  3. Run the cleanup and check the line count change.
  4. Copy or download the result.

Worked example

The text "one", empty line, a line of three spaces, "two", empty line, "three" becomes:

one
two
three

With "also remove whitespace-only lines" enabled, the line of spaces is removed too. Without it, that line stays, because it is not strictly empty.

Where blank lines come from

Text copied from PDFs, emails, and web pages often arrives with extra blank lines between paragraphs or list items. Spreadsheet exports can end with empty rows, and scraped data may alternate between values and blank lines. Removing them makes lists ready for sorting, deduplication, or import.

Some "empty-looking" lines contain a zero-width space (U+200B) or other invisible characters that are not whitespace. If a line refuses to disappear, run it through remove invisible characters first.

Frequently asked questions

What counts as an empty line?

A line with no characters at all. Whitespace-only lines are a separate option because a tab or space can be meaningful.

Are line endings normalized?

Line breaks are standardized so the output is consistent across editors.

What is the limit?

Up to 500,000 characters of text.

Can I keep single blank lines between paragraphs?

No. This tool removes every empty line. To collapse several blank lines into one instead, use find and replace: search for three line breaks, replace them with two, and repeat until nothing changes.