Remove Empty Lines

Paste text and every blank line is deleted, including lines that look empty but contain spaces or tabs. All other lines stay exactly as they were, and the tool tells you how many lines it removed.

Characters
0
Words
0
Lines
0

Your text never leaves your device.

How to use

  1. Paste the text, list, code or CSV data into the box.
  2. Blank lines disappear from the result immediately; the status line shows how many were removed.
  3. Copy the result or download it as a .txt file.

Examples

  • Before
    line one line two line three
    After
    line one line two line three
  • Before
    name,email Anna,anna@example.com Ben,ben@example.com
    After
    name,email Anna,anna@example.com Ben,ben@example.com

What the tool removes and keeps

A line is removed when it has no visible characters: nothing at all, or only spaces, tabs and other whitespace. Every other line is kept as is, including its indentation and any spaces at its end. Line endings are not converted, so a file with Windows line breaks keeps them.

Removing a line closes the gap: the next line moves up. Nothing is reordered, merged or trimmed.

When you need it

  • Lists copied from documents and web pages often have a blank line between every item. Remove the blanks to get one item per line, ready for a spreadsheet column or a deduplication pass.
  • CSV files with empty rows can break imports: many tools read a blank line as a record with empty values.
  • Code and config files that collected blank lines after a merge or a find-and-replace.
  • Text from emails and chat exports, where every paragraph is separated by two or three empty lines.

Common mistakes

  • Removing blank lines from Markdown. In Markdown an empty line separates paragraphs, list blocks and headings. Without it, two paragraphs merge into one when the page is rendered.
  • Removing them from code where they matter. Blank lines are harmless in most languages, but some formats depend on them: email headers end at the first blank line, and many plain-text formats use blank lines between records.
  • Expecting lines with dots or dashes to go. A line with “—” or “…” has visible characters and stays. Delete such separators with find and replace.
  • Looking for the count of lines left. The status shows removed lines; the line counter under the result shows how many remain.

Frequently asked questions

How do I remove blank lines from text?

Paste the text into the box above. Every empty line is deleted and the remaining lines close up, in their original order. The status line shows how many lines were removed.

Does a line with only spaces count as empty?

Yes. A line that contains only spaces, tabs or non-breaking spaces looks empty and is removed too. A line with any visible character, even a single period, is kept.

What is the difference from removing line breaks?

Removing empty lines keeps every line of text on its own line and only deletes the blank ones in between. Removing line breaks joins all lines into one block of text. For a list, you almost always want to remove empty lines.

Can I keep one empty line between paragraphs?

Not with this tool: it removes every blank line. To reduce several blank lines to exactly one, use find and replace in regex mode with the pattern \n{3,} and the replacement \n\n.

How do I delete blank rows in Excel?

Select the column, press F5 (Go To) → Special → Blanks, then right-click a selected cell and choose Delete → Entire row. For text data pasted from a spreadsheet, this tool is quicker: paste, copy, done.