# leanprover-community/mathlib4 SLOC report

> As of 2026-09-11 (commit 4b627f034993), leanprover-community/mathlib4 contains 2,225,310 total lines: 1,445,638 code, 386,839 comments, 392,833 blank, across 8,363 files in 10 languages (top: Lean 99.5%). Counted with tokei via OctoCounts.

OctoCounts produced this report by resolving leanprover-community/mathlib4 to commit 4b627f034993, downloading the repository source archive, and counting every source file with tokei, the open-source line counter written in Rust. The table below breaks the count down by programming language into files, total lines, code lines, comment lines, and blank lines, so the figures can be compared across languages and projects. Results are cached by commit, tokei version, and analysis options, so counting the same revision again reproduces exactly these numbers.

## Repository size insights

This is a very large codebase by counted code lines. Code represents 65.0% of all lines, comments represent 17.4%, and the repository averages 173 code lines per file. Lean accounts for 99.5% of counted code.

| Language | Files | Lines | Code | Comments | Blanks |
| --- | ---: | ---: | ---: | ---: | ---: |
| Lean | 8,298 | 2,210,700 | 1,438,387 | 380,978 | 391,335 |
| Python | 20 | 7,119 | 5,508 | 484 | 1,127 |
| JSON | 3 | 929 | 929 | 0 | 0 |
| TeX | 2 | 379 | 321 | 0 | 58 |
| Shell | 7 | 366 | 250 | 67 | 49 |
| YAML | 1 | 214 | 206 | 7 | 1 |
| BASH | 3 | 33 | 21 | 3 | 9 |
| TOML | 2 | 18 | 16 | 0 | 2 |
| Markdown | 25 | 1,005 | 0 | 755 | 250 |
| Plain Text | 2 | 4,547 | 0 | 4,545 | 2 |

Top language (Lean 99.5%). Generated at 2026-09-11T22:18:01.021094704+00:00. Canonical report: https://octocounts.com/github/leanprover-community/mathlib4

## Report FAQ

### How many lines of code does leanprover-community/mathlib4 have?

leanprover-community/mathlib4 has 2,225,310 total lines, including 1,445,638 code lines, 386,839 comment lines, and 392,833 blank lines.

### How was the leanprover-community/mathlib4 line count measured?

OctoCounts resolved the public GitHub repository to commit 4b627f034993, downloaded the source archive, counted it with tokei, and cached the report by commit, tokei version, and analysis options.

### What commit was counted for leanprover-community/mathlib4?

This OctoCounts report was generated from 4b627f0349938c16df37afa592c456b0a7a74fef at commit 4b627f034993 on 2026-09-11T22:18:01.021094704+00:00.

## Similar repository reports

- [tristanbuckmaster/fluid_lean](https://octocounts.com/github/tristanbuckmaster/fluid_lean) — Lean, 1,578,291 code lines
- [anthropics/fermats-last-theorem](https://octocounts.com/github/anthropics/fermats-last-theorem) — Lean, 12,213,865 code lines
- [v8/v8](https://octocounts.com/github/v8/v8) — C++, 1,568,934 code lines
- [FFmpeg/FFmpeg](https://octocounts.com/github/FFmpeg/FFmpeg) — C, 1,564,504 code lines
- [diegosouzapw/OmniRoute](https://octocounts.com/github/diegosouzapw/OmniRoute) — JSON, 1,600,047 code lines
- [can1357/oh-my-pi](https://octocounts.com/github/can1357/oh-my-pi) — JSON, 1,606,157 code lines

## Related OctoCounts pages

- [Recently analyzed repositories](https://octocounts.com/recent)
- [Popular SLOC reports](https://octocounts.com/popular)
- [Trending GitHub repositories](https://octocounts.com/trending)
- [Hall of Monoliths](https://octocounts.com/hall-of-monoliths)
- [GitHub SLOC counter guide](https://octocounts.com/docs/github-sloc-counter)
- [Counting methodology](https://octocounts.com/docs/methodology)
- [OctoCounts API docs](https://octocounts.com/docs/api)
