# torvalds/linux SLOC report

> As of 2026-09-19 (commit 40288c9206c1), torvalds/linux contains 42,559,111 total lines: 32,345,368 code, 4,866,282 comments, 5,347,461 blank, across 89,143 files in 50 languages (top: C 60.8%). Custom configuration (tests excluded, docs excluded, generated excluded). Counted with tokei via OctoCounts.

torvalds/linux has 32,345,368 source lines of code out of 42,559,111 total lines across 89,143 files, counted from the master ref at commit 40288c9206c1 by the OctoCounts tokei engine on 2026-09-19. The report is cached by commit, tokei version, and analysis options, so recounting the same revision returns exactly these numbers.

OctoCounts produced this report by resolving torvalds/linux to commit 40288c9206c1, 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.4%, and the repository averages 363 code lines per file. C accounts for 60.8% of counted code.

| Language | Files | Lines | Code | Comments | Blanks |
| --- | ---: | ---: | ---: | ---: | ---: |
| C | 36,771 | 26,393,137 | 19,666,162 | 2,924,126 | 3,802,849 |
| C Header | 27,033 | 10,715,299 | 8,313,853 | 1,604,899 | 796,547 |
| Device Tree | 6,461 | 2,153,393 | 1,769,535 | 93,850 | 290,008 |
| ReStructuredText | 4,046 | 833,645 | 632,910 | 0 | 200,735 |
| JSON | 1,047 | 613,592 | 613,590 | 0 | 2 |
| YAML | 5,790 | 663,333 | 541,466 | 24,430 | 97,437 |
| GNU Style Assembly | 1,324 | 370,632 | 269,852 | 56,872 | 43,908 |
| Shell | 1,063 | 211,014 | 146,797 | 26,669 | 37,548 |
| Rust | 488 | 128,263 | 97,729 | 14,240 | 16,294 |
| Python | 391 | 115,576 | 90,488 | 7,210 | 17,878 |
| Makefile | 3,173 | 87,416 | 60,765 | 13,578 | 13,073 |
| SVG | 87 | 57,503 | 56,094 | 1,311 | 98 |

Top language (C 60.8%). Generated at 2026-09-19T10:04:21.571428294+00:00. Canonical report: https://octocounts.com/github/torvalds/linux

## Reproduce this report

[Reproduce this exact report and configuration](https://octocounts.com/github/torvalds/linux/commit/40288c9206c17eb66a603262e06a58d300d0f279?analysis=%7B%22ignoredDirs%22%3A%5B%5D%2C%22ignoredLanguages%22%3A%5B%5D%2C%22profile%22%3A%22default%22%2C%22includeDocs%22%3Afalse%2C%22includeTests%22%3Afalse%2C%22includeGenerated%22%3Afalse%7D).

## Report FAQ

### How many lines of code does torvalds/linux have?

torvalds/linux has 42,559,111 total lines, including 32,345,368 code lines, 4,866,282 comment lines, and 5,347,461 blank lines.

### How was the torvalds/linux line count measured?

OctoCounts resolved the public GitHub repository to commit 40288c9206c1, 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 40288c9206c1 on 2026-09-19T10:04:21.571428294+00:00.

## Similar repository reports

- [DeusData/codebase-memory-mcp](https://octocounts.com/github/DeusData/codebase-memory-mcp) — C, 13,187,848 code lines
- [gcc-mirror/gcc](https://octocounts.com/github/gcc-mirror/gcc) — C, 11,245,820 code lines
- [reactos/reactos](https://octocounts.com/github/reactos/reactos) — C, 7,377,603 code lines
- [vcvkk/Telegram-iOS](https://octocounts.com/github/vcvkk/Telegram-iOS) — C, 5,661,625 code lines
- [TelegramMessenger/Telegram-iOS](https://octocounts.com/github/TelegramMessenger/Telegram-iOS) — C, 5,285,043 code lines
- [yugabyte/yugabyte-db](https://octocounts.com/github/yugabyte/yugabyte-db) — C, 4,654,940 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)
- [Neovim vs VS Code](https://octocounts.com/compare/neovim-vs-vscode)
- [MongoDB vs PostgreSQL](https://octocounts.com/compare/mongodb-vs-postgres)
- [GitHub SLOC counter guide](https://octocounts.com/docs/github-sloc-counter)
- [Counting methodology](https://octocounts.com/docs/methodology)
- [SLOC and code metrics glossary](https://octocounts.com/docs/glossary)
- [Original research: how filtering changes SLOC counts](https://octocounts.com/research)
- [OctoCounts API docs](https://octocounts.com/docs/api)
