Nonogram Solver
Type the row clues and the column clues, one line each, and press Solve. Every row and every column is solved on its own first: for each line the solver works through every arrangement of its clue that fits the squares already decided, keeps the squares all of those arrangements agree on, and repeats until nothing changes. Where squares are still undecided it branches, and it carries on past the first answer to see whether a second exists, so a set of clues with two pictures is reported as ambiguous with both pictures shown rather than one being quietly chosen for you. Clues that contradict each other are named before any picture is offered: the two totals that disagree, the row that asks for more squares than the grid is wide, or the line that cannot be filled once its neighbours are known. Grids run to 25 squares a side, squares can be pinned by hand, and everything happens in this tab.
The clues have changed since the last run. Press Solve to work the grid out from what is in the boxes now.
Enter one line of clues for each row and each column, using spaces between the numbers in a run and a 0 for a line with no filled squares, then press Solve. Grids run from 1 to 25 squares on a side. The picture is a keyboard: arrow keys move, F pins a square filled, B pins it blank, backspace unpins it, and Enter solves. A square you pin filled shows white and a square you pin blank shows a red tint, and both stay where you put them: that is how you break a tie or enter the squares a book already printed. Clues stay in this browser, and the page’s Start over button forgets them.
Three sets of clues and what comes back
- one solution
- two solutions, both shown
- named as contradictory, no picture
Common questions
- How do I enter the clues?
- Set the width and the height, then put one line of clues in the row box for each row of the grid, top row first, and one line in the column box for each column, left column first. Numbers in a line are separated by spaces or commas, so "3 1 1" and "3,1,1" read the same, and a line with no filled squares at all is written as 0 or left blank. Lines can also be separated by slashes, which is how clues are usually written out in a sentence: "3 / 1 1 / 5" is three rows. The trailing newline a text box leaves at the end is not counted as a line. If the number of lines does not match the number of rows or columns, the page says how many it found and how many the grid needs instead of padding or cutting anything.
- What does it mean when a nonogram has more than one solution?
- It means the clues do not pin down a single picture: two or more grids satisfy every row clue and every column clue, and nothing in the puzzle chooses between them. A properly set nonogram has exactly one. This solver counts as it searches and stops at the second solution it finds, because the difference that matters is one answer or more than one, not how many more, so the readout says either 1 or more than 1. When it says more than 1, both grids are on screen, the first in the picture and the second underneath it in block characters, and Copy puts both on the clipboard. That usually means a number was missed when the clues were copied in, and it is worth checking them against the source before blaming the puzzle.
- Why does it say my clues are contradictory?
- Because no grid can satisfy them, and it says which part broke. Three checks run in order. A clue that needs more squares than its line has is named with the room it needs: "6 5" wants twelve squares with the gap between the runs, so it cannot sit in a row ten wide. Then the two totals are compared, since the row clues and the column clues count the same filled squares: if one adds up to 44 and the other to 43, a number is missing, extra or mistyped. Last, the solver itself can run into a line that cannot be filled in any way once the lines crossing it are known, and it names that row or column with its clue. None of the three returns a half solved picture, because a picture that satisfies only some of the clues is not an answer to anything.
- How big a grid can it solve, and what happens on a hard one?
- From 1 to 25 squares on a side, which covers the puzzles printed in books and magazines. Most of them never need a search at all: the 10 by 10 example the page opens on is settled by propagation alone, and the readout says so under Method. Harder grids branch on an undecided square and try it both ways. That search carries a budget of 60,000 line solves, and when a grid uses it up the answer is unresolved, not impossible: the page shows every square propagation could settle, says how many of them there are, and tells you the limit was on the search rather than on the clues. Pinning one or two squares you are sure of often settles the rest in a second run.
- Can I fill in squares I already know?
- Yes. Click a square in the grid to pin it filled, click again to pin it blank, and a third click unpins it. From the keyboard, arrow keys move around the grid, F pins a square filled, B pins it blank, backspace unpins it, and Enter solves. A square you pinned filled shows white and one you pinned blank shows a red tint, so your own squares are always distinguishable from the ones the solver worked out. Pinned squares are part of the puzzle from then on: they decide an ambiguous grid, and a square pinned where the clues cannot allow it is reported as a contradiction on that row or column rather than ignored.
- Is anything uploaded?
- No. The clues, the propagation and the search all happen in this browser tab, and the page makes no request while you work: there is no puzzle library to fetch and no server to send your clues to. Once the page has loaded it keeps working with no connection at all. The clues you type are kept in this browser alone so the page opens where you left it, and the Start over button at the top of the page forgets them. Copy puts the clues, the picture and the status on your clipboard as plain text, with the second solution included when there is one.
Exact constraint solving: a grid it returns satisfies every clue you entered, and it looks for a second solution so it can tell you when the puzzle is ambiguous rather than picking one. Contradictory clues are named instead of half solved.