
Quantum Error Correction: How Do We Protect a Qubit?
How many imperfect physical qubits become one reliable logical qubit: the surface code, code distance, the threshold, decoding, and why raw qubit counts mislead.
Every headline about a new quantum computer leads with the same number: how many qubits it has. 100, 1,000, more. It's an easy number to compare, and it's almost meaningless on its own.
Here is the idea that explains why, and it's the single most important concept for understanding where quantum computing is really heading:
A useful future quantum computer will need reliable logical qubits, built from many imperfect physical qubits.
A thousand noisy qubits that can't be combined into reliable ones can do less than a hundred good qubits that can. That's why the industry's roadmaps have quietly shifted. They increasingly talk about logical qubits, logical error rates and fault tolerance, not just raw physical-qubit counts.
This post explains how that works: how quantum error correction turns many fragile physical qubits into one protected logical qubit, how the leading code (the surface code) actually catches errors, what the "threshold" is and why crossing it was such a big deal, how much it costs, and how to read quantum-computing announcements once you understand it.
Where this fits in the learning path
This is the deep-dive follow-up to Why Quantum Computers Make So Many Errors, in stage 02, How Quantum Computers Work, of the Quantum Computing & Technology learning path. That post explains where errors come from and introduces the core trick of error correction with a three-qubit example. This one goes deep. It's the most technical post in the path so far, but it still needs no heavy mathematics.
The Big Idea: Many Physical Qubits, One Logical Qubit

Two words need to be precise from here on:
- A physical qubit is a real piece of hardware: one transmon circuit, one trapped ion, one neutral atom. It has an error rate set by its physics and engineering, today roughly 0.1% to 1% per two-qubit operation on good hardware.
- A logical qubit is a qubit of information, encoded across many physical qubits by an error-correcting code. Its error rate can be made far lower than that of any physical qubit it's built from.
The logical qubit is the one algorithms actually use. Useful applications, such as simulating complex molecules or breaking today's public-key cryptography, need logical error rates around one in a billion to one in a trillion per operation, or better. No physical qubit is anywhere near that, and no physical qubit is ever likely to be. Error correction is the bridge.
A Quick Recap of the Trick
The errors post explains why classical error correction ("keep three copies and take a vote") seems impossible for qubits: you can't copy an unknown quantum state, and you can't look at a qubit without destroying its superposition.
The way around both walls:
- Spread, don't copy. Use entanglement to distribute one qubit's information across many physical qubits, so that no single qubit holds it.
- Check relationships, not values. Extra helper qubits measure parities, such as "are these two data qubits the same or different?", repeatedly. The pattern of check results is the syndrome. It reveals where an error happened without revealing the protected information, so the superposition survives.
- Decode and correct. A classical computer reads the syndrome, works out the most likely error, and corrects it (or simply keeps track of it in software).
The rest of this post is about doing that well enough, and at large enough scale, to matter.
Building Up: From Bit Flips to the Surface Code
Step 1: catching bit flips
The three-qubit repetition code spreads one qubit across three, as a combination of 000 and 111, and uses two parity checks to locate any single bit flip. It's a real error-correcting code, and it's been demonstrated many times. But it only catches one kind of error.
Step 2: catching phase flips too
Qubits suffer a second kind of error with no classical equivalent: the phase flip, which flips the sign between the amplitudes without changing the 0/1 probabilities. A bit-flip code is completely blind to it.
The fix is surprisingly symmetrical. A phase flip looks exactly like a bit flip if you view the qubit in the plus/minus basis instead of the 0/1 basis. So the same repetition idea, applied in that basis, catches phase flips instead.
Step 3: catching both at once
In 1995, Peter Shor found the first code that catches both: nest the two ideas, a phase-flip code built out of bit-flip codes, using 9 physical qubits for 1 logical qubit. It was the proof that quantum error correction is possible at all. And because any small error on a qubit can be described as a combination of bit flips and phase flips, a code that catches both can correct any small error on a single qubit, not just two special types. That's one of the most important results in the field: measuring the syndrome forces messy, continuous errors into a few discrete possibilities, and those can be fixed.
Shor's code was soon followed by smaller and more elegant codes, such as Steane's 7-qubit code. But the code that dominates today's hardware is different.
Step 4: the surface code
The surface code arranges qubits on a 2D grid, like a chessboard:
- Data qubits sit at the corners of the squares. Together, they hold the logical qubit.
- Check (measure) qubits sit in the middle of each square. Each one measures a parity of the four data qubits around it.
- The squares alternate between two kinds of check: Z-checks, which catch bit flips, and X-checks, which catch phase flips.

