# esbuild vs SWC: source lines of code compared

The esbuild vs SWC comparison on OctoCounts shows side-by-side source line counts for evanw/esbuild and swc-project/swc, 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-12, evanw/esbuild contains 247,349 total lines (168,648 code) across 318 files, while swc-project/swc contains 1,984,273 total lines (1,615,015 code) across 1,866 files as of 2026-09-16. swc-project/swc is about 9.6x the size of evanw/esbuild by code lines. Code size is not code quality: a larger count only means more source material, not a better or worse project.

| Metric | [evanw/esbuild](https://octocounts.com/github/evanw/esbuild) | [swc-project/swc](https://octocounts.com/github/swc-project/swc) |
| --- | ---: | ---: |
| Files | 318 | 1,866 |
| Total lines | 247,349 | 1,984,273 |
| Code lines | 168,648 | 1,615,015 |
| Comment lines | 53,449 | 190,571 |
| Blank lines | 25,252 | 178,687 |
| Languages counted | 11 | 12 |

Top languages in evanw/esbuild: Go (69.6% of code), JavaScript (17.3% of code), JSON (6.8% of code). Top languages in swc-project/swc: JavaScript (43.4% of code), TypeScript (27.4% of code), Rust (20.2% of code). JavaScript, JSON, TypeScript appear in both top language lists; Go, Makefile appear only in evanw/esbuild's top languages; Rust, TSX appear only in swc-project/swc's top languages.

Methodology: both counts come from cached OctoCounts reports generated with tokei. evanw/esbuild was counted at ref 8f506d5ca6882f2fa96a4a7233ab9784af0a5298 (commit 8f506d5ca688) on 2026-09-12; swc-project/swc was counted at ref 81e0d7d4119a1e45c1750621e8c54558089a5d9b (commit 81e0d7d4119a) on 2026-09-16. See the [counting methodology](https://octocounts.com/docs/methodology) for ignored directories and analysis options.
## About this comparison

evanw/esbuild counts the esbuild repository: a bundler, minifier, and JavaScript/TypeScript toolchain written in Go. swc-project/swc counts the SWC repository: a compiler and toolchain written in Rust, with its JavaScript/TypeScript packages alongside the native core. Both are single-purpose build-tool repositories with their tests and bindings in-tree, counted on the dates above.

Each per-language table reduces to essentially one row: esbuild's counted code is Go, and SWC's counted code is predominantly Rust, so the totals read directly as the size of each single-language toolchain implementation.

Both repositories include bindings and wrapper packages for other ecosystems (TypeScript/JavaScript API surfaces, test fixtures), so part of each count exists to expose the native core to consumers rather than to parse or bundle code itself.

_Repository size here says nothing about build speed or output size: both tools advertise native-code performance, which is a property of the shipped binaries and the code they process, not of the source line counts on this page._

Sources: [evanw/esbuild repository (Go toolchain)](https://github.com/evanw/esbuild) · [swc-project/swc repository (Rust core with TypeScript/JavaScript packages)](https://github.com/swc-project/swc). Statements verified 2026-09-16.

Evidence and next steps:

- [evanw/esbuild SLOC report](https://octocounts.com/github/evanw/esbuild)
- [swc-project/swc SLOC report](https://octocounts.com/github/swc-project/swc)
- [Compare evanw/esbuild and swc-project/swc interactively](https://octocounts.com/compare?left=https%3A%2F%2Fgithub.com%2Fevanw%2Fesbuild&right=https%3A%2F%2Fgithub.com%2Fswc-project%2Fswc)

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, evanw/esbuild or swc-project/swc?

swc-project/swc has more code: 1,615,015 code lines versus 168,648 for evanw/esbuild, about 9.6x 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 evanw/esbuild, swc-project/swc, or any repository.

### How is this comparison calculated?

Methodology: both counts come from cached OctoCounts reports generated with tokei. evanw/esbuild was counted at ref 8f506d5ca6882f2fa96a4a7233ab9784af0a5298 (commit 8f506d5ca688) on 2026-09-12; swc-project/swc was counted at ref 81e0d7d4119a1e45c1750621e8c54558089a5d9b (commit 81e0d7d4119a) 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)
