This line counter analyses any pasted text — code, lists, CSV rows or log files — and reports six figures at once: total lines, non-empty lines, empty lines, blank (whitespace-only) lines, unique lines and the longest line length. It is handy for verifying list sizes, finding duplicates and checking line-length limits.
How it works
The tool normalises every line ending (CRLF, lone CR and LF all become a single newline) and removes one trailing newline so the count matches your editor. It then splits the text on newlines and walks each line:
| Metric | Definition |
|---|---|
| Total lines | Number of lines after splitting |
| Non-empty lines | Lines with at least one non-whitespace character |
| Empty lines | Lines with zero characters |
| Blank lines | Lines containing only whitespace (includes empty) |
| Unique lines | Number of distinct line values |
| Longest line | Character length of the longest line |
An empty line has length 0; a blank line may contain spaces or tabs and looks empty but is not, so the two are reported separately.
Example
Given this five-line text (one trailing newline, ignored):
First line
Second line
First line
| Metric | Value |
|---|---|
| Total lines | 5 |
| Non-empty | 3 |
| Empty | 1 |
| Blank | 2 |
| Unique | 4 |
“First line” appears twice, so unique is 4 rather than 5. All counting happens locally in your browser — nothing is uploaded.