← Back to tools

tokei

Count your code quickly and accurately by language

Development Productivity linuxmacoswindows Rust MIT

Description

tokei is a fast code statistics tool that counts lines of code, comments, and blanks grouped by language. It supports over 150 languages and is significantly faster than alternatives like cloc.

Install

homebrewbrew install tokei
cargocargo install tokei
pacmansudo pacman -S tokei

AI Summary

A fast code statistics tool. Counts lines of code, comments, and blanks grouped by programming language with support for 150+ languages.

Capabilities

  • + Counts code, comments, and blank lines by language
  • + Supports 150+ programming languages
  • + Very fast, even on large codebases
  • + Output in multiple formats (JSON, YAML, CBOR)

Use When

  • Getting an overview of a codebase's language composition
  • Tracking code size metrics over time
  • Need a fast alternative to cloc

Avoid When

  • x Need detailed per-function or per-class metrics

Usage Patterns

Count lines in current project

tokei

Shows a table of languages, files, lines, code, comments, and blanks

Output as JSON

tokei -o json

Machine-readable JSON output for further processing

Input / Output

stdout: Table or structured output of code statistics
Exit codes:
0 Success
View AGENTS.md for tokei