Line Counter
Our free line counter instantly counts the number of lines in your text, along with non-empty lines, blank lines, total characters, longest line length and average line length. It handles Windows and Mac line endings automatically. Perfect for logs, code, CSV exports and any line-based text. Everything runs in your browser, so your text never leaves your device.
How to use Line Counter
- 1
Type or paste your text
Paste a log, list or any text with line breaks.
- 2
Watch the live count
Line totals, blanks and lengths update instantly.
- 3
Read the breakdown
See total, non-empty, blank lines plus average and longest line length.
Why use a line counter?
When you need to know exactly how many lines are in a log file, a list or pasted source code, an instant count beats scanning by eye. This tool also separates blank lines from real content so you get a useful breakdown, not just one number.
How are lines counted?
Lines are split on newline characters, handling both Windows (CRLF) and Unix (LF) endings. A single trailing newline is not counted as an extra empty line, matching how editors count the same text.
Examples
Log file
- Input
- A pasted log with many entries
- Output
- Total lines, blank lines and longest line
Reviewing code
- Input
- Count lines of pasted source
- Output
- Separates blank from non-empty lines
Frequently asked questions
Are blank lines included in the count?
Total lines includes everything. We also show non-empty lines and blank lines separately, so you can quickly see how much is real content versus gaps.
Does a trailing newline add a line?
No. A single newline at the very end of your text is not counted as a phantom empty line, matching how editors report line counts.
Is my text uploaded anywhere?
No. Your text is processed entirely in your browser and never leaves your device.
More text tools
Case Converter
Client-SideConvert text to uppercase, lowercase, Title Case, Sentence case, camelCase, PascalCase, kebab-case and snake_case instantly. Free and 100% private.
Character Counter
Client-SideCount characters, letters, digits, punctuation and words instantly. Includes a no-spaces count. Free, fast and 100% private in your browser.
Find & Replace
Client-SideFind and replace text instantly with optional case-sensitivity and whole-word matching. Free, offline tool that never uploads your text.
Random Text Generator
Client-SideGenerate lorem-style random text — words, sentences or paragraphs — in one click. Free, instant and fully private in your browser.
Remove Duplicate Lines
Client-SideRemove duplicate lines from any text instantly. Keeps the first occurrence and reports how many lines were removed. Free and 100% private.
Remove Extra Spaces
Client-SideClean up messy text: collapse multiple spaces, trim every line and remove blank lines. Free, instant and 100% private in your browser.
Related tools
Character Counter
Client-SideCount characters, letters, digits, punctuation and words instantly. Includes a no-spaces count. Free, fast and 100% private in your browser.
Word Counter
Client-SideCount words, characters, sentences and paragraphs instantly. Includes reading time and top keywords. Free, fast and fully private.
Case Converter
Client-SideConvert text to uppercase, lowercase, Title Case, Sentence case, camelCase, PascalCase, kebab-case and snake_case instantly. Free and 100% private.
Last updated 7 August 2026