What it counts
| Number | What it means |
|---|---|
| Lines | Every line, including empty ones. A single line break at the very end is not counted as an extra line. |
| Non-empty lines | Lines with at least one visible character. Lines with only spaces count as empty. |
| Unique lines | Different non-empty lines. Capitals and extra spaces are ignored unless you switch that off. |
| Duplicate lines | Non-empty lines that repeat an earlier line. |
| Words | Letters or digits, joined by apostrophes or hyphens, so don't and e-mail each count as one word. |
| Characters | Every character, with spaces and line breaks. Most emoji count as one; flags and combined emoji (skin tones, families) count as several, as they do in most character counters. |
| Longest line | The length of the longest line, and which line it is. |
Add line numbers
The right-hand box shows your text with a number at the start of each line. Choose the style: 1. ,
1) , 1: , a number and a tab (pastes into two Excel columns), or zero-padded 001.
Turn on Do not number empty lines to number only the lines with text.
Counting lines elsewhere
In Excel, =COUNTA(A:A) counts the non-empty cells of a column. On Mac or Linux, wc -l file.txt
counts line breaks, which can be one fewer than the lines you see if the last line has no break. This page counts the
lines you see.
Related tools
Questions
How do I count the number of lines in a text?
Paste it into the box. The Lines figure updates as you type.
Are empty lines counted?
Lines counts all of them. Non-empty lines leaves out empty lines and lines with only spaces.
How do I count unique lines?
Look at Unique lines. Duplicate lines shows how many lines repeat an earlier one.
Can I add line numbers to my text?
Yes. The result box adds them; pick the number style and copy it.