Code Line Counter (SLOC)
Count code, comment and blank lines in any source file.
Source code
Line statistics
About the Code Line Counter (SLOC)
Paste source code and get an instant SLOC breakdown: real code lines, comment lines, blank lines, characters, words, longest line and comment density. Supports C-style, hash, SQL and HTML comment syntaxes, including multi-line block comments.
Examples
JS file
// note
const a = 1;Output
Code 1, Comments 1Keyboard shortcuts
- Copy the main outputCtrl / ⌘ + Shift + C
- Download the resultCtrl / ⌘ + S
- Share this toolCtrl / ⌘ + Shift + S
- Reset the inputsAlt + R
- Open the tool search paletteCtrl / ⌘ + K
Related tools
.editorconfig Generator
Dev Utilities
Create an .editorconfig file with per-language overrides.
.htaccess Redirect Generator
Dev Utilities
Generate Apache .htaccess redirect and rewrite rules.
Android APK Analyzer & Explorer
Dev Utilities
Open an APK, decode its manifest and browse or download every file inside.
Android dp ↔ px ↔ sp Converter
Dev Utilities
Convert dp, px and sp across every Android density bucket.
Android Manifest Permissions Reference
Dev Utilities
Searchable Android permission list with protection levels and manifest snippets.
Bash Alias Generator
Dev Utilities
Create shell aliases for Bash, Zsh or Fish with correct quoting.
Frequently asked questions
Version 1.0.0 · Updated 2026-08-25 · Runs entirely in your browser