Line Counter

Line Counter tells you how many lines a block of text contains, split into total lines, non-empty lines, empty lines and unique lines. It handles Windows (CRLF), Unix (LF) and old Mac (CR) line endings automatically.

Everything runs in your browser, so you can safely paste logs, code, CSV rows or lists without anything being uploaded.

0
Total lines
0
Non-empty
0
Empty
0
Unique

How to use Line Counter

  1. 1

    Paste your text

    Drop in a list, log file, CSV or any multi-line text.

  2. 2

    Read the line stats

    See total lines, non-empty lines, empty lines and how many lines are unique.

  3. 3

    Use it to verify counts

    Confirm a file has the expected number of rows or that a list matches a target length.

How lines are counted

A line is any run of text terminated by a line break. The counter splits on CRLF, LF and CR so the result is the same whether the text came from Windows, macOS or Linux.

"Non-empty" lines are those containing at least one non-whitespace character; "empty" lines are blank or whitespace-only. "Unique" counts how many distinct lines appear, which is useful for spotting duplicates.

Common uses

Developers count lines of code or log entries; data folks check that a CSV has the expected number of rows; writers verify list lengths. Because the unique count is shown too, you can immediately tell whether a list contains repeats.

Frequently asked questions

Does a trailing newline add an extra line?
A trailing newline creates a final empty line in the total count, mirroring how most editors display it. The non-empty count ignores it.
Which line endings are supported?
All three: Windows (CRLF), Unix/macOS (LF) and classic Mac (CR). Mixed endings in the same text are handled correctly.
Is my text sent to a server?
No. Counting happens entirely in your browser.

Last updated: