Home / Text tools / Non-empty line counter

Non-Empty Line Counter

Count the lines that have content, and get a copy of your text with the empty lines removed.

0Non-empty lines
0Blank lines
0Unique non-empty lines
0Duplicate lines

Count what matters

Lists, logs and exports often contain blank lines that inflate the total. This page counts only the lines that have content, and shows how many blank lines were skipped. A line with only spaces or tabs counts as blank unless you untick that option.

Find duplicates

The counter also reports unique non-empty lines and duplicate lines. If you paste a list of 100 entries and see 92 unique lines, you know eight entries are repeats.

Get a cleaned copy

The box below the results holds your text with every empty line removed. Copy it in one click to tidy a list, remove gaps from pasted text, or prepare data for an import.

Example

A list with the lines apple, a blank line, banana, a blank line and apple has 3 non-empty lines, 2 blank lines, 2 unique lines and 1 duplicate.

For the total line count see the line counter. For source code use the code line counter. The guide to counting lines shows the same count on the command line.

Frequently asked questions

What is a non-empty line?

A line that contains at least one character. By default, lines with only spaces or tabs are treated as empty.

How are duplicate lines found?

Lines are compared after trimming spaces at the start and end. Matching is case sensitive.

Does the cleaned copy change my lines?

No. Lines keep their original text. Only the empty lines are removed.