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.
| Count | Grids | Share of all grids |
|---|---|---|
| All possible 5 × 5 grids | 33,554,432 | 100% |
| Different clue sets they produce | 28,781,820 | — |
| Grids with a unique solution | 25,309,575 | 75.4% |
| … solvable by line logic alone | 24,976,511 | 74.4% |
| … unique, but line logic gets stuck | 333,064 | 1.0% |
| Grids that share their clues with another grid | 8,244,857 | 24.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 cells | Grids | Unique solution | Line-solvable | Unique but not line-solvable |
|---|---|---|---|---|
| 2 | 300 | 100 (33.3%) | 100 (33.3%) | 0 |
| 4 | 12,650 | 3,901 (30.8%) | 3,821 (30.2%) | 80 |
| 6 | 177,100 | 49,768 (28.1%) | 47,712 (26.9%) | 2,056 |
| 8 | 1,081,575 | 404,543 (37.4%) | 381,183 (35.2%) | 23,360 |
| 10 | 3,268,760 | 1,793,936 (54.9%) | 1,717,026 (52.5%) | 76,910 |
| 11 | 4,457,400 | 2,921,600 (65.5%) | 2,838,490 (63.7%) | 83,110 |
| 13 | 5,200,300 | 4,348,296 (83.6%) | 4,323,524 (83.1%) | 24,772 |
| 15 | 3,268,760 | 3,055,378 (93.5%) | 3,052,744 (93.4%) | 2,634 |
| 18 | 480,700 | 471,462 (98.1%) | 471,410 (98.1%) | 52 |
| 20 | 53,130 | 52,542 (98.9%) | 52,538 (98.9%) | 4 |
| 22 | 2,300 | 2,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.

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 needed | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|---|---|---|---|---|---|---|---|---|---|
| Grids | 3,417,700 | 15,881,123 | 4,582,962 | 901,032 | 162,762 | 27,104 | 3,592 | 232 | 4 |
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.

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
- OEIS A242876, "Number of n X n nonograms (hanjie) which can be solved uniquely". Read 15 November 2026.
- 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.
- Pixelogic, "Every 5x5 Nonogram". Read 15 November 2026.
- 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)