torvalds/linux SLOC report
As of 2026-08-18 (commit 0f23d56f17fd), torvalds/linux contains 42,000,560 total lines: 31,909,768 code, 4,810,453 comments, 5,280,339 blank, across 88,191 files in 50 languages (top: C 60.9%). Counted with tokei via OctoCounts.
OctoCounts produced this report by resolving torvalds/linux to commit 0f23d56f17fd, 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 76.0% of all lines, comments represent 11.5%, and the repository averages 362 code lines per file. C accounts for 60.9% of counted code.
| Language | Files | Lines | Code | Comments | Blanks |
|---|
| C | 36406 | 26072387 | 19423573 | 2889428 | 3759386 |
| C Header | 26769 | 10584294 | 8208772 | 1585999 | 789523 |
| Device Tree | 6343 | 2097489 | 1724191 | 92402 | 280896 |
| ReStructuredText | 3996 | 820255 | 622485 | 0 | 197770 |
| JSON | 1036 | 606527 | 606525 | 0 | 2 |
| YAML | 5673 | 648586 | 529504 | 23888 | 95194 |
| GNU Style Assembly | 1322 | 370555 | 269808 | 56845 | 43902 |
| Shell | 1047 | 206024 | 143489 | 25726 | 36809 |
| Rust | 465 | 121031 | 92236 | 13582 | 15213 |
| Python | 384 | 111602 | 87281 | 7058 | 17263 |
| Makefile | 3157 | 86287 | 59939 | 13465 | 12883 |
| SVG | 87 | 57503 | 56094 | 1311 | 98 |
Top language (C 60.9%). Generated at 2026-08-18T09:53:26.380214079+00:00.
Report FAQ
How many lines of code does torvalds/linux have?
torvalds/linux has 42,000,560 total lines, including 31,909,768 code lines, 4,810,453 comment lines, and 5,280,339 blank lines.
How was the torvalds/linux line count measured?
OctoCounts resolved the public GitHub repository to commit 0f23d56f17fd, downloaded the source archive, counted it with tokei, and cached the report by commit, tokei version, and analysis options.
What commit was counted for torvalds/linux?
This OctoCounts report was generated from master at commit 0f23d56f17fd on 2026-08-18T09:53:26.380214079+00:00.