How Much Does All Code Weigh? Estimate: Several Grams
A physicist calculated the physical mass of every line of code ever written on Earth — the answer is smaller than you'd expect.
Here's an absurdly fun physics question: if you took every line of code ever written and stored it as stable matter, how much would it weigh? A researcher at CERN did the calculation, and the answer is weirdly profound. They estimated approximately 10^17 lines of code exist globally (including all the code in GitHub, corporate systems, legacy enterprise software, research codebases). If you encoded this in DNA (the densest known data storage medium), the entire history of human software would weigh roughly 200 grams.
This isn't just a thought experiment — it reveals something humbling about human achievement. Despite decades of development, millions of programmers, and trillions of lines of code, the physical substrate of humanity's collective programming effort weighs as much as a heavy book. It highlights how immaterial software actually is. That weight calculation assumes biological DNA as storage. Using more exotic methods like topological qubits or engineered nucleotides, you could fit it in even less mass. The implication: software is pure abstraction and information, unburdened by physical constraints. Which makes you realize how strange it is that we still think about server storage in terms of physical hardware — a philosophical artifact from the 1990s.
Of course, the energy cost of storing and executing that code is enormous. Every gigabyte of data requires power to run. Every computation burns electricity. So while software is weightless, its infrastructure isn't.