leanprover-community/mathlib4

leanprover-community/mathlib4 has 1,585,945 source lines of code out of 2,448,069 total lines across 9,291 files, counted from the master ref at commit a53bd51510b6 by the OctoCounts tokei engine on 2026-10-13. The report is cached by commit, tokei version, and analysis options, so recounting the same revision returns exactly these numbers.

As of 2026-10-13 (commit a53bd51510b6), leanprover-community/mathlib4 contains 2,448,069 total lines: 1,585,945 code, 431,211 comments, 430,913 blank, across 9,291 files in 10 languages (top: Lean 99.4%). Custom configuration (tests excluded, docs excluded, generated excluded). Counted with tokei via OctoCounts.

As of 2026-10-13 (commit a53bd51510b6), leanprover-community/mathlib4 contains 2,448,069 total lines: 1,585,945 code, 431,211 comments, 430,913 blank, across 9,291 files in 10 languages (top: Lean 99.4%). Custom configuration (tests excluded, docs excluded, generated excluded). Counted with tokei via OctoCounts.

OctoCounts produced this report by resolving leanprover-community/mathlib4 to commit a53bd51510b6, 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 64.8% of all lines, comments represent 17.6%, and the repository averages 171 code lines per file. Lean accounts for 99.4% of counted code.

LanguageFilesLinesCodeCommentsBlanks
Lean921424307311576866424783429082
Python25857667715121293
JSON31189118900
Shell9748509138101
TeX2379321058
YAML123923171
TOML26238204
BASH3302037
Markdown30158201217365
Plain Text24533045312

Top language (Lean 99.4%). Generated at .

Reproduce this report

Reproduce this exact report and configuration.

Report FAQ

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

leanprover-community/mathlib4 has 2,448,069 total lines, including 1,585,945 code lines, 431,211 comment lines, and 430,913 blank lines.

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

OctoCounts resolved the public GitHub repository to commit a53bd51510b6, 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 master at commit a53bd51510b6 on 2026-10-13T08:43:45.189542602+00:00.

Similar repository reports

Other public repositories with an OctoCounts report, ranked by top language and code size similarity:

Play the growth animation for leanprover-community/mathlib4 on this page — 1,585,945 code lines across 10 languages, counted by tokei.