Advertisement

Code Line Counter

Measure your code with the Code Line Counter. Paste source code to count code, comment and blank lines, plus characters and words.

Count code lines

Paste code and pick the language for comment syntax. Counts live.

Paste code above to see the counts.
Advertisement

How lines are classified

Blank lines contain only whitespace. A line is a comment when it starts with the language's comment marker or sits inside a block comment; everything else counts as code. Lines that mix code and trailing comments count as code, which matches how most LOC tools behave.

Approximation note

Comment detection is syntactic, not a full parser: comment markers inside string literals can confuse it. For quick size estimates and before/after comparisons it is accurate enough; for billing-grade metrics use a dedicated parser.

Code Line Counter FAQs

What is a line of code (LOC)?
Any non-blank, non-comment line. It is the classic rough measure of code size and change volume.
Why pick a language?
Comment syntax differs: // in JavaScript, # in Python, <!-- --> in HTML. The right choice keeps comment counts accurate.
Do mixed code+comment lines count as code?
Yes. A line like x = 1; // init counts as one code line, following common LOC conventions.
Can I count multiple files?
Paste them one at a time, or concatenate files with a separator line and count once for a project total.
Is my code uploaded?
No. Counting runs entirely in your browser.
Advertisement