# NumPy vs SciPy: source lines of code compared

The NumPy vs SciPy comparison on OctoCounts shows side-by-side source line counts for numpy/numpy and scipy/scipy, counted with the same engine and analysis options on the dates shown in the methodology line: files, total lines, code lines, comment lines, blank lines, and per-language totals, pinned to the exact commits listed below.

As of 2026-09-16, numpy/numpy contains 592,451 total lines (436,444 code) across 961 files, while scipy/scipy contains 696,420 total lines (536,098 code) across 1,334 files as of 2026-09-15. scipy/scipy is about 1.2x the size of numpy/numpy by code lines. Code size is not code quality: a larger count only means more source material, not a better or worse project.

| Metric | [numpy/numpy](https://octocounts.com/github/numpy/numpy) | [scipy/scipy](https://octocounts.com/github/scipy/scipy) |
| --- | ---: | ---: |
| Files | 961 | 1,334 |
| Total lines | 592,451 | 696,420 |
| Code lines | 436,444 | 536,098 |
| Comment lines | 103,433 | 90,781 |
| Blank lines | 52,574 | 69,541 |
| Languages counted | 12 | 12 |

Top languages in numpy/numpy: Python (44.2% of code), C (38.8% of code), C Header (7.2% of code). Top languages in scipy/scipy: Python (55.8% of code), C (20.4% of code), C++ (8.1% of code). Python, C, C Header, C++, Cython appear in both top language lists.

Methodology: both counts come from cached OctoCounts reports generated with tokei. numpy/numpy was counted at ref f2e0ef9e47a22ba39be5136ac6a94a4f39b25cbe (commit f2e0ef9e47a2) on 2026-09-16; scipy/scipy was counted at ref 884ac0b6fc53a70d023948287d34b76c7a559c62 (commit 884ac0b6fc53) on 2026-09-15. See the [counting methodology](https://octocounts.com/docs/methodology) for ignored directories and analysis options.
## About this comparison

numpy/numpy counts the NumPy repository — the ndarray implementation, its Python and C layers, tests, and documentation. scipy/scipy counts the SciPy repository — a library of scientific computing modules (optimization, integration, signal processing, and others) built on top of the array model NumPy provides. Both are scientific-Python library trees, counted on the dates in the methodology line.

The per-language tables of both reports show the two-layer implementation typical of scientific Python: Python as the dominant counted language with C underneath for the numerically hot paths of each library.

SciPy's tree spans many distinct submodules — one per problem domain — while NumPy's tree is organized around a single core array object and its operations, so the totals reflect breadth of scope versus depth of one abstraction.

_Line counts do not measure numerical performance or accuracy: those depend on the shipped release, the underlying compiled routines, and how a workload uses them — not on the size of either source tree._

Sources: [numpy/numpy repository](https://github.com/numpy/numpy) · [scipy/scipy repository](https://github.com/scipy/scipy). Statements verified 2026-09-16.

Evidence and next steps:

- [numpy/numpy SLOC report](https://octocounts.com/github/numpy/numpy)
- [scipy/scipy SLOC report](https://octocounts.com/github/scipy/scipy)
- [Compare numpy/numpy and scipy/scipy interactively](https://octocounts.com/compare?left=https%3A%2F%2Fgithub.com%2Fnumpy%2Fnumpy&right=https%3A%2F%2Fgithub.com%2Fscipy%2Fscipy)

Note: code size is not code quality. OctoCounts only reports reproducible line counts and makes no claim that either project is better.

## Compare FAQ

### Which has more lines of code, numpy/numpy or scipy/scipy?

scipy/scipy has more code: 536,098 code lines versus 436,444 for numpy/numpy, about 1.2x as much, based on cached OctoCounts reports as of 2026-09-16.

### Does more source lines of code mean more complexity?

Not necessarily. SLOC measures size, not complexity, quality, or maintainability. A larger codebase can mean more features, more generated or vendored code, more verbose language idioms, or more tests — none of which imply the code is harder to work with. Use SLOC to gauge the scale of what you'd be reading or maintaining, not as a quality signal for numpy/numpy, scipy/scipy, or any repository.

### How is this comparison calculated?

Methodology: both counts come from cached OctoCounts reports generated with tokei. numpy/numpy was counted at ref f2e0ef9e47a22ba39be5136ac6a94a4f39b25cbe (commit f2e0ef9e47a2) on 2026-09-16; scipy/scipy was counted at ref 884ac0b6fc53a70d023948287d34b76c7a559c62 (commit 884ac0b6fc53) on 2026-09-15. See the counting methodology for ignored directories and analysis options.

### Can I compare a different branch, tag, or commit?

Yes. This page shows the default branch for each repository. Use the interactive comparison tool to pick any public GitHub repository, branch, tag, or commit SHA for both sides and get a fresh side-by-side report.

## Related OctoCounts pages

- [Interactive repository comparison](https://octocounts.com/compare)
- [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)
- [Original research: how filtering changes SLOC counts](https://octocounts.com/research)
- [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)
- [OctoCounts API docs](https://octocounts.com/docs/api)
