Line Counter
Count the lines in any text and number them — live, in your browser.
About the Line Counter Tool
What does this tool do?
It counts the lines in whatever you paste and breaks the number down so it actually means something. The moment you start typing you get the total line count plus how many lines have content, how many are blank, how many are unique, and how many are duplicates — along with the word and character totals. There's nothing to click; the figures update as you go.
On top of the count, it can hand you a numbered copy of your text. Pick a numbering style, choose where the count starts, and decide whether blank lines get a number, then copy the result straight out. It all runs in your browser, so even a long log or a full document stays private and the numbers appear instantly.
How to Use This Tool
- Add your text. Paste it into the left box, drag in a
.txtfile, or hit Sample to see it work. - Read the counts. The cards at the top show total, non-empty, blank, unique, and duplicate lines, plus words and characters.
- Number the lines (optional). Choose a numbering style and a starting number; the numbered text appears on the right.
- Handle blank lines. Keep Don't number blank lines on to skip empties, or turn it off to number every line.
- Take the result. Copy the numbered output or download it as a text file.
Common Use Cases
Knowing exactly how many lines you have settles a lot of small questions:
- Checking a record count: Confirm how many rows are in an export or a list before importing it.
- Counting log entries: See how many lines a log dump has, and how many are blank or repeated.
- Spotting duplicates at a glance: The unique and duplicate counts tell you instantly whether a list has repeats.
- Numbering a list: Turn a plain list into a numbered one for steps, references, or documentation.
- Meeting line limits: Check that a file or block stays within a required number of lines.
Need to act on the lines? Try Remove Duplicate Lines or Sort Lines Alphabetically, or count words and characters with the Word Counter.
Frequently Asked Questions
How does it count lines?
It counts a new line every time there's a line break, so the total matches the number of rows you see in the box. Both Windows (CRLF) and Unix or Mac (LF) line endings are handled. A single line of text with no break counts as one line, and empty input counts as zero.
What's the difference between unique and duplicate lines?
Unique counts the distinct lines — how many different values appear. Duplicate is the rest: the total minus the unique count, i.e. how many lines are repeats of one that already appeared. Together they tell you at a glance how much of your list is repetition.
Does a blank line count as a line?
Yes, blank lines are included in the total line count, and they're also tallied separately under Blank so you can see how many there are. When you number the output, the Don't number blank lines option lets you leave those empties unnumbered.
Can I add line numbers to my text?
Yes. Choose a numbering style — "1.", "1)", "1 -", "1:", or a zero-padded "01." — and the right-hand box shows your text with numbers in front of each line. You can set the starting number, or pick No numbering to leave the text untouched.
Is my data private?
Completely. Every count happens locally in your browser with JavaScript — nothing you paste is uploaded, stored, or logged, and the tool keeps working offline once the page has loaded.