How to use the lines of code counter
Paste your code, choose a comment syntax, and the page splits the input into total lines, blank lines, comment-only lines, lines carrying both code and a comment, and plain code lines. Source lines of code is the sum of plain code lines and mixed lines. The table shows how the first forty lines were classified, so you can see exactly why a number came out the way it did.
How the counting works
Each line is read character by character while the quote and block-comment states carry across lines. A comment marker inside a string is not treated as a comment, and a block comment keeps its state over as many lines as it spans. The syntax you selected is printed with the results so the rule in force is never implicit. Blank lines count as blank even inside a block comment, which follows common practice. As of October 2026.
Limits worth knowing
Only the comment syntaxes in the list are recognized, and no other language is guessed at. Template literal interpolation, regular expression literals, heredocs, raw strings and nested block comments are not implemented, so classification can drift on code that uses them heavily. Because no authoritative standard exists for comment share or lines per language, the ratios carry no judgment. Everything is processed in your browser.
Frequently Asked Questions
No. Quotes are tracked, so a string such as "https://example.com" counts as code. Template literal interpolation and regular expression literals are not implemented, so if your code leans on those, spot-check a few rows in the classification table.
There is no authoritative figure for the right comment share in any language. That is why this page reports the ratio and attaches no verdict. If you need a comparison, measure other files in the same repository.
It does not estimate effort or cost, and it does not score complexity. There is no file upload or repository-wide total either; it classifies the lines you paste and stops there.