Counting Every Sudoku Grid: How Mathematicians Reached 6.67 Sextillion Solutions

Counting Every Sudoku Grid: How Mathematicians Reached 6.67 Sextillion Solutions

The Number Behind the Puzzle

A standard completed 9×9 Sudoku grid can be filled in exactly 6,670,903,752,021,072,936,960 valid ways—approximately 6.67 sextillion. Mathematicians Bertram Felgenhauer and Frazer Jarvis reached this extraordinary total through symmetry, careful classification and computer-assisted enumeration rather than attempting to generate every grid individually.

Written in scientific notation, the answer is approximately:

6.671 × 10²¹

That is a 22-digit number. If one person completed a different grid every second, without ever sleeping or stopping, the task would take more than 211 trillion years. Even eight billion people working at that rate would need over 26,000 years.

Yet the truly amazing part is not merely the size of the answer. It is how mathematicians transformed an apparently impossible counting problem into something a computer could finish.

What Exactly Was Being Counted?

Before exploring the method, it is important to distinguish a completed grid from a Sudoku puzzle.

A completed grid contains all 81 digits and follows the three familiar rules:

  1. Every row contains the digits 1 through 9 exactly once.
  2. Every column contains the digits 1 through 9 exactly once.
  3. Every 3×3 box contains the digits 1 through 9 exactly once.

A puzzle is an incomplete grid containing a selection of starting clues. For it to be a proper Sudoku puzzle, those clues should lead to exactly one completed grid.

The famous 6.67-sextillion figure counts completed grids, not all possible arrangements of clues. One completed grid can produce many puzzles by hiding different cells, although many such clue patterns would be too easy, have multiple solutions or provide no unique solution at all.

Readers interested in that distinction can explore the remarkable challenge of 17-clue Sudoku puzzles, which examines how little starting information a uniquely solvable puzzle can contain.

When reading a huge puzzle statistic, check whether it counts finished solution grids, starting clue patterns or genuinely unique puzzles—these are different quantities.

Why Simple Multiplication Does Not Work

At first, Sudoku may look like a straightforward multiplication problem. The first cell has nine possible digits, the next has eight and so on.

Unfortunately, each placement affects several overlapping areas. A digit must work in its row, column and box simultaneously. Choices that appear legal near the top of the grid may make completion impossible much later.

Sudoku is closely related to a mathematical object called a Latin square, in which every symbol appears once in each row and column. Sudoku adds the nine 3×3 box restrictions, making the counting problem even more specialized.

A program could theoretically attempt to construct grids one cell at a time, abandoning a branch whenever it violates a rule. However, exploring the full search space without further simplification would involve tremendous duplication. Many grids are transformed versions of others and therefore behave identically during counting.

The breakthrough was to stop treating every visible arrangement as a completely new problem.

Symmetry: The Great Mathematical Shortcut

Suppose every 1 in a completed grid is changed to a 7, and every 7 is changed to a 1. The result remains valid. The symbols have different names, but their relationships have not changed.

Other validity-preserving transformations include:

  • Swapping rows within the same three-row band
  • Swapping columns within the same three-column stack
  • Rearranging entire bands
  • Rearranging entire stacks
  • Rotating or reflecting the grid
  • Transposing the grid across its main diagonal
  • Consistently renaming all nine digits

These operations create visually different grids without creating an entirely new mathematical structure. That gave the researchers a powerful strategy: choose one representative from a family of equivalent arrangements, count its possible completions and then account for the size of the family.

This principle appears throughout puzzle solving. As Puzzles Arcade’s guide to breaking overwhelming puzzles into solvable pieces explains, a huge challenge often becomes manageable when divided into smaller, carefully chosen cases.

Look for transformations that preserve a puzzle’s rules. Rotation, reflection, relabelling and rearrangement can reveal that several apparently different cases are really one case in disguise.

Starting With the Top Band

Felgenhauer and Jarvis focused first on the grid’s top band—the first three rows, containing three 3×3 boxes.

