What LOC stats mean
Lines of code (LOC) is the classic project-size metric — flawed but useful for estimates, code review load and "how much did we write". The useful split is code vs comment vs blank: high comment ratio often means a complex or well-documented file; high blank ratio suggests poor structure; a huge code count in one file is a refactor signal.
How the counting works
- Code lines — non-empty lines that aren't comments.
- Comment lines — full-line comments plus block-comment content (C-style
/* */or Python triple-quoted strings, per the picker). - Blank lines — whitespace-only.
- Inline comments (code + trailing
//) count as code — matching tokei/cloc behavior.
Real-world use
- Estimating effort: experienced devs write ~100–300 LOC/day net in mature codebases.
- Code review: a 1000-line file needs splitting more than a 100-line one, regardless of quality.
- Pair with the Word Counter for docs, or the SQL Formatter when tidying before the count.
Under the hood
The file is scanned line by line: newlines are normalised first, then each line is classified as blank, comment or code. Comment detection uses the prefix for the chosen language, and block comments carry a state flag across lines so their contents are not counted as code. The output separates total lines, blanks, comments and effective code lines, plus the comment ratio.
Formats, sizes and other limits
Prefix-and-state heuristics, not parsing. A // inside a string literal is counted as a comment, and template strings or regular-expression literals confuse it further. Mixed-language files — inline JavaScript or CSS inside HTML — are counted with one rule set. There is no complexity analysis and no judgement about code quality; the number is a rough size indicator, not a metric.
Privacy: nothing is uploaded
The file is counted line by line in the browser. Nothing is uploaded, which matters for proprietary source you are not free to share.
Frequently asked questions
Why is a string counted as a comment?
Because detection is prefix-based and does not parse the language. Template strings and regex literals are the usual culprits.
Which languages are covered?
Common comment prefixes: C-style, Python, shell, SQL and HTML among them. Unusual languages may need manual verification.
Does it measure complexity?
No. This counts line categories only; complexity needs a parser and a different metric.