Code Line Counter
Count total, blank, comment, and code lines in any pasted code with language auto-detection.
Acerca de esta herramienta
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.
Cómo 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.
Preguntas frecuentes
Formatea, valida y minifica JSON — con señalización exacta de errores de sintaxis.
Pruebe expresiones regulares con resaltado de coincidencias en tiempo real, grupos de captura y modo de reemplazo.
Genere UUID v4, UUID v7, ULID y Nano ID — generación masiva con un solo clic.