How many lines of code are in a modern AAA video game?
Guess before you scroll — the answer is below
The answer
20,000,000 lines
Roughly 20M.
A modern AAA game runs to roughly 20 million lines of code, comparable to a car’s software or a commercial airliner’s. Most of it is not gameplay: engines, tooling, physics, netcode and platform certification requirements dominate.
How to get close to this number
Anchor on other large software. A modern car runs on the order of a hundred million lines and an operating system tens of millions, while a small application is in the tens of thousands. A large game is a real-time simulation with graphics, physics, audio, networking and tooling, which places it squarely in the tens of millions.
The composition in the explanation is the part people get wrong. Most of the code is not gameplay — it is the engine, the content pipeline, the physics, the networking and the certification requirements each platform imposes. The visible part of a game, the rules and the levels, is a small fraction of what has to be written to ship it.
Line counts are a poor metric and it is worth saying so. They vary with language, with formatting conventions, and with how much generated or third-party code is counted, and a team can halve or double the number without changing what the software does. These figures come from developer postmortems rather than audits, which makes them illustrative of scale and nothing more precise.
Where this number comes from
| Source | Developer postmortems reported in the games press |
|---|---|
| Figure refers to | 2023 |
| Last checked | |
| Unit | lines |
Numbers move. If this one has drifted from its source, let us know.
Think you can do better?
Five fresh questions every day. No account needed.
Related questions
- What is the Rubik’s Cube world record, in seconds?
- How many minutes is the Super Mario Bros speedrun world record?
- How many hours does an average Elden Ring playthrough take?
- How many hours does it take to complete a Pokémon game’s Pokédex?
- How many hours does it take to fully complete The Witcher 3?
- How many hours did the longest recorded Monopoly game last?