ocloc – Rust command-line utility that counts lines of code

ocloc is a Rust command-line utility that counts lines of code across a codebase and presents the results in a clear, high-performance report.

It’s positioned as a modern alternative to cloc, with support for fast parallel analysis, detailed statistics, and a diff mode that can compare changes between Git references for CI and review workflows.

This is free and open source software.

Key Features

  • Counts code, comment, and blank lines across source trees.
  • Recognizes 50+ programming languages and file formats.
  • Respects .gitignore rules automatically.
  • Supports table, JSON, CSV, and Markdown output formats.
  • Includes a diff mode for comparing changes between Git refs.
  • Offers options such as progress display, extension filtering, custom ignore files, and thread control.

Website: github.com/adhishthite/ocloc
Support:
Developer: Adhish Thite
License: MIT License


Related Software

Alternatives to cloc
TokeiDisplays statistics about your code
sccFast accurate code counter with complexity calculations and COCOMO estimates
SLOCCountSet of tools for counting physical Source Lines of Code
goclocA compact fast cloc tool seeking inspiration from Tokei
loccountRe-implementation of David A. Wheeler’s sloccount tool in Go
locRust implementation of cloc, but it’s more than 100x faster
tcountCount your code by tokens and patterns in the syntax tree
slocSimple tool to count source lines of code written in CoffeeScript
polyglotCommand-line tool that determines project contents
enryProgramming language detector based on go-enry
LinguistAssess a repository’s languages stats with github-linguist executable
CLOCTUITUI for CLOC
Best Free and Open Source Software Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.

This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk.

You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more.

Discovered a useful open source Linux program that we haven’t covered yet? Let us know by completing this form.
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments