Code Line Counter
Count code, blank lines, and comments in pasted snippets.
Count what is really in your code
Lines of code is a rough metric, but sometimes you just need the number — for an estimate, a report, or a quick sense of a file’s size. This counter breaks a pasted snippet into total lines, blank lines, and comment lines so the count reflects actual code, not filler.
Separating comments and blanks gives a truer picture than a raw line total, which is easily inflated by whitespace and documentation. Paste any snippet and get an instant breakdown, useful for sizing tasks and comparing implementations.
What counts as a line
It reports total lines and separates blank and comment lines from real code, so the number means something in an estimate. Your code is counted in the browser and never uploaded.
Frequently asked questions
How does it tell code from comments?
A line counts as a comment when it starts with a comment marker for the chosen language, such as // or /* for JavaScript, <!-- for HTML, or # for hash-style languages. Empty lines count as blank.
Does it count comments at the end of a line of code?
No. A line with code and a trailing comment counts as code, which matches how most line-count tools report it.
Can I count a whole project?
It is built for pasted snippets and single files. For a whole repository, use a command-line tool like cloc.
Related tools
Practical utilities for everyday web development work.