Code Line Counter (SLOC)

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

Support
Works Offline
Privacy First
No Login
No API

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

JavaScript// 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