Text Tools
Line counter.
Paste text, a list, a log or a CSV column and count its lines: total, non-empty, blank and unique, plus the longest line and the average line length.
Input
Result
Paste text to count its lines.
About this line counter
A line is any run of text ended by a line break. Windows (CRLF), classic Mac (CR) and Unix (LF) endings all count as one break, so a file saved on any system gives the same number. A single line break at the very end of the text does not add an empty line, which matches how most editors number lines.
Worked example
apple
banana
apple
cherry
Total lines: 5. Non-empty: 4. Blank: 1. Unique non-empty lines: 3 (apple, banana, cherry). The longest line is 6 characters (banana, cherry).
What each number means
- Blank lines: lines that are empty or contain only spaces and tabs.
- Unique lines: distinct non-empty lines, compared exactly (case and spacing matter). To remove the repeats instead of counting them use Remove Duplicate Lines.
- Longest line: measured in user-perceived characters, so an emoji counts as one.
Limits
Lines are counted as they are written, not as they wrap on screen. Input is limited to 5 MB and stays on your device.
FAQ
How do I count the lines in a text?
Paste the text into the box. The total line count appears immediately, with the non-empty, blank and unique counts underneath.
Are blank lines counted?
Yes, in Total lines. The tool also shows how many are blank, so you can subtract them if you only want lines with content.
Does it work with Windows and Mac line endings?
Yes. CRLF, CR and LF are each treated as one line break, so the count does not change between systems.