Skip to main content
Programming Language Tools

Code Line Counter

Count total, blank, non-blank, and comment lines in any pasted code.

Paste your code below - this tool counts total, blank, non-blank, and (optionally) comment lines.

Comment-line detection uses common single-line comment markers (//, #, --) - it's a reasonable approximation, not a full language-aware parser.

What Does This Tool Count?

Total line count, blank lines, non-blank lines, and (based on common comment markers like //, #, or --) an estimate of comment-only lines.

Why Use This Tool?

A quick, practical way to gauge a file's size or estimate how much of it is actual code versus comments/whitespace, without needing to open it in an IDE with a line-count feature.

How to Use It

  1. Paste your code.
  2. Click Count.
  3. Review the total/blank/non-blank/comment line breakdown.

Limitations

Comment detection looks for common single-line comment markers at the start of a trimmed line - it doesn't parse multi-line block comments or understand any specific language's full comment syntax perfectly.

Share this tool: