⭐ 0

Code Line Counter

Count lines in any text live as you type: total, non-empty and blank lines, plus longest and average line length.

Processed entirely in your browser — nothing you enter here is ever uploaded.

0
Total lines
0
Non-empty lines
0
Blank lines
0
Longest line (chars)
0
Average line length
Processing... 0%

Result

About this tool

Pasting source code into a line counter usually raises one specific question: how many lines actually contain code, as opposed to blank lines left for readability? This page opens the counter for exactly that use case.

Paste a file, a function or a diff and get the raw total line count (matching what your editor's gutter would show), the count of non-empty lines, and how many are blank — a quick way to sanity-check a file size limit, a code review budget, or a "no more than N lines per function" style rule. The longest-line figure also flags a line that may need wrapping.

The count runs locally: no source code is ever sent to a server. This tool only counts lines and characters — it does not parse syntax or detect comments, so "non-empty" means any line with a visible character, comment or code alike.

Example. The text a, a blank line, then b counts as 3 lines, 2 non-empty, 1 blank, longest length 1, and average length 0.7.

Limit. A completely empty box is reported as zero lines, while a lone newline is reported as two lines, matching editor line numbering.