When a data qubit suffers a bit flip, the Z-checks on either side of it change their answer. When it suffers a phase flip, the X-checks on either side change. The checks never reveal the stored information, only these local disagreements.
Why the surface code took over:
- Only nearest-neighbour connections. Every check involves only the qubits right next to it. That matches the flat, grid-shaped chips that superconducting hardware is built on.
- A high threshold. It tolerates physical error rates up to roughly 1%, which today's best hardware can beat.
- Simple, repetitive structure. The same small check is repeated everywhere, which makes the hardware, the control and the decoding uniform.
Code Distance: How Strong Is the Protection?
Every code has a distance, written d. It's the smallest number of physical errors that could silently change the logical qubit without the checks noticing. A distance-d code can reliably correct up to (d − 1) / 2 errors at a time.
For the surface code, distance is simply the width of the grid. A bigger grid means more protection, and more qubits:
| Distance (d) | Errors it can correct at once | Data qubits | Check qubits | Physical qubits per logical qubit |
|---|---|---|---|---|
| 3 | 1 | 9 | 8 | 17 |
| 5 | 2 | 25 | 24 | 49 |
| 7 | 3 | 49 | 48 | 97 |
| 11 | 5 | 121 | 120 | 241 |
| 15 | 7 | 225 | 224 | 449 |
| 25 | 12 | 625 | 624 | 1,249 |
(The pattern: a distance-d surface code uses d² data qubits plus d² − 1 check qubits.)
The Threshold: Why Bigger Codes Get Better
Here's the key question. A bigger code has more qubits, and therefore more places for errors to happen. So does making the code bigger help or hurt?
The answer is the threshold theorem, and it's the reason large-scale quantum computing is possible at all:
- If the physical error rate is above the threshold, adding qubits adds errors faster than the code can fix them. Bigger codes get worse.
- If the physical error rate is below the threshold, every increase in code distance makes the logical qubit exponentially more reliable. Each step up (from distance 3 to 5, from 5 to 7, and so on) divides the logical error rate by a constant factor, often written Λ (lambda).
For the surface code, the threshold is roughly 1%, and Λ is roughly the threshold divided by the physical error rate. That's why a physical qubit that's merely "a bit better" matters so much: halving the physical error rate roughly doubles how much each step of code distance buys you.
Willow: the moment it became real
For decades, the threshold was a theoretical promise. In late 2024, Google's Willow chip demonstrated it clearly in hardware:
- Growing the surface code from distance 3 to 5 to 7 cut the logical error rate by roughly a factor of two at each step. That is the exponential suppression the theory predicts, which only happens below threshold.
- The distance-7 logical qubit lasted more than twice as long as the best individual physical qubit on the chip. For the first time, the protected qubit clearly outlived its own best component, a milestone often called beyond breakeven.
A factor of two per step is modest. But the trend, rather than the number, was the breakthrough: it showed that the approach scales, and that better physical qubits would turn the same method into dramatically better logical ones.
The Overhead: Why "Millions of Qubits" Keeps Coming Up
Error correction works, but it's expensive. To see how expensive, here's a commonly used rule of thumb for the surface code:
logical error rate ≈ 0.1 × (physical error rate ÷ threshold) ^ ((d + 1) ÷ 2)
with a threshold of about 1%, and Λ = threshold ÷ physical error rateApply it to a realistic target, one logical error in a trillion per round of checks, and you get the table below. The exact numbers depend on the hardware, the decoder and the noise, so treat them as illustrative:
| Physical error rate | Λ (improvement per distance step) | Distance needed | Physical qubits per logical qubit |
|---|---|---|---|
| 0.5% | About 2 | 73 | About 10,700 |
| 0.2% | About 5 | 31 | About 1,900 |
| 0.1% | About 10 | 21 | About 880 |
| 0.05% | About 20 | 17 | About 580 |
Two lessons jump out:
- Physical-qubit quality is enormously leveraged. Going from 0.5% to 0.1% error cuts the overhead by more than ten times. That's why companies obsess over fidelity.
- Useful machines are big. An algorithm needing a thousand logical qubits, at around a thousand physical qubits each, needs on the order of a million physical qubits, before counting the extra machinery described next.
The overhead nobody mentions: magic states
Some logical operations are easy on a surface code: they can be done by changing how checks are measured, or by "stitching" code patches together, a technique called lattice surgery. But no code can do every operation this way. For the surface code, one essential gate (the T gate, needed for universal quantum computing) can't be done directly.
The workaround is to prepare special ancilla states called magic states, and to purify many noisy copies into a few good ones in dedicated regions of the chip called magic-state factories. In many resource estimates, those factories take up a large fraction of the whole machine. Making them cheaper (for example through newer "cultivation" techniques) is one of the most active research areas.
Recent progress on the overhead
That overhead is also falling, from several directions:
- Better codes. Quantum LDPC codes pack several logical qubits into far fewer physical qubits than the surface code. IBM, for example, has built its roadmap around a code that stores 12 logical qubits in 288 physical qubits, where surface codes of similar strength would need several times more. The price is that some checks need longer-range connections across the chip, which superconducting hardware has to be specially designed for (and which neutral-atom machines can provide by physically moving atoms).
- Qubits with built-in protection. Cat qubits (pursued by Amazon and Alice & Bob) are designed so that bit flips are naturally almost impossible, leaving the code to deal mainly with phase flips, which needs far fewer qubits. Photonic GKP states and topological qubits are other bets on reducing the work the code has to do.
- Better algorithms. Resource estimates for the same problem keep shrinking. In 2019, a well-known estimate for breaking 2048-bit RSA needed around 20 million noisy physical qubits; a 2025 update by the same researcher brought that under one million, running for less than a week. That has direct consequences for security, covered in stages 08 and 09.
Decoding: The Classical Computer in the Loop
Error correction is a partnership between the quantum chip and a classical computer, running continuously:

