Favicon of cloc

cloc

Count blank lines, comments, and source code across files, directories, archives, and git repositories. Supports 600+ languages with detailed breakdowns.

cloc is a command-line tool that analyzes source code composition by counting blank lines, comment lines, and physical lines of code. It works with over 600 programming languages and provides detailed metrics for understanding code structure and documentation levels.

Key capabilities include:

  • Count individual files, entire directories, or compressed archives
  • Analyze specific git commits and repositories
  • Generate language-by-language breakdowns with file counts
  • Process multiple projects in batch operations
  • Support for Windows, macOS, and Linux environments

Available in multiple formats:

  • Standalone Windows executable (no dependencies)
  • Perl source code (requires Perl interpreter)
  • Docker image for containerized environments
  • Package manager installations for various operating systems

The tool provides structured output showing files, blank lines, comments, and code lines organized by programming language. This makes it valuable for code audits, project metrics, documentation assessment, and codebase analysis. Whether you're evaluating project complexity, tracking code quality metrics, or understanding repository composition, cloc delivers comprehensive statistics in seconds.

Features

JSON outputScriptable

Media

Pros

4
  • Counts lines of code, blank lines, and comments
  • Supports over 600 programming languages
  • Works on files, directories, archives, and git repositories
  • Provides detailed breakdowns by language

Related tools

Categories:

Share:

Auto-fetched .

Recent releases

Similar to cloc

Favicon

 

  
 
Favicon

 

  
 
Favicon