PLAIN QUANTUM
Search

What is Grover's algorithm?

  • Level: Beginner
  • 4 min read
  • Quick answer
The short answer

Grover's algorithm is a quantum algorithm, published by Lov Grover in 1996, that in idealised terms searches an unsorted set of possibilities in roughly the square root of the number of steps an ordinary computer would need. Where a classical search might take a million guesses, Grover's takes about a thousand. In security, its main effect is to weaken symmetric encryption such as AES modestly, which is why the guidance is about key length, not new algorithms.

A square-root speed-up, not magic

A square-root speed-up sounds dramatic, but it's far smaller than what Shor's algorithm does to RSA. Shor's algorithm gives, in principle, an efficient way to factor large numbers, but attacking real RSA keys would require a large, reliable quantum computer that has not been publicly demonstrated. Grover's only reduces the effort, and the reduction shrinks in practice: each quantum step is much slower and more expensive than an ordinary one, error correction adds large overheads, and the algorithm is hard to split across many machines running in parallel.

1. Spread out: all equal 00: +0.5 01: +0.5 10: +0.5 11: +0.5 2. Mark: prize box flipped 00: +0.5 01: +0.5 10: +0.5 11: −0.5 3. Mix: prize takes it all 00: 0 01: 0 10: 0 11: +1 1. Spread out: all equal 00:+0.5 01:+0.5 10:+0.5 11:+0.5 2. Mark: prize box flipped 00:+0.5 01:+0.5 10:+0.5 11:−0.5 3. Mix: prize takes it all 00:0 01:0 10:0 11:+1
How Grover's algorithm finds a marked item, on the smallest example: four boxes, with the prize in box 11. Bars show amplitudes. Marking only flips the sign of the prize's amplitude, so the odds don't change yet; mixing reflects every amplitude around their average, which moves the weight onto the prize. With four boxes one round is enough. With more boxes the number of rounds grows like the square root of the number of boxes, which is where the square-root speed-up comes from.
64 boxes, one prize 0% 50% 100% 0 2 4 6 8 10 12 rounds of mark and mix 6 rounds: 99.7% more rounds is not better 16 boxes: best at 3 rounds 64 boxes: best at 6 rounds 256 boxes: best at 12 rounds 4× the boxes, 2× the rounds 64 boxes, one prize 0% 50% 100% 0 2 4 6 8 10 12 rounds of mark and mix 6 rounds: 99.7% more rounds is not better 16 boxes: best at 3 rounds 64 boxes: best at 6 rounds 256 boxes: best at 12 rounds 4× the boxes, 2× the rounds
Chance that Grover's search on 64 boxes finds the prize, by rounds of mark and mix
RoundsChance of the prize
01.6%
113.5%
234.4%
359.1%
481.6%
596.4%
699.7%
790.7%
871.8%
947.5%
1023.8%
116.6%
120.0%
Grover's search on 64 boxes: the chance of finding the prize peaks at 99.7% after 6 rounds, then falls. The best number of rounds grows with the square root of the number of boxes, and that is the whole speed-up, before the overheads described above.
Search: a square-root saving steps needed 1 1 10³ 10³ 10⁶ 10⁶ 10⁹ 10⁹ 10¹² 10¹² possibilities, N saving ordinary Grover Search: a square-root saving steps needed 1 1 10³ 10³ 10⁶ 10⁶ 10⁹ 10⁹ 10¹² 10¹² possibilities, N saving ordinary Grover
Steps to search N possibilities, log scales: ordinary up to N, Grover about (π/4)√N. Each quantum step would be slow and need error correction.

What it means for encryption

CryptographyEffect of Grover's algorithmWhat to do
AES-256Keeps a very comfortable marginNothing; the most margin at little extra cost
AES-128Weakened on paper; a real attack must also pay for circuit depth, error correction and running timeFollow the guidance that applies to you; CNSA 2.0 requires 256-bit keys for US national security systems
Hash functions such as SHA-256Depends on the property: resisting reversal and resisting collisions are affected differentlyCheck each use, such as signatures, passwords or integrity checks, against current guidance
RSA and elliptic curveNot the relevant threatThese fall to Shor's algorithm instead
Grover's algorithm calls for larger parameters, not a migration to new algorithms.

Guidance on 128-bit keys differs, partly because it covers different systems. The NSA's CNSA 2.0, which applies to US national security systems, requires 256-bit AES. NIST's transition report, IR 8547 (final, October 2026), says NIST doesn't expect to need to move away from its approved symmetric algorithms that offer at least 128 bits of classical security as part of the post-quantum migration. Follow whichever applies to your organisation.

Beyond cryptography

Grover's algorithm is often cited for search, optimisation and finance. In practice, once the costs of error correction and loading data are counted, the gain for many real problems shrinks or disappears. The what quantum is good at lesson puts it alongside the stronger cases.

For a bank, Grover's algorithm is mostly a reason to check key and hash sizes. The urgent migration work is about public-key cryptography.

Common confusions

  • "Grover halves the security of everything." On paper it roughly halves the effective key length for brute-force search. Real-world attack costs are much higher than that rule of thumb suggests.
  • "AES needs replacing." No. NIST and the UK NCSC accept AES-128, and AES-256 adds margin; follow the key-length rule that applies to you.
  • "Grover makes quantum computers fast at search." Only in a narrow sense, and often not once overheads are counted.

Where this comes up

Sources and further reading

Tags show the kind of source (how sources are chosen and checked). Checked against these sources on 19 October 2026.

  1. Peer-reviewed paperA fast quantum mechanical algorithm for database searchLov Grover, STOC, 1996
  2. Government guidanceNSA releases future quantum-resistant algorithm requirements for national security systems (CNSA 2.0)US National Security Agency, 2022
  3. Government guidanceNIST IR 8547: Transition to Post-Quantum Cryptography StandardsNIST, 2026

Written by Muhammad Atif · Reviewed 26 November 2026 · Report a correction