Three things make decoding hard:
- The checks can be wrong too. Measurement errors mean a check can report a problem that isn't there, or miss one that is. So checks are repeated round after round, and the decoder looks at the syndrome over time as well as across the chip, a 3D pattern rather than a 2D one.
- Many errors can explain the same syndrome. The decoder's job is to find the most likely explanation. Classic algorithms (such as "minimum-weight perfect matching" and "union-find") do this efficiently, and machine-learning decoders are emerging: Google DeepMind's AlphaQubit, for example, learned to decode real hardware data more accurately than standard methods.
- It must keep up. On superconducting hardware a full round of checks takes roughly a microsecond. If the decoder falls behind, a backlog builds, and the computation slows down or fails. Decoding a large machine in real time, for days, is one of the most demanding real-time classical computing problems ever proposed, and companies are building custom FPGA, ASIC and GPU decoders for it.
A useful detail: corrections often don't need to be physically applied at all. If the decoder knows that a particular qubit has flipped, it can simply remember that and reinterpret later results. This "Pauli frame tracking" saves time and avoids adding more operations, and more chances for error.
Fault Tolerance: Correcting Without Spreading Errors
Error correction alone isn't enough. The checks themselves use gates and measurements, and those are noisy too. A badly designed check could take a single error on one qubit and spread it to several, creating exactly the kind of multi-qubit error the code can't fix.
A fault-tolerant design is one where every step (encoding, checking, logical gates and measurement) is arranged so that a single fault anywhere can only cause a correctable amount of damage. Combined with the threshold theorem, fault tolerance is what guarantees that a large computation can run for as long as needed, with the logical error rate driven as low as the application requires.
That's why roadmaps use the phrase fault-tolerant quantum computer rather than just "error-corrected": it means the whole machine, not just memory, is protected end to end.
Why "Number of Qubits" Is a Poor Measure
With all of that in place, the opening claim is easy to see. Consider two hypothetical machines:
| Machine A | Machine B | |
|---|---|---|
| Physical qubits | 1,000 | 100 |
| Two-qubit error rate | 2% (above threshold) | 0.1% (well below threshold) |
| Logical qubits it can build | None useful: bigger codes only make things worse | Two distance-5 surface-code logical qubits (98 physical qubits) |
| Logical error rate | Not applicable | About 10 times lower than its physical qubits per round, and falling exponentially as codes grow |
| Path to scale | Needs better qubits first | Add more qubits of the same quality, and logical errors fall exponentially |
Machine A wins the headline. Machine B is the one on a path to useful computation.
When you read a quantum-computing announcement, these are the questions that matter more than raw qubit count:
1. Are the physical error rates below threshold?
2. How many logical qubits, and at what logical error rate?
3. Does logical error fall as the code grows?
4. Can it perform logical operations, not just store logical qubits?
5. How fast does it run logically?
How Industry Roadmaps Have Shifted
Over the last few years, the language of quantum roadmaps has visibly changed: from "more qubits" to "more logical qubits, at lower logical error rates, running more operations". At the time of writing, published plans include:
- IBM has laid out a path to Starling, a fault-tolerant system targeted for 2029 with around 200 logical qubits able to run on the order of 100 million gates, followed by a larger system in the early 2030s. Its plan is built on qLDPC codes rather than the surface code.
- Google publishes its roadmap as a series of milestones. Willow's below-threshold demonstration was one; the next targets are long-lived logical qubits with error rates around one in a million, then logical gates, then larger machines.
- Quantinuum has demonstrated logical qubits on trapped ions, including work with Microsoft in 2024 showing logical error rates far below the physical ones, and targets a universal fault-tolerant machine by the end of the decade.
- Microsoft frames the journey in levels: "foundational" (today's noisy machines), "resilient" (reliable logical qubits) and "scale" (large fault-tolerant systems). It has demonstrated logical qubits with Quantinuum and with Atom Computing, alongside its own topological-qubit programme.
- Neutral-atom groups (Harvard and MIT researchers with QuEra, and Atom Computing) have run experiments with dozens of logical qubits, using the ability to move atoms around to perform logical gates on many qubits at once.
- Governments are measuring the field the same way: the US DARPA Quantum Benchmarking Initiative, for example, evaluates whether companies have a credible path to a useful, fault-tolerant machine, not how many physical qubits they have.
Roadmaps slip and plans change, so treat any date as a target, not a promise. But the direction of travel is clear and consistent across very different technologies: logical qubits and fault tolerance are now the scoreboard.
What This Means for You
- Read announcements critically. Translate every "N qubits" headline into "how many logical qubits, at what error rate". Most of the time, the honest answer today is "a handful, as a demonstration".
- Watch the logical-qubit milestones. The step from tens of logical qubits to hundreds, with logical error rates of one in a million or better, will be the signal that genuinely useful quantum computing is close.
- Plan security on the error-correction timeline. Breaking RSA and elliptic-curve cryptography needs thousands of high-quality logical qubits and a fault-tolerant machine. It isn't possible today, but resource estimates have fallen fast, and migrating to post-quantum cryptography takes years. Stages 08 and 09 of this path cover what to do about it.
Quick Recap
- Physical qubits are imperfect hardware; logical qubits are reliable information encoded across many of them.
- Error correction spreads information without copying it, checks parities without looking at the data, and decodes the results classically.
- The surface code uses a 2D grid of data and check qubits, catches both bit and phase flips, and needs only nearest-neighbour connections.
- Code distance sets how many errors can be corrected; a distance-d surface code uses 2d² − 1 physical qubits.
- Below threshold, bigger codes give exponentially lower logical error rates; Google's Willow showed this in 2024.
- Overhead is large, from hundreds to thousands of physical qubits per logical qubit plus magic-state factories, but better qubits, better codes and better algorithms keep shrinking it.
- Fault tolerance protects the whole computation, not just stored data.
- Raw qubit count is a poor measure. Logical qubits, logical error rates and logical operation speed are what count.
What's Next on the Learning Path
That completes the core of how quantum computers work and how they'll become reliable. For the big-picture view of where error correction leads, from noisy machines to fault-tolerant ones and how industry roadmaps map onto that journey, see stage 11's From Noisy Qubits to Fault-Tolerant Quantum Computers. Stage 04, Quantum Programming, gets hands-on: installing Qiskit, running circuits on a simulator and on real hardware, and even building a small repetition code yourself to watch error correction work. The full 11-stage path is listed at the end of the beginner's guide.
Written by
Chetan Yamger
Cloud Engineer · AI Automation Architect · Modern Workplace Consultant
Cloud Engineer, AI Automation Architect, and Modern Workplace Consultant based in Amsterdam, Netherlands. Specializing in scalable, secure enterprise solutions with Microsoft Azure, Intune, PowerShell, and AI-driven automation using ChatGPT, Gemini, and modern LLM technologies.
Stay in the loop.
New articles, straight to you.
Deep-dive technical articles on Intune, PowerShell, and AI — no noise, no spam.
Discussion
Share your thoughts — your email stays private
Leave a comment