← Back to section · Research & Analysis

How '20 Million Qubits to Break RSA-2048' Was Calculated: A Walk Through Resource Estimation

We take apart the method chain behind Shor-algorithm resource estimates — from logical gate counts to surface-code error-correction overhead — and lay out the full assumption list behind Gidney–Ekerå's 2019 result of 20 million physical qubits and 8 hours, plus why later estimates keep shrinking.

Published 22 November 2026 · 6 min read · PQ Frontier

How '20 Million Qubits to Break RSA-2048' Was Calculated: A Walk Through Resource Estimation
AI-generated site artwork
Video explainer · Original Research: Analysis and Derivations

The most-quoted figure in “how many quantum computers does it take to break RSA-2048” headlines is Gidney and Ekerå’s 2019 conclusion: about 20 million physical qubits running for 8 hours. How was that number produced, which assumptions hold it up, and why have subsequent estimates kept shrinking? We walk through the estimators’ own method chain.

Layer one: logical resources at the algorithm level

Shor’s algorithm factors an n-bit integer, and its core cost sits in the quantum circuit for modular exponentiation. Algorithm-level estimation yields two quantities: the number of logical qubits (for RSA-2048, a few thousand, depending on the space–time trade-off of the multiplier circuits) and the number of non-Clifford gates (usually counted as Toffoli or T gates, of order 10^9–10^10). These numbers are set by circuit construction: a qubit-frugal multiplier lowers the qubit count while raising the gate count, and vice versa. Gidney–Ekerå used optimisations such as windowed arithmetic to press the Toffoli count to roughly 2.6×10^9 — a conclusion of pure mathematics and circuit design that depends on no hardware assumption and holds up best under scrutiny.

Layer two: error correction translates logical into physical

A logical qubit is not a physical qubit. In the surface code, at physical error rate p, driving the logical error rate low enough for the whole computation requires a code distance d that grows accordingly, and each logical qubit needs about 2d² physical qubits (including measurement ancillas). Substituting the assumed p = 0.1%, the code distance lands around 25–30, so one logical qubit costs on the order of one to two thousand physical qubits; and because T gates cannot be executed transversally, magic-state distillation factories must be built to manufacture magic states — factories that often consume a substantial share of the total physical qubits. A few thousand logical qubits, times the per-qubit correction overhead, plus the factories, yields a total in the tens of millions. Time follows the same pattern: total duration ≈ Toffoli count × physical cycles per gate (limited by code distance and distillation throughput) × the surface-code cycle time (assumed about 1 microsecond), and the product comes out in hours. “20 million” and “8 hours” are the product of this multiplication chain under the 2019 assumption set.

Running the same chain for ECC: no more comforting

Running the same multiplication chain for elliptic curves corrects a common impression — that ECC’s shorter keys make it either safer or less safe in a simple way. Shor’s algorithm for the 256-bit elliptic-curve discrete logarithm problem needs, at the algorithm layer, about 2,300 logical qubits by Roetteler and co-authors’ 2017 estimates — fewer than RSA-2048’s roughly 4,000 — with a Toffoli count about an order of magnitude lower; translated to the physical layer under identical correction assumptions, breaking P-256 takes roughly an order of magnitude fewer physical qubits and less time than RSA-2048. That is, in front of the same cryptographically relevant quantum computer, ECC and RSA fall within a modest multiple of each other, and the classical equivalence “256-bit ECC ≈ 3072-bit RSA” buys no extra grace period in the quantum world. This is also the methodological basis for migration roadmaps listing all classical public-key algorithms for replacement together rather than sequencing them by classical strength: the order should be set by the data’s secrecy lifetime and exposure, not by classical security bits.

The assumption list: what the number is most sensitive to

List the assumptions one by one: a physical error rate of 0.1% (if it degrades to 1%, the code distance and overhead climb steeply and the total qubit count can grow by an order of magnitude); a surface-code cycle of 1 microsecond (hardware platforms differ by orders of magnitude — superconducting versus ion traps); reaction times and classical decoding that keep up (otherwise the pipeline stalls); and distillation protocols and layout efficiencies at the then-mainstream choices. Change any single item and the product moves by a multiple. This is why estimates from different years can range from hundreds of millions down to hundreds of thousands of physical qubits — usually not conflicting conclusions, but different assumptions. The correct reading order for any estimate is: assumption list first, numbers second.

A reference line: a decade of estimates

Lining up representative estimates in time order shows the methodological evolution more clearly. In 2012, Fowler and co-authors, using the circuit and error-correction schemes of the day, estimated on the order of a billion physical qubits to factor RSA-2048 — the figure from when the surface-code overhead model had just taken shape. In 2019, Gidney–Ekerå cut the algorithm layer’s Toffoli count sharply and brought the physical count down to about twenty million with an eight-hour runtime, becoming the most-cited reference point since. In 2025, Gidney’s follow-up work claimed the same factoring with fewer than one million physical qubits, at the price of stretching the runtime from hours to the order of days to a week, using denser surface-code layouts and more efficient magic-state preparation (so-called magic-state cultivation). Read together, the three numbers do not primarily say “how many years sooner the threat arrives”; they demonstrate the sensitivity of the estimates to method: an improvement in any single layer — arithmetic circuits, code layout, distillation protocols — can pull the product down by an order of magnitude, and an assumption in any layer proving over-optimistic pushes it back up. Defence planning anchored to one point estimate is anchored to something that drifts; anchoring to the method and the range is the correct posture toward such numbers.

Why the estimates keep shrinking

Most of the progress after 2019 is at the algorithm layer: cheaper arithmetic circuits, trimming of the approximate quantum Fourier transform, and hybrid routes that combine factoring with lattice sieving (as in Ekerå and co-authors’ later work on short discrete logarithms and RSA variants), pressing Toffoli counts down by another one to two orders of magnitude; the correction layer has also gained more efficient distillation and encoding schemes. The direction deserves a clear head: falling estimates mean the cost of attack is falling, but every link of the multiplication chain is still on paper — no hardware yet combines millions of physical qubits with a 0.1% error rate. For defenders, the point is not any particular number but the method itself: run the same chain with your own data’s secrecy lifetime, and you have the input side of frameworks like the Mosca inequality covered elsewhere on this site.

Limits

This article walks through the estimation method and produces no new estimate of its own; the 2019 figures quoted are conclusions under their paper’s assumptions and should be cited together with those assumptions. Hardware progress will date the correction-layer assumptions, at which point the multiplication chain should be re-run with fresh parameters rather than rescaling old conclusions.

Sources

  • Gidney, C., Ekerå, M., “How to factor 2048 bit RSA integers in 8 hours using 20 million noisy qubits”, Quantum 5, 433 (2021) (journal version of the 2019 preprint).
  • Fowler, A. et al., “Surface codes: Towards practical large-scale quantum computation”, Phys. Rev. A 86, 032324 (2012) (surface-code overhead model).
  • Gidney, C., “How to factor 2048 bit RSA integers with less than a million noisy qubits”, arXiv:2505.15917 (2025) (the follow-up estimate pressing physical qubits below one million).
  • Roetteler, M. et al., “Quantum resource estimates for computing elliptic curve discrete logarithms”, ASIACRYPT 2017 (logical resource estimates for the ECC side).
  • NIST, Status Report on the Second Round of the NIST Post-Quantum Cryptography Standardization Process (NISTIR 8309), for the official framing of Shor-threat timelines.

Tags: Shor's AlgorithmResource EstimationFault-Tolerant Quantum ComputingRSA