Ferramentas Guias
Developer Gratuito Sem cadastro

Code Line Counter

Count total, blank, comment, and code lines in any pasted code with language auto-detection.

Carregando ferramenta…

Sobre esta ferramenta

The Code Line Counter analyses pasted source code and breaks it down into four categories: total lines, blank lines, comment lines, and actual code lines. It automatically detects the programming language based on syntax patterns and applies the correct comment rules — double-slash (//) for JavaScript, TypeScript, Java, C, C++, C#, and Swift; hash (#) for Python, Ruby, Shell, and YAML; double-dash (--) for SQL and Lua; block comments (/* … */) for C-family languages; and HTML/XML comments (<!-- … -->). Results are displayed with progress bars showing the proportion of each line category, making it easy to gauge comment density and blank-line ratio at a glance. Useful for code review, metrics reporting, estimating documentation coverage, or satisfying coding standards that require a minimum comment ratio.

Como usar

  1. 1 Paste your source code into the textarea.
  2. 2 The tool auto-detects the language and displays a label.
  3. 3 Override the language using the dropdown if detection is incorrect.
  4. 4 Read the four counters: Total, Blank, Comment, and Code lines.
  5. 5 Check the progress bars to visualise the proportion of each category.

Perguntas frequentes

{# Alpine.js — self-hosted. (The previous jsdelivr CDN tag had a stale SRI integrity hash, so the browser refused to run it and window.Alpine was never defined — silently breaking every FAQ accordion and Alpine tool.) #}