# NestJS vs Fastify: source lines of code compared

The NestJS vs Fastify comparison on OctoCounts shows side-by-side source line counts for nestjs/nest and fastify/fastify, 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, nestjs/nest contains 123,736 total lines (101,739 code) across 1,930 files, while fastify/fastify contains 14,756 total lines (10,995 code) across 80 files as of 2026-09-16. nestjs/nest is about 9.3x the size of fastify/fastify by code lines. Code size is not code quality: a larger count only means more source material, not a better or worse project.

| Metric | [nestjs/nest](https://octocounts.com/github/nestjs/nest) | [fastify/fastify](https://octocounts.com/github/fastify/fastify) |
| --- | ---: | ---: |
| Files | 1,930 | 80 |
| Total lines | 123,736 | 14,756 |
| Code lines | 101,739 | 10,995 |
| Comment lines | 11,567 | 2,188 |
| Blank lines | 10,430 | 1,573 |
| Languages counted | 11 | 5 |

Top languages in nestjs/nest: TypeScript (68.6% of code), JSON (30.7% of code), JavaScript (0.2% of code). Top languages in fastify/fastify: JavaScript (74.6% of code), TypeScript (23.2% of code), JSON (2.0% of code). TypeScript, JSON, JavaScript appear in both top language lists; GraphQL, YAML appear only in nestjs/nest's top languages; Shell, Markdown appear only in fastify/fastify's top languages.

Methodology: both counts come from cached OctoCounts reports generated with tokei. nestjs/nest was counted at ref 8e03a7dee8e5438d84b243557eda89bb36492fe7 (commit 8e03a7dee8e5) on 2026-09-16; fastify/fastify was counted at ref 630acd0b6cf8a91322ff05c3d95feb991091866d (commit 630acd0b6cf8) on 2026-09-16. See the [counting methodology](https://octocounts.com/docs/methodology) for ignored directories and analysis options.
## About this comparison

nestjs/nest counts the NestJS monorepo: the framework packages, its tooling, and sample material, written predominantly in TypeScript. fastify/fastify counts the Fastify core repository — the HTTP framework, its plugins within the core repo, and tests — written predominantly in JavaScript. The two sit at different layers: NestJS is an architecture framework that can delegate HTTP serving to a Node.js HTTP framework such as Fastify or Express.

The per-language tables show the implementation-language split plainly: NestJS is a TypeScript codebase, while Fastify core remains largely JavaScript — a reflection of each project's chosen source language rather than a difference in capability.

NestJS's count includes framework abstractions over HTTP, routing, and dependency injection, whereas Fastify's count is the HTTP framework layer those abstractions build on, so the two totals describe adjacent parts of a stack rather than rivals at one layer.

_Because NestJS can run on top of Fastify, the two repositories are not competitors in the count: reading the totals as framework-vs-framework size misses that one can contain the other at runtime._

Sources: [nestjs/nest repository (framework monorepo)](https://github.com/nestjs/nest) · [fastify/fastify repository](https://github.com/fastify/fastify). Statements verified 2026-09-16.

Evidence and next steps:

- [nestjs/nest SLOC report](https://octocounts.com/github/nestjs/nest)
- [fastify/fastify SLOC report](https://octocounts.com/github/fastify/fastify)
- [Compare nestjs/nest and fastify/fastify interactively](https://octocounts.com/compare?left=https%3A%2F%2Fgithub.com%2Fnestjs%2Fnest&right=https%3A%2F%2Fgithub.com%2Ffastify%2Ffastify)

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, nestjs/nest or fastify/fastify?

nestjs/nest has more code: 101,739 code lines versus 10,995 for fastify/fastify, about 9.3x 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 nestjs/nest, fastify/fastify, or any repository.

### How is this comparison calculated?

Methodology: both counts come from cached OctoCounts reports generated with tokei. nestjs/nest was counted at ref 8e03a7dee8e5438d84b243557eda89bb36492fe7 (commit 8e03a7dee8e5) on 2026-09-16; fastify/fastify was counted at ref 630acd0b6cf8a91322ff05c3d95feb991091866d (commit 630acd0b6cf8) on 2026-09-16. 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)
