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.

Loading…

How to use Line Counter

  1. 1

    Type or paste your text

    Paste a log, list or any text with line breaks.

  2. 2

    Watch the live count

    Line totals, blanks and lengths update instantly.

  3. 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.

Category: Text

Related tools

Last updated 7 August 2026