Are Nonograms Always Solvable? How Many Have One Answer

By Dawid Siedlarz · · 8 min read

Play Nonogram free →

Short answer: Not always. A nonogram made from a picture always has at least one solution, but the clues can fit more than one picture. Of all 33,554,432 possible 5x5 pictures, 25,309,575 (75.4%) are the only picture with their clues, so about one 5x5 picture in four shares its clues with another, and at 6x6 it is 27.6%. In general, solving nonograms is NP-hard (Ueda and Nagao, 1996). Good puzzles are checked: ours keep only pictures that line logic can finish, which proves the answer is unique.

Try it right here, or open Nonogram full screen.

Most nonogram players meet this question the hard way: an hour into a 15x15 grid, every line has been squeezed for information and three squares are still blank. Is the puzzle broken, or did you miss something? "Solvable" means three different things here, and they have different answers:

  1. The clues fit some picture. Always true if the puzzle was made from a picture.
  2. The clues fit only one picture. Often true, but far from always.
  3. A person can find that picture without guessing, one row or column at a time. Rarer still.

We counted the second one exactly for small grids and measured all three on random puzzles at the sizes of our own Nonogram, using the game's own solver.

The smallest nonogram with two answers

Take a 2x2 grid where both rows have the clue 1 and both columns have the clue 1. One filled square per row and per column: that is either the diagonal from top left to bottom right, or the other diagonal.

Answer AAnswer B
■ ·
· ■
· ■
■ ·

Both pictures give exactly the same clues, so no amount of logic can choose between them. Joost Batenburg and Walter Kosters call this a "switching component" in "On the Difficulty of Nonograms" (ICGA Journal, 2012): a set of squares where swapping filled and empty gives a different picture with identical clues. In a bigger grid the same thing happens whenever a group of squares can be swapped without changing the length of any run in any row or column, and one such spot anywhere in the picture is enough to give the whole puzzle a second answer.

How many nonograms have exactly one answer?

For small square grids you can simply check every picture. We wrote a short program (tools/nonogram-uniqueness.js in our site repository) that computes the clues of every possible N x N picture and counts the pictures whose clues no other picture shares. A second, independent check ran a full solver (line logic plus trying both values of a square) on every 2x2, 3x3 and 4x4 picture and got the same counts. Our 5x5 result, 25,309,575, matches the value in the On-Line Encyclopedia of Integer Sequences, entry A242876, and the exhaustive count in Batenburg and Kosters' paper. The 6x6 value comes from Bertram Felgenhauer's nonogram counts (2025), which corrected the 6x6 figure printed in the 2012 paper by 299 pictures.

GridPossible picturesOnly picture with its cluesShare
2x2161487.5%
3x351238475.0%
4x465,53652,36279.9%
5x533,554,43225,309,57575.4%
6x668,719,476,73649,745,060,66972.4%

The trend is not perfectly smooth (4x4 is better than 3x3), but from 4x4 on it falls: at 6x6 more than one picture in four shares its clues with another. These counts weigh every picture equally, which is like filling each square with a coin flip. Real puzzles are not drawn that way, so the next question is what happens at the sizes and fill rates people actually play.

Unique is not the same as solvable without guessing

A person solves a nonogram one line at a time: take a row, list every way its runs could sit given the squares already known, and fill in what all those ways agree on. Then do the same for a column, and repeat. This is called line solving, and it is exactly what the checker inside our game does. Our checker gives the same counts as the published ones: it finishes exactly 51,234 of the 65,536 4x4 pictures, the value in OEIS A391619. When line solving stops with blanks left, two things can be true: the puzzle has several answers, or it has one answer that can only be reached by trying a square and following the consequences until something contradicts.

We drew 2,000 random pictures at each of our three levels, with the same size and share of filled squares the game uses, and for each one ran the game's line solver and a full search that counts answers (line solving plus trying both values of a blank square, stopping at two answers).

LevelGridFilled squaresLine logic finishes itExactly one answerMore than one answer
Easy5x560%88.4%89.0%11.0%
Medium10x1055%69.7%71.2%28.8%
Hard15x1550%25.9%30.4%69.6%

First, a random 15x15 picture at half density is a bad puzzle more often than not: seven in ten have a second answer. Second, the gap between "one answer" and "line logic finishes it" is small but real, 0.6 points on Easy and 4.5 on Hard: those are puzzles that are fair in principle but would force a player to guess and backtrack. Third, a fuller grid helps at the same size. At 60% filled, 89.0% of 5x5 pictures are unique, against 75.4% when every square is a coin flip, probably because long runs leave fewer ways to place them.

Are nonograms NP-complete?

In general, yes. Batenburg and Kosters credit N. Ueda and T. Nagao with the first proof, in a 1996 technical report titled "NP-completeness results for NONOGRAM via parsimonious reductions" (Tokyo Institute of Technology), that the general nonogram problem is NP-hard. Since checking a proposed picture against its clues is quick, the yes-or-no question "do these clues have a solution?" is NP-complete: no known method answers it quickly for every possible set of clues.

