Code Line Counter
Count total, blank, comment, and code lines in any pasted code with language auto-detection.
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 Paste your source code into the textarea.
- 2 The tool auto-detects the language and displays a label.
- 3 Override the language using the dropdown if detection is incorrect.
- 4 Read the four counters: Total, Blank, Comment, and Code lines.
- 5 Check the progress bars to visualise the proportion of each category.
Perguntas frequentes
Formate, valide e minifique JSON — com localização precisa de erros de sintaxe.
Teste expressões regulares com destaque de correspondências em tempo real, grupos de captura e modo de substituição.
Gere UUID v4, UUID v7, ULIDs e Nano IDs — geração em massa com um clique.