Lines of Code Counter

Count the lines of code in a file or paste, separating code from blanks and comments.

A rough measure of size

Lines of code is a rough-and-ready measure of how big a codebase or file is. This counts the lines and separates them into actual code, blank lines and comments, which gives a more honest number than a raw line count — a file padded with blank lines and comments is not as large as it first appears.

Paste your code and see the breakdown.

A blunt metric, used sensibly

It is worth being honest that lines of code is a crude measure of almost anything that matters — it says nothing about quality, complexity or value, and judging productivity by it rewards verbose code over concise, well-thought-out code. Where it is genuinely useful is as a rough sense of scale: how big a file has grown, roughly how much there is to review, or comparing the size of two implementations. Treat the number as a ballpark for size, never as a measure of worth.

Lines of Code Counter FAQ

What does it separate the lines into?

Actual code, blank lines and comments, giving a more honest count than a raw total.

Is lines of code a good productivity measure?

No — it says nothing about quality or value, and rewards verbose code. It is only a rough measure of size.

Is my code uploaded?

No. The counting happens in your browser.

More Developer tools