Batenburg and Kosters address the gap between that result and the puzzles people actually solve. Their paper opens by noting that puzzles from puzzle books "can typically be solved by applying a series of highly local reasoning steps regarding single rows and columns", while the general problem is NP-hard. They call the puzzles that line logic finishes "simple", and their exhaustive count shows how common those are among small pictures: 24,976,511 of the 33,554,432 5x5 pictures (74.44%) are simple. Of the 25,309,575 uniquely solvable 5x5 pictures, only 333,064 (1.3%) are not simple, and most of those fall to a slightly stronger method that reasons about two rows and two columns together. For 6x6 the simple share in OEIS entry A391619 is 48,625,108,931 pictures, or 70.8%.

NP-hardness is a statement about the worst case, not about the puzzle in front of you. The paper also measured how the fill rate changes things: up to about 30% filled for 10x10 grids, and about 50% for 30x30, fewer than 2% of random puzzles were simple or solvable by their two-row, two-column method, and above that the share rises. The threshold "tends to rise as the size of the puzzle increases", which matches our levels: Hard is both bigger and emptier than Easy, and far fewer of its random pictures are simple.

How our game makes sure every puzzle has one answer

Our Nonogram never shows you a picture straight from the random draw. The generate function in js/games/nonogram.js draws a picture, works out its clues and runs the line solver on the clues alone. If the solver fills every square, the picture is kept: the solver only fills a square when every arrangement allowed by the clues agrees, so a full grid proves there is one answer and that you can reach it without guessing. If not, it draws again.

From the table above you can predict how often that happens, and our second test confirmed it: across 2,000 generated puzzles per level, the game needed 1.1 draws on average on Easy, 1.4 on Medium and 3.8 on Hard. After 301 failed draws the code would show the next picture even if it fails the check. With a 25.9% success rate per draw on Hard, the chance of that is about 0.741302, roughly 1 in 1039, and it never happened in our 6,000 puzzles.

Size and fill rate are the difficulty dials: Easy is 5x5 with 60% of the squares filled, Medium 10x10 with 55% and Hard 15x15 with 50%. Fewer filled squares means shorter runs with more freedom, so each line gives away less on its own and you need more rounds of row-column-row reasoning. Together with the bigger grid, that is why Hard throws away about three pictures in four before it finds a fair one.

What this means when you play

  1. On our puzzles, you never need to guess. If you are stuck and your marks so far are right, some row or column still has a square that every possible arrangement agrees on. Go back to the lines that changed most recently, or whose clues add up to the most squares, and list the placements of their runs.
  2. Check the lines that just changed. Line solving only makes progress where new information arrived, so after every filled or crossed square, look at the row and the column through it first.
  3. In puzzles from elsewhere, a forced guess can mean a flawed puzzle. Batenburg and Kosters note that puzzles in published collections usually have exactly one answer. A random or carelessly made grid, though, can have two, and if such a puzzle accepts only one of them as correct, the puzzle is at fault, not you.
  4. Mark the empty squares. The solver's proof that a square is empty is worth as much as a filled one; marking empties with an X is what lets the next line's deduction happen.

The techniques that make line solving fast, such as overlap and edges, are in our guide on how to solve nonograms. Play Nonogram free on Hard, where the game rejects about three random pictures in four before it finds one that logic alone can finish. For the same question about other games, see is Mahjong solitaire always solvable and which games are solved.

Frequently asked questions

Can a nonogram have more than one solution?

Yes. The smallest example is a 2x2 grid where every row and column has the clue 1: both diagonals fit. Of all 33,554,432 possible 5x5 pictures, 25,309,575 (75.4%) are the only picture with their clues, so about one in four is ambiguous. Puzzles in published collections are usually chosen to have exactly one answer.

Are all nonograms solvable without guessing?

No. Some puzzles have a single answer that line-by-line logic cannot reach, so you would need to try a square and see whether it leads to a contradiction. In our test of random 15x15 pictures, 30.4% had a unique answer but only 25.9% could be finished by line logic alone.

Are nonograms NP-complete?

Yes, in general. N. Ueda and T. Nagao proved in a 1996 technical report that the general nonogram problem is NP-hard, and because a proposed answer is easy to check, the yes-or-no question of whether clues have a solution is NP-complete. That is about the worst case: puzzles made for people can usually be finished with simple line-by-line reasoning.

Does every Nonogram on Extensive Harmony have one solution?

Yes. Our game draws a random picture, runs a line solver on its clues and keeps it only if the solver fills the whole grid, which proves the answer is unique and reachable without guessing. On Hard it needs about 3.8 draws on average, and in 6,000 generated puzzles it never had to give up.

Why are bigger nonograms more often ambiguous?

A bigger grid has more places where a group of squares can be swapped without changing any clue, and one such spot is enough to give a second answer. The share of pictures with a unique answer is 87.5% at 2x2 and 72.4% at 6x6; the trend is not perfectly smooth (3x3 has 75.0%, 4x4 79.9%), but from 4x4 on it falls.