Line Counter

Count lines in text — total, empty, non-empty, and unique lines with line-by-line numbering.

0Total Lines
0Non-empty
0Empty Lines
0Unique Lines
0Duplicates
0Longest Line

About Line Counter

Line counting is a common task in text processing and software development. Whether you need to know how many lines a log file contains, how many non-empty entries are in a list, or how many duplicate lines exist in a data export, this tool gives you all those statistics in one click.

The numbered output adds line numbers to each line, which is useful for referencing specific lines in discussions, creating numbered lists, and debugging configuration files. It also makes it easy to identify which lines are duplicates by comparing their content.

Common use cases include counting entries in CSV files, measuring code length, counting items in imported data lists, and analyzing log files. The duplicate detection is particularly useful for data quality checks on imported datasets.

FAQ

Does the last line count if it has no newline?
Yes. The counter counts all content lines including the last one even if it doesn't end with a newline character. An empty file counts as 0 lines.
What counts as an empty line?
A line is considered empty if it contains only whitespace (spaces, tabs) or nothing at all. Lines with at least one non-whitespace character are counted as non-empty.