Code Line Counter (SLOC)
Count code, comment and blank lines in any source file.
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.
Popular uses
- sloc
- line of code counter
- count code lines
- comment lines
- code statistics
Examples
JS file
JavaScript// 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
Android APK Analyzer & Explorer
Dev Utilities
Open an APK, decode its manifest and browse or download every file inside.
Archive Extractor & File Explorer
Dev Utilities
Unzip ZIP, TAR, GZ, 7Z, RAR and more in your browser — browse folders, preview and download files.
Code Diff Merger
Dev Utilities
Side-by-side line diff of two code snippets with stats.
Source Code Explorer & Editor
Dev Utilities
Browse and edit source archives with syntax colors, code search, syntax trees and dependency graphs.
.editorconfig Generator
Dev Utilities
Create an .editorconfig file with per-language overrides.
.htaccess Redirect Generator
Dev Utilities
Generate Apache .htaccess redirect and rewrite rules.
Frequently asked questions
Version 1.0.0 · Updated 2026-08-25 · Runs entirely in your browser