They began by fixing the upper-left box in a standard arrangement. This was legitimate because any valid arrangement of its nine digits could be renamed to match the chosen version. The missing relabellings could be restored at the end by multiplying by 9!, or 362,880.

With that first box fixed, there are 2,612,736 possible ways to complete the rest of the top band. That is already far better than starting with every possible full grid, but it remains a substantial collection.

The researchers then applied transformations that preserve the number of possible completions. For example, columns could be reordered within boxes, boxes could be exchanged and rows within the band could be rearranged.

A first reduction brought the 2,612,736 top bands down to 36,288 standardized cases. Further equivalence tests reduced those to 416, then 174, then 71. Ultimately, only 44 representative cases required the final computational count. Cornell University’s accessible guide to the mathematics of counting Sudoku solutions walks through these reductions in greater detail.

That is the heart of the achievement: millions of possibilities were compressed into a few dozen meaningful categories.

What the Computer Actually Did

The computer was not simply told, “Try every possible Sudoku.”

Instead, it received a carefully reduced and organized set of top-band representatives. For each representative, the program exhaustively counted how many legal ways the remaining six rows could be completed.

The overall process can be summarized as follows:

  1. Fix one 3×3 box in a standard form.
  2. Generate the possible arrangements of the first three rows.
  3. Group arrangements that must have equal completion counts.
  4. Select representative cases from those groups.
  5. Count every legal completion for each representative.
  6. Multiply each result by the number of arrangements it represents.
  7. Add the results and restore the digit relabellings removed at the beginning.

The final weighted sum produced the exact number:

6,670,903,752,021,072,936,960

This was a computer-assisted proof, but the machine was only part of it. The essential human contribution was recognizing the symmetries, proving that the reductions were valid and designing a search that counted every grid exactly once.

The original Sudoku enumeration project page also records an independent verification by Ed Russell using separate software—an important confidence check for such a large computational result.

Are All 6.67 Sextillion Grids Truly Different?

That depends on what “different” means.

If changing the positions or names of digits creates a different written grid, then the total is 6.67 sextillion. If grids related by valid transformations are treated as the same underlying structure, the number falls dramatically.

Ed Russell and Frazer Jarvis later calculated that there are 5,472,730,538 essentially different completed grids after the standard transformations are considered. That is roughly 5.47 billion—still an enormous number, but far smaller than 6.67 sextillion.

The calculation is not as simple as dividing by one fixed number. Some grids possess internal symmetries and can be transformed in ways that leave them unchanged. Mathematicians therefore used tools from group theory, including a counting method known as Burnside’s lemma, to handle these special cases correctly.

To understand “essentially different” puzzles, imagine repainting or rotating the same maze: its appearance may change even though its underlying paths remain identical.

Why This Count Is Such an Amazing Feat

The enumeration of Sudoku grids is a wonderful example of mathematics and computing working together.

Raw computing power alone would have been wasteful. Pure pencil-and-paper reasoning could organize the problem but would struggle to perform every final count. The successful approach combined both:

  • Combinatorics identified what needed to be counted.
  • Symmetry removed repeated work.
  • Proof showed that the reductions preserved the correct total.
  • Programming completed the exhaustive searches.
  • Independent verification provided additional confidence in the result.

It is the same deeper mathematical thinking found throughout the hidden math behind puzzle games: rules create constraints, constraints create patterns, and patterns make seemingly impossible problems approachable.

A Vast Universe Inside 81 Squares

A Sudoku board contains only 81 cells and nine symbols, yet its complete mathematical universe includes more than six sextillion valid finished grids.

That contrast is what makes the result so memorable. Simple rules do not always produce simple possibilities. Sometimes they create a structure so vast that counting it requires years of mathematical insight, efficient code and clever use of symmetry.

Felgenhauer and Jarvis did not reach the answer by literally writing down every grid. They accomplished something more elegant: they discovered how to count an unimaginably large collection without becoming lost inside it.

The next time a Sudoku grid looks small and familiar, remember what lies beneath its neat lines. You are looking at one tiny member of a family containing exactly 6,670,903,752,021,072,936,960 completed grids—and mathematicians know the total.

Share: