How many lines of code does Google’s codebase have?
Guess before you scroll — the answer is below
The answer
2,000,000,000 lines
Roughly 2B.
Google’s codebase runs to roughly 2 billion lines, held in a single repository. Printed at 50 lines a page it would be a stack of paper about four kilometres tall. Thousands of engineers commit to it every day.
How to get close to this number
Scale up from a single product. A large application runs to millions of lines; a company operating dozens of large products plus the infrastructure underneath them, over two decades, accumulates two orders of magnitude more. Billions is the right scale for an organisation of that size with that history.
The single-repository detail in the explanation is the genuinely unusual engineering fact. Almost every organisation splits its code across many repositories; keeping billions of lines in one requires custom tooling that does not exist anywhere else, and the trade-off is that any engineer can change anything, with all the power and risk that implies.
The printed-stack comparison is the right way to make the figure physical, and it is the technique this site uses repeatedly: convert an incomprehensible count into a length, a duration or a mass. Note that the figure comes from a 2016 paper and has certainly grown since — it is the last public disclosure rather than a current number.
Where this number comes from
| Source | Potvin & Levenberg, Communications of the ACM |
|---|---|
| Figure refers to | 2016 |
| 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 median U.S. fixed broadband download speed, in Mbps?
- How many petaflops does the fastest supercomputer on the June 2026 TOP500 list run at?
- How many charge cycles does a smartphone battery last?
- How many minutes does a fast charger take to charge an EV to 80%?
- How many active Android devices are there worldwide?
- How many active satellites were orbiting Earth in mid-2026?