# Astro vs Next.js: source lines of code compared

The Astro vs Next.js comparison on OctoCounts shows side-by-side source line counts for withastro/astro and vercel/next.js, 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-22, withastro/astro contains 370,323 total lines (257,670 code) across 6,042 files, while vercel/next.js contains 911,204 total lines (735,853 code) across 8,332 files as of 2026-09-22. vercel/next.js is about 2.9x the size of withastro/astro by code lines. Code size is not code quality: a larger count only means more source material, not a better or worse project.

| Metric | [withastro/astro](https://octocounts.com/github/withastro/astro) | [vercel/next.js](https://octocounts.com/github/vercel/next.js) |
| --- | ---: | ---: |
| Files | 6,042 | 8,332 |
| Total lines | 370,323 | 911,204 |
| Code lines | 257,670 | 735,853 |
| Comment lines | 59,445 | 85,192 |
| Blank lines | 53,208 | 90,159 |
| Languages counted | 12 | 12 |

Top languages in withastro/astro: TypeScript (70.7% of code), YAML (9.9% of code), Astro (9.2% of code). Top languages in vercel/next.js: Rust (33.5% of code), TypeScript (30.6% of code), TSX (11.3% of code). TypeScript, JSON, JavaScript appear in both top language lists; YAML, Astro appear only in withastro/astro's top languages; Rust, TSX appear only in vercel/next.js's top languages.

Methodology: both counts come from cached OctoCounts reports generated with tokei. withastro/astro was counted at ref 8bf6f1af679947ffbc702db26425f3f13a7f3040 (commit 8bf6f1af6799) on 2026-09-22; vercel/next.js was counted at ref canary (commit becee66e9b71) on 2026-09-22. See the [counting methodology](https://octocounts.com/docs/methodology) for ignored directories and analysis options.
## About this comparison

withastro/astro counts the Astro core repository: the static-site generator, its rendering and island integrations, and the documentation included in the repo. vercel/next.js counts the Next.js monorepo — framework packages, examples, documentation site, and test suites. Both are framework repositories aimed at web content, but organized differently, and the counts were taken on the dates shown above.

Astro's counted code is written predominantly in TypeScript, as is Next.js's — the per-language tables show two projects in the same implementation language with different repository organization rather than different languages.

Next.js's count includes a large examples directory and its documentation site as part of the monorepo, so a visible share of its total exists to teach and demonstrate the framework rather than to ship as framework code.

_Both counts describe framework source trees, not the sites built with them; output size and runtime behavior of a site depend on its own content, components, and configuration, not on these repository totals._

Sources: [withastro/astro repository](https://github.com/withastro/astro) · [vercel/next.js repository structure (monorepo with examples and docs)](https://github.com/vercel/next.js). Statements verified 2026-09-16.

Evidence and next steps:

- [withastro/astro SLOC report](https://octocounts.com/github/withastro/astro)
- [vercel/next.js SLOC report](https://octocounts.com/github/vercel/next.js)
- [Compare withastro/astro and vercel/next.js interactively](https://octocounts.com/compare?left=https%3A%2F%2Fgithub.com%2Fwithastro%2Fastro&right=https%3A%2F%2Fgithub.com%2Fvercel%2Fnext.js)

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, withastro/astro or vercel/next.js?

vercel/next.js has more code: 735,853 code lines versus 257,670 for withastro/astro, about 2.9x as much, based on cached OctoCounts reports as of 2026-09-22.

### 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 withastro/astro, vercel/next.js, or any repository.

### How is this comparison calculated?

Methodology: both counts come from cached OctoCounts reports generated with tokei. withastro/astro was counted at ref 8bf6f1af679947ffbc702db26425f3f13a7f3040 (commit 8bf6f1af6799) on 2026-09-22; vercel/next.js was counted at ref canary (commit becee66e9b71) on 2026-09-22. 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)
