A nonogram is a picture hidden in a grid, described only by numbers. Each row and column has a clue listing the lengths of its blocks of filled cells, and your job is to work out exactly which cells are filled. Nonograms are also known as hanjie, griddlers and paint by numbers, and the rules are the same under every name.
This guide teaches the method in the order our grader uses it, from simple counting that solves most easy grids to the techniques that only the hardest puzzles need. Every example is a single row you can picture or sketch on scrap paper.
The rules
- Each number in a row's clue is a block of consecutive filled cells in that row, given in order from left to right.
- Column clues work the same way, from top to bottom.
- Between two blocks there is at least one empty cell. Before the first block and after the last one there can be any number of empty cells, including none.
- A clue of 0 means the whole line is empty.
- Every puzzle on our site has exactly one solution, and it can be reached by logic alone.
Mark empty cells as well as filled ones
Solving is a matter of deciding every cell, not just the filled ones. When you know a cell is empty, cross it out. Crosses are as valuable as fills: they split a line into shorter gaps and tell you where blocks can't go. On paper, a small dot or an X works; on our board, crossing a cell is part of the play controls, and the Check button flags any fill or cross that is wrong.
Step 1: overlap counting
Start with lines whose clues are large compared with the line. Imagine the block pushed as far left as it can go, then as far right. Any cell it covers in both positions must be filled. In a 10-wide row with a clue of 7, the block covers cells 1 to 7 at the far left and 4 to 10 at the far right, so cells 4 to 7 are filled. In a 15-wide row, a clue of 11 fills the middle seven cells, 5 to 11.
The same works with several blocks. In a 10-wide row with the clue 4 3, the tightest fit needs 4 + 1 + 3 = 8 cells, leaving 2 cells of slack. Pushed left, the 4 sits in cells 1 to 4 and the 3 in cells 6 to 8; pushed right, the 4 sits in 3 to 6 and the 3 in 8 to 10. The 4 is in cells 3 and 4 both times, and the 3 is in cell 8 both times, so those three cells are filled.
Counting also finishes lines. If the clue adds up, with gaps, to the full width, the line is completely fixed: 3 2 3 in a 10-wide row fills cells 1 to 3, 5 and 6, and 8 to 10. And once a line has as many filled cells as its clue asks for, everything else in it is empty. Cells that no block can reach at all, such as the cells left of a cross when the gap is too short for the first block, are empty too.
Step 2: edges and glue
Overlap counting ignores filled cells; the next step uses them. Say a 10-wide row has a clue of 4 and cell 2 is filled. The block must cover cell 2, so it starts at cell 1 or cell 2 and ends by cell 5 at the latest. Cells 2 to 4 are filled in every position, and cells 6 to 10 can't be reached, so cross them out.
A filled cell right at the edge is even stronger. In a row with the clue 3 2, a filled cell 1 means the first block starts there, so cells 1 to 3 are filled and cell 4 is crossed. A cross works like an edge: a block can't straddle it, so a filled cell just beyond a cross glues the block to that side.
On our site, the difference between easy and medium nonograms is mostly how often this edge reasoning is needed. Easy grids fall largely to counting; medium ones keep asking you to push blocks against known cells.
Step 3: whole-line reasoning
Sometimes pushing blocks left and right tells you nothing, yet the line still has a forced cell. The fix is to consider every way the clue can fit around what you already know. Take a 5-wide row with the clue 1 1 and the middle cell filled. Pushed left, the blocks sit in cells 1 and 3; pushed right, in cells 3 and 5. The overlap method finds nothing, because cell 3 belongs to a different block each time.
List the arrangements instead. The filled cell is either the first 1 or the second, so the row is cells 1 and 3, or cells 3 and 5. In both, cells 2 and 4 are empty. More simply: a block of one can never touch another filled cell, so both neighbors of a lone 1 get crossed. Hard puzzles on our site need this kind of reasoning at least once.
Step 4: the two-line check
The hardest grids, our expert level, include a point where every line on its own is stuck. The way through is a short, disciplined test: pick one undecided cell, suppose it is filled, and follow only certain line logic from there. If that leads to a line whose clue can no longer fit, the supposition was false, so the cell is empty.
This is not guessing. You keep the result only when it ends in a contradiction, and you look only one step deep. Good cells to test are those where the row and column are both nearly finished, because the consequences show up quickly.
Putting it together
Work in sweeps. Do every row with overlap counting, then every column, then go back to the rows, because each new cell changes what its crossing line can do. After any harder deduction, return to simple counting; our grader does the same, and so should you, since the easy moves are usually waiting.
Begin with the 5×5 nonograms to get the feel of counting, then move up through the sizes on the nonograms page or try the daily nonogram. The nonogram solving tips page collects quick rules of thumb for bigger grids, and if a puzzle from elsewhere won't come out, the nonogram solver can tell you whether it has a single answer at all.