Count code lines
Paste code and pick the language for comment syntax. Counts live.
Paste code above to see the counts.
Measure your code with the Code Line Counter. Paste source code to count code, comment and blank lines, plus characters and words.
Paste code and pick the language for comment syntax. Counts live.
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.
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.