What it counts
The counter splits your text at every line break and reports the total number of lines, the non-empty lines, the blank lines, the length of the longest line and the average line length. It also detects which line endings your text uses. Results update as you type, and nothing leaves your browser.
How lines are defined
- A line is any run of text ended by a line break. A final line break does not add an extra empty line.
- Wrapped text is not counted twice. A long sentence that wraps on screen is still one line.
- By default, a line with only spaces or tabs counts as blank. Untick the option to count it as a line with content.
Why other tools show a different number
Counts differ for three common reasons. Some tools count the empty line after a final line break. Some count wrapped screen lines instead of real lines. Others count only line break characters, so a last line without a break is missed. This tool counts real lines and tells you which line ending style it found.
Example
The text one, two, three on separate lines, followed by a blank line and then four, has 5 lines in total: 4 with content and 1 blank.
Common uses
Check the length of a poem, script or log file, confirm that a list has the expected number of entries, or find unusually long lines before importing data.
Need to ignore empty lines? Use the non-empty line counter. To count source code, comments and blanks separately, try the code line counter. See the guide to counting lines for command line methods, or count words with the word frequency counter.