# Three.js vs Babylon.js: source lines of code compared

The Three.js vs Babylon.js comparison on OctoCounts shows side-by-side source line counts for mrdoob/three.js and BabylonJS/Babylon.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-08-26, mrdoob/three.js contains 530,492 total lines (307,445 code) across 2,415 files, while BabylonJS/Babylon.js contains 1,121,189 total lines (782,343 code) across 7,018 files as of 2026-08-26. BabylonJS/Babylon.js is about 2.5x the size of mrdoob/three.js by code lines. Code size is not code quality: a larger count only means more source material, not a better or worse project.

| Metric | [mrdoob/three.js](https://octocounts.com/github/mrdoob/three.js) | [BabylonJS/Babylon.js](https://octocounts.com/github/BabylonJS/Babylon.js) |
| --- | ---: | ---: |
| Files | 2,415 | 7,018 |
| Total lines | 530,492 | 1,121,189 |
| Code lines | 307,445 | 782,343 |
| Comment lines | 91,425 | 209,173 |
| Blank lines | 131,622 | 129,673 |
| Languages counted | 7 | 12 |

Top languages in mrdoob/three.js: JavaScript (78.7% of code), HTML (14.0% of code), JSON (3.4% of code). Top languages in BabylonJS/Babylon.js: TypeScript (60.5% of code), TSX (13.8% of code), JSON (9.8% of code). JavaScript, JSON appear in both top language lists; HTML, SVG, CSS appear only in mrdoob/three.js's top languages; TypeScript, TSX, HLSL appear only in BabylonJS/Babylon.js's top languages.

Methodology: both counts come from cached OctoCounts reports generated with tokei. mrdoob/three.js was counted at ref dev (commit 919539e323b2) on 2026-08-26; BabylonJS/Babylon.js was counted at ref master (commit 16f79df9867f) on 2026-08-26. See the [counting methodology](https://octocounts.com/docs/methodology) for ignored directories and analysis options.
## About this comparison

mrdoob/three.js counts the Three.js repository: the rendering library, its examples and documentation pages, and utilities in one tree — the project deliberately keeps the core small. BabylonJS/Babylon.js counts the Babylon.js monorepo: the engine packages, loaders, materials, tooling, and their tests. Both are browser 3D rendering libraries, but the repositories are organized differently, which the counts and language tables above reflect.

The per-language tables show Three.js's counted code as predominantly JavaScript while Babylon.js's is predominantly TypeScript — a direct consequence of each project's chosen implementation language for the rendering core.

A large share of the Three.js count sits in its examples directory — demonstration scenes and documentation assets that exist to teach rather than to ship — while Babylon.js distributes its material across engine packages and sibling repositories, so the two totals are not organized along identical lines.

_Neither total measures rendering performance, feature coverage, or what an application loads at runtime: an app bundles only the parts of a library it imports, and both libraries ship modular entry points. Use these counts to sense each repository's size and structure, not to rank the libraries._

Sources: [mrdoob/three.js repository (library plus examples/)](https://github.com/mrdoob/three.js) · [BabylonJS/Babylon.js repository (packages monorepo)](https://github.com/BabylonJS/Babylon.js). Statements verified 2026-09-16.

Evidence and next steps:

- [mrdoob/three.js SLOC report](https://octocounts.com/github/mrdoob/three.js)
- [BabylonJS/Babylon.js SLOC report](https://octocounts.com/github/BabylonJS/Babylon.js)
- [Compare mrdoob/three.js and BabylonJS/Babylon.js interactively](https://octocounts.com/compare?left=https%3A%2F%2Fgithub.com%2Fmrdoob%2Fthree.js&right=https%3A%2F%2Fgithub.com%2FBabylonJS%2FBabylon.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, mrdoob/three.js or BabylonJS/Babylon.js?

BabylonJS/Babylon.js has more code: 782,343 code lines versus 307,445 for mrdoob/three.js, about 2.5x as much, based on cached OctoCounts reports as of 2026-08-26.

### 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 mrdoob/three.js, BabylonJS/Babylon.js, or any repository.

### How is this comparison calculated?

Methodology: both counts come from cached OctoCounts reports generated with tokei. mrdoob/three.js was counted at ref dev (commit 919539e323b2) on 2026-08-26; BabylonJS/Babylon.js was counted at ref master (commit 16f79df9867f) on 2026-08-26. 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)
