Code Line Counter (SLOC)

Count code, comment and blank lines in any source file.

Support
Works Offline
Privacy First
No Login
No API

Source code

Line statistics

SLOC
6
Code lines
4
Comment lines
2
Blank lines
2
Total lines
8
Characters
95
Words
19
Longest line
23
Tab-indented lines
0
Comment density: 33%

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 1

Keyboard 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

Frequently asked questions

Version 1.0.0 · Updated 2026-08-25 · Runs entirely in your browser