# Tokei

> Count your code, quickly.

Source: https://talira.ai/catalog/tokei-15jd36ra
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Command-line tool, Library
- Categories: [developer tools / cli / code analysis](https://talira.ai/categories/developer-tools/cli/code-analysis)
- Platforms: macos, linux, windows, cli
- Licence: Apache-2.0
- Pricing: Free and open source
- Free tier: yes
- Self-hostable: yes
- API: yes

Tokei displays statistics about your code: number of files, total lines, code, comments and blanks grouped by language. It is very fast, handles multi-line and nested comments correctly, supports over 150 languages, and can output CBOR, JSON or YAML. It is also usable as a Rust library.

## Links

- GitHub: https://github.com/XAMPPRocky/tokei

## Ways to install

### Package managers

- [Homebrew](https://talira.ai/catalog/homebrew-djy17yn9.md): <https://formulae.brew.sh/formula/tokei>[^1]
- [mise](https://talira.ai/catalog/mise-0axr08xw.md): <https://mise-versions.jdx.dev/tools/tokei>[^2]

## Problems it solves

- how many lines of code are in this repo, by language
- cloc is slow on a big monorepo
- count lines of code excluding comments and blank lines
- track codebase size over time in CI as JSON
- what languages is this project actually written in
- compare how much test code versus app code we have
- need a library to count source lines programmatically in Rust
- quick stats about an unfamiliar codebase I just cloned

## Features

- 150+ languages
- accurate comment handling
- JSON/YAML/CBOR output
- library API

## Capabilities

- Has an API: plan not known
- Has a command line tool: plan not known
- Has official SDKs: plan not known

## Trust

Overall: 0.54 out of 1.
Signals: maintenance 0.48, adoption 0.84, momentum 0.62, community 1.00, backing 0.00, extensibility 0.40.

- last commit 2 months ago
- 4 commits in the last 90 days
- latest release v15.0.0 2 months ago
- 15.1k GitHub stars
- 329 contributors
- accepts sponsorship (Github)

## Alternatives

- [cloc](https://talira.ai/catalog/cloc-g8028a91.md): cloc counts blank lines, comment lines, and physical lines of source code in many programming languages
- [hyperfine](https://talira.ai/catalog/hyperfine-54mq6pqw.md): A command-line benchmarking tool

## Sources

[^1]: https://formulae.brew.sh/api/formula.json (checked 21 Nov 2026)
[^2]: https://mise-versions.jdx.dev/tools.json (checked 21 Nov 2026)
