Line Counter
Paste any text or code to count total lines, blank lines, non-empty lines and the longest line.
Total lines
4
Non-empty lines
3
Blank lines
1
Longest line
25 characters
Characters
49
How this was worked out
- How it countsLines are split on the newline character; the last line counts even without a trailing break.
Formula
Lines = text split on newline characters
Frequently asked questions
Yes.
Related tools
Keep going — these tools solve the problems that usually come next.
Word Counter
PopularCount words, characters, sentences, paragraphs and reading time.
Writing & Text
Character Counter
Count characters with and without spaces, plus bytes and limits.
Writing & Text
Sentence Counter
Count sentences and see their average length.
Writing & Text
Paragraph Counter
Count paragraphs and see how evenly your text is structured.
Writing & Text