Research Explained · Algorithms
How to Factor 2048 Bit RSA Integers in 8 Hours Using 20 Million Noisy Qubits
Craig Gidney and Martin Ekerå
Google; KTH Royal Institute of Technology and Swedish NCSA · 2021 (preprint 2019) · Difficulty ★★★★☆
Reference
Gidney, C., & Ekerå, M. (2021). How to factor 2048 bit RSA integers in 8 hours using 20 million noisy qubits. Quantum, 5, 433. arXiv:1905.09749.
Preprint: arXiv:1905.09749
This page is an independent explanation. For exact wording, figures, and data, read the original paper.
The short version
Gidney and Ekerå estimate that a quantum computer with 20 million noisy physical qubits could factor a 2048-bit RSA integer in about eight hours. The estimate was a hundredfold reduction in qubits from earlier work and became the standard reference for the cost of breaking RSA.
Key findings
- With a gate error rate of 0.1 percent, a surface-code cycle of 1 microsecond, and 10 microsecond classical reaction time, RSA-2048 needs about 20 million physical qubits and about 8 hours.
- The cost reduction comes from a combination of the Ekerå-Håstad short-exponent method, windowed arithmetic, oblivious carry runways, and an optimized surface-code layout.
- The estimate uses about 6,000 logical qubits and roughly 3 billion Toffoli gates.
- The paper compared the new cost with an estimate of about a billion qubits made in 2012, and with other schemes.
Background: why this paper was written
After Shor's algorithm showed that RSA is vulnerable, the question for security planners was when. That depends on the hardware needed. In 2012 Fowler, Mariantoni, Martinis, and Cleland had estimated that factoring a 2000-bit number would need about a billion physical qubits and a day of running, using the surface code, and later estimates by Jones and others lowered the number but the figures remained in the hundreds of millions.
Craig Gidney, a software engineer in Google's quantum group, and Martin Ekerå, a cryptographer at KTH and the Swedish National Cyber Security Agency, who had improved the quantum algorithm for discrete logarithms and factoring, joined forces. Ekerå's method uses shorter quantum computations, and Gidney had developed ways to implement arithmetic more cheaply in quantum circuits.
What the researchers did
The algorithm is Shor's, in a version of the Ekerå-Håstad type that computes the factors through a discrete logarithm problem with a short exponent, which requires about half as many multiplications as the standard version. Arithmetic is implemented with windowed techniques, where several bits of the exponent are processed at once using a lookup table, and with oblivious carry runways, which split a long addition into pieces that can run in parallel. These reduce the number of Toffoli gates and the depth.
The error correction uses the surface code with distance chosen to meet an error budget for the whole computation, around 27 for most of the machine, and special factories to produce magic states for the Toffoli gates by distillation. The layout places data patches, routing space, and the magic state factories on a two-dimensional grid, and the authors count the physical qubits, including the large fraction taken by the factories. They also model the time required, including reaction time, since decoding delays can stall the computation.
The final accounting gives about 20 million qubits and a running time of about 8 hours for the RSA-2048 case, with trade-offs: using more qubits shortens the time, and using fewer lengthens it. The paper includes a detailed table of the budget, the assumptions, and the variants for different key sizes, and provides open code for the estimates, which others reused and improved.
Results
The headline result of 20 million qubits and 8 hours replaced the billion-qubit figure that had been widely cited.
The paper also gives estimates for other key sizes and shows that the cost grows polynomially with the number of bits.
In 2025, Gidney reduced the estimate to fewer than one million noisy qubits and under a week, using approximate residue arithmetic, yoked surface codes, and magic state cultivation.
Key facts and numbers
| Item | Detail |
|---|---|
| Year and venue | 2019 preprint; Quantum, 2021 |
| Qubits and time | About 20 million physical qubits and about 8 hours |
| Logical qubits | About 6,000 |
| Toffoli gates | Roughly 3 billion |
| Assumptions | 0.1 percent gate error, 1 microsecond cycle, 10 microsecond reaction time |
| Earlier estimate | About a billion qubits (Fowler et al., 2012) |
Limitations and caveats
The estimate depends on assumptions that no existing machine meets at scale, including uniform 0.1 percent errors, fast classical decoding, and nearest-neighbor connectivity.
Resource estimates are not predictions of when a machine will exist, and new ideas can change them by large factors in either direction.
The paper addresses RSA and discrete logarithms, and elliptic-curve cryptography requires different estimates.
Why it matters
The paper became the benchmark for resource estimates in security planning and in hardware roadmaps. It was superseded by Gidney's 2025 estimate of under one million qubits, which relied on the techniques developed in the years after this paper.
What happened next
The paper is cited by agencies and companies in discussions of the timeline for post-quantum migration, and its open-source estimator became a tool for the community. It is also the clearest example of how algorithmic and engineering improvements lower the bar for an attack.
The progress from a billion qubits in 2012 to 20 million in 2019 and under one million in 2025 is often used to explain why cryptographers prefer to migrate before a capable machine exists.
How to read the original paper
The introduction and results table give the key numbers. The later sections on arithmetic and layout are technical, and the open-source code accompanying the paper is useful for readers who want to check the numbers.
The Shor's algorithm and post-quantum cryptography pages on this site provide background, and the 2025 Gidney paper on this site shows the next step in the series.
Original abstract (paraphrased)
The paper estimates the resources needed to factor 2048-bit RSA integers, assuming a planar grid of qubits with nearest-neighbor connections, a physical error rate of 0.1 percent, a surface-code cycle time of 1 microsecond, and a control reaction time of 10 microseconds. It finds that the factoring could be completed in 8 hours with 20 million physical qubits, by combining improvements in the algorithm, in arithmetic, in error correction, and in the physical layout.
Frequently asked questions
How many qubits does it take to break RSA-2048?
This paper estimated about 20 million noisy qubits for 8 hours, and a 2025 follow-up estimated fewer than one million qubits for under a week.
Is RSA broken now?
No. The estimates describe machines far larger and more accurate than any that exist today.
Why do estimates keep falling?
Because researchers keep finding better algorithms, arithmetic circuits, error-correction methods, and layouts.
Keep exploring
- Algorithm: Shor's Algorithm
- Algorithm: Quantum Fourier Transform (QFT)
- Algorithm: Quantum Error-Correcting Codes (Shor Code, Surface Code)
- Hardware: Google Willow
- Dictionary: Post-Quantum Cryptography
- Dictionary: Harvest Now, Decrypt Later
- Dictionary: Surface Code
- Dictionary: Magic State Distillation
- Industry: Quantum Computing for Cybersecurity
- Industry: Quantum Computing for Finance
- Industry: Quantum Computing and the Public Sector
Explanations on this page summarize published work for education (last reviewed September 30, 2026). Numbers are taken from the cited paper or from widely reported follow-up work, and later results may have updated or challenged them. Check the reference above before citing.