Nonogram Lab

Nonogram Lab › Guides

How Many 5×5 Nonograms Are There? We Checked All 33,554,432 Grids

A 5 × 5 grid can be filled in 33,554,432 ways. We generated every one, computed its clues and ran our solver on it. Here is how many make a real puzzle — and which ones are the hardest.

Short answer: of the 225 = 33,554,432 possible 5 × 5 grids, 25,309,575 (75.4%) are the only grid that fits their clues, so they make a valid puzzle. 24,976,511 of those (98.7%) can be solved one row or column at a time. The other 333,064 have one solution but need a trial step. The remaining 8,244,857 grids share their clues with at least one other grid.

How we counted

A 5-cell line can produce 13 different clues (0, 1, 2, 3, 4, 5, 1 1, 1 2, 2 1, 1 3, 3 1, 2 2 and 1 1 1). For every grid from all-empty to all-filled we computed the five row clues and five column clues, gave each combination a number, sorted the 33.5 million numbers and counted how many grids share each clue set. A clue set that belongs to exactly one grid is a puzzle with a unique solution. For those grids we then ran a line solver — the same method as the nonogram solver on this site — to see whether rows and columns alone finish the grid. The whole run took 17 seconds in Node.js on a Mac.

CountGridsShare of all grids
All possible 5 × 5 grids33,554,432100%
Different clue sets they produce28,781,820—
Grids with a unique solution25,309,57575.4%
… solvable by line logic alone24,976,51174.4%
… unique, but line logic gets stuck333,0641.0%
Grids that share their clues with another grid8,244,85724.6%

Checked against the OEIS and "Every 5x5 Nonogram"

Both totals match published integer sequences. The OEIS entry A242876, "number of n × n nonograms which can be solved uniquely", lists 25,309,575 for n = 5, and A391619, the number solvable by analysing rows and columns in isolation without guessing, lists 24,976,511. The same entries give the 6 × 6 figures: 49,745,060,669 unique and 48,625,108,931 line-solvable, out of 236 ≈ 68.7 billion grids.

The Every 5x5 Nonogram project on Pixelogic says it has "solved all 24,976,511 solvable 5x5 nonograms". That is exactly our count of grids that line logic solves, which suggests "solvable" there means solvable one line at a time. By our count, 333,064 more 5 × 5 grids have exactly one solution but need you to assume a cell and follow the consequences. They are legitimate puzzles, just harder than their size suggests.

Sparse pictures are the problem

Whether a grid makes a puzzle depends mostly on how many cells are filled. With few filled cells, clues like 1 or 1 1 fit many arrangements; with many filled cells, the blocks are long and pin themselves down.

Filled cellsGridsUnique solutionLine-solvableUnique but not line-solvable
2300100 (33.3%)100 (33.3%)0
412,6503,901 (30.8%)3,821 (30.2%)80
6177,10049,768 (28.1%)47,712 (26.9%)2,056
81,081,575404,543 (37.4%)381,183 (35.2%)23,360
103,268,7601,793,936 (54.9%)1,717,026 (52.5%)76,910
114,457,4002,921,600 (65.5%)2,838,490 (63.7%)83,110
135,200,3004,348,296 (83.6%)4,323,524 (83.1%)24,772
153,268,7603,055,378 (93.5%)3,052,744 (93.4%)2,634
18480,700471,462 (98.1%)471,410 (98.1%)52
2053,13052,542 (98.9%)52,538 (98.9%)4
222,3002,282 (99.2%)2,282 (99.2%)0

Below 9 filled cells, fewer than half of the grids work as puzzles; above 15, almost all do. The grids that are unique but need more than line logic cluster in the middle, peaking at 11 filled cells. This is why the random puzzles on this site are drawn with about 58% of cells filled, and why the nonogram maker warns most often about thin line drawings.

Two grids, same clues

2,803,203 clue sets fit exactly two grids. The most crowded clue set is the one where every row and every column says 1: it fits 120 grids, one for each way to place five cells so that no two share a row or column (5 × 4 × 3 × 2 × 1 = 120). A smaller example: the clues below fit two grids that differ in four cells, the classic swapped-diagonal pattern.

Solver result for a 5 by 5 puzzle with two solutions, four cells outlined in amber
The solver finds two solutions and outlines the four cells that change between them. Open this example →

The hardest 5 × 5 nonograms

"Hard" can mean two things. Among the line-solvable grids, some need many rounds of switching between rows and columns. We counted rounds as one pass over all rows followed by one pass over all columns:

Rounds needed123456789
Grids3,417,70015,881,1234,582,962901,032162,76227,1043,5922324

Only four 5 × 5 grids need nine rounds. One of them is ··■■· ·■·■■ ■■··■ ·■■·· ··■■· with row clues 2 · 1 2 · 2 1 · 2 · 2 and column clues 1 · 3 · 1 2 · 2 1 · 2. Each round settles only a few cells, so you keep going back and forth.

Solver result for a 5 by 5 puzzle that needs nine rounds of line logic, solved
One of the four 5 × 5 grids that need nine rounds. Press Next step in the solver to watch how little each line gives. Open this example →

The other kind of hard is the 333,064 grids where line logic stops early. The example in the solver, with row clues 1 · 3 · 2 · 1 3 · 2 1, leaves 8 of 25 cells unknown. When line logic is not enough solves it by contradiction, step by step.

What this means if you make puzzles

  • A 5 × 5 picture with 4 to 8 filled cells has well under a 40% chance of having a unique solution. Thicken the lines.
  • From 15 filled cells up, over 93% of grids work — but a mostly filled 5 × 5 is a dull puzzle, because the clues give it away.
  • Always run the check: the maker outlines the cells logic cannot reach.

Sources

  1. OEIS A242876, "Number of n X n nonograms (hanjie) which can be solved uniquely". Read 15 November 2026.
  2. OEIS A391619, "Number of n X n nonograms (hanjie) which can be solved uniquely by iteratively analyzing each row and column in isolation". Read 15 November 2026.
  3. Pixelogic, "Every 5x5 Nonogram". Read 15 November 2026.
  4. Counts: Nonogram Lab measurement, run on this site's own solver and generator (Node.js, 15 November 2026). Method described in the article (full enumeration of 225 grids)

More guides