Line Counter

Count the lines in any text — total, blank, non-blank, unique and duplicate — and add line numbers.

Total lines
0
Non-blank lines
0
Blank lines
0
Unique lines
0
Duplicate lines
0
Words
0
Characters
0
Longest line (chars)
0
No uploads. Your files stay on your device.

Free forever, no sign-up, no cookies. Buy me a coffee

How it works

Paste any text and the line counter tells you instantly how many lines it contains — total lines, non-blank lines, blank lines, plus how many of them are unique and how many are duplicates. Lines are split on newlines exactly like a text editor does (Windows CRLF, Unix LF and old Mac CR endings are all handled), so the total matches the last line number your editor shows. Use the options to ignore blank lines, trim leading and trailing spaces before comparing, or match duplicates case-insensitively.

The second box adds line numbers to your text with your choice of separator, a custom starting number and optional zero padding, ready to copy into a document or a chat message. Everything is computed in your browser with JavaScript — your text is never uploaded, stored or logged, so it is safe for logs, code and confidential lists.

Frequently asked questions

How do I count the number of lines in a text?

Paste or type the text into the box above. The line counter splits it on newlines as you type and shows the total number of lines, how many are blank, how many contain content, and how many are unique or duplicated. Nothing to install and no button to press.

Does the line counter count blank lines?

Yes — blank lines are counted and reported separately, so you see both the raw total (what your text editor shows as the last line number) and the number of lines that actually contain text. Tick "Ignore blank lines" to leave empty lines out of the total, and remember that a text ending in a newline has one final empty line.

How do I add line numbers to my text?

The Numbered lines box does it automatically: it mirrors your text with a number in front of every line. You can pick the separator (1:, 1., 1) or a tab), start counting from any number, and pad the numbers with zeros so they line up, then use Copy numbered lines to paste the result anywhere.

Report a bug