Count and Profile Your Lines
Count lines in any text
What is Line Counter?
Count the lines in any text and profile them: total, blank, non-blank, unique and duplicate, plus every line over a width limit you choose. A bare line count is rarely the real question; people usually arrive because something downstream has a limit, so the tool also lists which lines exceed it, finds the longest and shortest, and exports the whole table as CSV. Paste text or drop a file; large logs are handled without an upload because the work happens in this tab.
How do I use Line Counter?
- Paste text, or drop a file onto the box.
- Set the width limit you care about; 80 is the usual lint default.
- Filter to over-limit, duplicate or blank lines.
- Copy or download the per-line report as CSV.
When should I use Line Counter?
Reach for this when checking a file against a width limit, hunting duplicates, or sizing a log. To remove the duplicates rather than count them, use Remove Duplicates. For words and reading time rather than lines, use Word Counter. For per-character limits, use Character Counter.
Frequently asked questions
Does a trailing newline add a line?
Yes, and that matches what your editor shows. Text ending in a newline puts the cursor on a new line, so it counts as one more line, blank. Tools that report otherwise disagree with every editor you use.
How are Windows and Mac line endings handled?
All three conventions are treated identically. A carriage return followed by a line feed is one break, not two, so a file saved on Windows counts the same as the same file saved on Linux.
What counts as a blank line?
A line that is empty or contains only whitespace. Both are reported together, because a line of spaces is almost always intended to be blank.
Why does an emoji count as one character and not two?
Because lengths are measured in grapheme clusters, the characters a reader sees. A naive length would report 2 for an emoji, and 2 for an accented letter stored in decomposed form, which would wrongly push lines over a width limit.
How are duplicates decided?
By exact line text, with surrounding whitespace ignored by default and case respected by default. Both are toggles, so you can match trailing-space differences or ignore capitalisation as needed.
How large a file can it handle?
It is bounded by your own memory rather than by an upload limit, because the file is read in this tab and never sent anywhere. The on-screen table shows the first 500 matching lines to stay responsive; the CSV export contains every one.
Is my file uploaded anywhere?
No. Everything runs in your browser. Your files never leave your device, and there is no server component for this tool.
Tools that pair well with Line Counter
- Word Counter words, characters, reading time, free and in your browser.
- Character Counter per-char counting & limits, free and in your browser.
- Duplicate Line Remover remove duplicate lines, free and in your browser.
- Line Sorter alphabetical / reverse / natural, free and in your browser.