# Rust vs Go: source lines of code compared

As of 2026-09-13, rust-lang/rust contains 3,188,401 total lines (2,725,343 code) across 8,410 files, while golang/go contains 2,911,025 total lines (2,070,053 code) across 9,252 files as of 2026-09-07. rust-lang/rust is about 1.3x the size of golang/go by code lines. Code size is not code quality: a larger count only means more source material, not a better or worse project.

| Metric | [rust-lang/rust](https://octocounts.com/github/rust-lang/rust) | [golang/go](https://octocounts.com/github/golang/go) |
| --- | ---: | ---: |
| Files | 8,410 | 9,252 |
| Total lines | 3,188,401 | 2,911,025 |
| Code lines | 2,725,343 | 2,070,053 |
| Comment lines | 218,417 | 611,871 |
| Blank lines | 244,641 | 229,101 |
| Languages counted | 12 | 12 |

Top languages in rust-lang/rust: Rust (76.4% of code), JSON (12.9% of code), XML (5.8% of code). Top languages in golang/go: Go (91.0% of code), GNU Style Assembly (6.8% of code), Snakemake (1.0% of code). JSON, YAML appear in both top language lists; Rust, XML, Shell appear only in rust-lang/rust's top languages; Go, GNU Style Assembly, Snakemake appear only in golang/go's top languages.

Methodology: both counts come from cached OctoCounts reports generated with tokei. rust-lang/rust was counted at ref main (commit 67e8d9d65f33) on 2026-09-13; golang/go was counted at ref master (commit 38d1265e1a01) on 2026-09-07. See the [counting methodology](https://octocounts.com/docs/methodology) for ignored directories and analysis options.
## About this comparison

rust-lang/rust counts the Rust repository: the compiler (largely Rust itself), standard library, tooling, and a very large test suite. golang/go counts the Go repository: compiler toolchain, standard library, and runtime, also with its own test suites. Both are language toolchain monorepos, counted with the same engine and configuration on the dates above, which makes this one of the more like-for-like comparisons on this site.

Both repositories are self-hosting toolchains whose counted code is dominated by each project's own language, as the per-language tables show; the shares of C and assembly that remain mark the bootstrap and runtime boundaries each project still maintains by hand.

A large fraction of both trees is test material — the rustc test suite and the Go toolchain tests — so both counts substantially measure correctness infrastructure, not just shipped compiler code.

_Compiler repository size does not measure language quality, compile speed, or runtime performance — those are properties of the shipped toolchain and the programs it produces, not of the source tree's line count._

Sources: [rust-lang/rust repository](https://github.com/rust-lang/rust) · [golang/go repository](https://github.com/golang/go). Statements verified 2026-09-08.

Evidence and next steps:

- [rust-lang/rust SLOC report](https://octocounts.com/github/rust-lang/rust)
- [golang/go SLOC report](https://octocounts.com/github/golang/go)
- [Compare rust-lang/rust and golang/go interactively](https://octocounts.com/compare?left=https%3A%2F%2Fgithub.com%2Frust-lang%2Frust&right=https%3A%2F%2Fgithub.com%2Fgolang%2Fgo)

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, rust-lang/rust or golang/go?

rust-lang/rust has more code: 2,725,343 code lines versus 2,070,053 for golang/go, about 1.3x as much, based on cached OctoCounts reports as of 2026-09-13.

### 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 rust-lang/rust, golang/go, or any repository.

### How is this comparison calculated?

Methodology: both counts come from cached OctoCounts reports generated with tokei. rust-lang/rust was counted at ref main (commit 67e8d9d65f33) on 2026-09-13; golang/go was counted at ref master (commit 38d1265e1a01) on 2026-09-07. 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)
- [GitHub SLOC counter guide](https://octocounts.com/docs/github-sloc-counter)
- [Counting methodology](https://octocounts.com/docs/methodology)
- [OctoCounts API docs](https://octocounts.com/docs/api)
