Stuck on the Tuesday puzzle, one cell from done
It is 9:40 on a Tuesday evening. The puzzle has collapsed to four empty cells, and three of them are easy — you can see the cascades from here. The fourth, row five, column seven, refuses to commit. Every digit you try breaks something two rows down, and you have now re-derived the same three contradictions four times. The pencil has made two attempts and erased both.
This is the exact moment a sudoku solver is for. Type the grid in, or paste it from your puzzle app, and the solution appears instantly — with a conflict checker that catches mistyped clues, a step count you can interrogate, and the answer filled into the grid so you can read it the way you read any finished puzzle. Whether you take the whole solution or just the one cell you needed is between you and your conscience, and this page will have opinions about that later.
The interesting part of a solver is not that it is fast — everything is fast. The interesting part is how it is fast, because the method is a genuinely elegant piece of computer science: constraint propagation to shrink the problem, then a search that almost never runs. This page covers the workflow, the machinery, worked examples with real step counts, and the edge cases that separate a good solver from a confident liar.
What this solver does, precisely
The contract is simple: grid in, verified solution out. You enter clues by tapping cells or pasting the 81-character string format used by puzzle forums. The solver validates the clues first — no duplicate digits within any row, column or box — and only then attempts the solve, so a mistyped 7 never gets laundered into a confidently wrong answer grid.
Three outcomes exist, and a solver worth using distinguishes all three: solved, with the completed grid and a step log; unsolvable, meaning the clues contradict each other somewhere downstream even though no two clues clash directly; and ambiguous, meaning the puzzle has multiple solutions — which tells you the puzzle itself is broken, usually because too many clues were removed somewhere in its life.
Everything runs in your browser. That is not a speed claim — any server would also be fast — it is a simplicity claim: the solver is a page, not a service, which means no ads interposed between you and the grid, no session, and the same behavior on a plane as on wifi.
Solving a puzzle, step by step
The typical session takes under a minute, most of it typing. The tool sits above this section if you want to follow along with today's newspaper.
Enter the clues
Tap a cell and hit a number, or use keyboard entry on desktop — arrow keys move, digits fill. Cells that came with the puzzle are visually distinct from anything you type, the same given-versus-pencil convention paper has used for decades.
Or paste the string
The paste box accepts 81 characters in a row or 9 lines of 9, with zeros, dots or spaces as blanks. Pasting is the honest answer to a 29-clue puzzle: it is faster and it eliminates transcription errors, which are the leading cause of unsolvable grids.
Watch the conflict check
As you type, matching digits in the same row, column or box highlight together. Fix a clash before solving — the solve button stays locked while a direct contradiction exists, because no solver can outrun bad input.
Solve
One tap fills the grid. The step counter reports what happened — placements by technique, whether any guessing was required, and how many guesses were retracted — and the solve completes in a time measured in fractions of a millisecond for normal puzzles.
Take what you needed
Full solution, or clear it and re-derive by hand with one cell revealed as a hint. The clear button resets to your clues and nothing else, so the puzzle survives the solver.
That last step deserves emphasis because it is the difference between a solver and a spoiler machine. A good tool lets you take one hint and walk away — the same discipline as checking one answer in the back of the textbook instead of the whole page.
The grid as a system of constraints
A sudoku board is 81 cells governed by 27 units: 9 rows, 9 columns and 9 boxes. Each unit must contain each digit 1 through 9 exactly once. Every cell belongs to exactly three units — its row, its column, its box — and therefore has 20 peers: the 8 other cells in its row, the 8 in its column, and the 4 in its box that are not already counted. Twenty peers, and a cell cannot equal any of them.
From that single rule the solver derives its working representation: for every empty cell, the candidate set — digits not present among its 20 peers. A solved cell has a candidate set of exactly one digit; the grid is finished when all 81 do. Everything that follows is clever bookkeeping on those sets, and the technique names you may know from puzzle books — naked single, hidden single, naked pair — are all statements about them.
It is worth pausing on how small this makes the problem. Nine-by-nine sudoku has roughly 6.67 x 10^21 distinct solution grids — a number with 21 zeros — yet a specific puzzle's constraints collapse the search space so hard that a phone processor finishes in the time it takes the screen to redraw. Constraint tightness, not processor speed, is the story.
Constraint propagation: singles and pairs
Propagation is the loop at the heart of the solver: find a cell with exactly one candidate, place it, which removes that digit from its 20 peers' candidate sets, which may leave another cell with one candidate, and so on. The puzzle-book name is naked single — a cell whose own candidates have been whittled to one. Its sibling is the hidden single: a digit that has only one possible home within a unit, even though that cell still shows several candidates. Both are certainties wearing different disguises.
Naked pairs are the first technique that eliminates rather than fills. Two cells in the same unit whose candidate sets are both exactly {6, 9} form a pair: those two cells must be 6 and 9 in some order, so no other cell in that unit can be either digit. The elimination does not place anything — it strips candidates from neighbors, which occasionally births a naked single elsewhere. Here is a constructed but realistic row to make it concrete:
Input
Row state: 4 _ _ 8 2 3 _ 1 _ — the missing digits are 5, 6, 7, 9. Candidate sets: c2 = {6, 9}, c3 = {6, 9}, c7 = {5, 9}, c9 = {5, 7}. Columns and boxes have blocked the rest.Output
c2 and c3 form a naked pair on {6, 9}, locking those digits in the row. Eliminate 9 from c7 → c7 = {5} → place 5. Then c9 = {7} → place 7. Four blanks became two placements and a remaining pair, with no guessing anywhere.The solver applies singles and pairs in rounds, cheapest techniques first, and re-runs propagation after every placement. For most published puzzles — easy through diabolical — that loop alone reaches the solution, and the step log shows it: dozens of placements, zero guesses. When propagation stalls with cells still ambiguous, the search engine takes over, and that handoff is where the algorithm earns its keep.
Backtracking, and why it almost never runs
The fallback is the classic recursive algorithm: pick an empty cell, try a candidate digit, recurse; if the recursion hits a contradiction, erase the digit and try the next one. Every wrong guess is undone — backtracked — and the trail of undos is how you count the search's real cost. The pseudocode fits in five lines:
def solve(grid):
cell = fewest_candidates(grid) # MRV: most constrained first
if cell is None:
return True # no empty cells left
for digit in candidates(cell):
place(cell, digit)
if solve(grid):
return True
erase(cell) # backtrack: undo and retry
return FalseOne decision inside those five lines does most of the work: choosing the most constrained cell — the one with the fewest candidates — rather than the first empty one. It is the same instinct as a human solver looking for the easiest cell on the board, formalized as the minimum remaining values heuristic. Picking a two-candidate cell means at most one wrong branch; picking the first empty cell can mean wandering a subtree the size of a small city.
Numbers make the argument better than adjectives. Take the famous example puzzle used later on this page — 30 clues, the one from the sudoku Wikipedia article. A plain backtracker that fills the first empty cell with digits 1 through 9, checking only direct conflicts, tries 4,208 placements before finishing. The same puzzle, run through propagation first, places all 51 missing digits as naked singles and finishes with zero guesses. Four thousand trial placements versus fifty-one certain ones — that ratio is the entire case for constraint propagation, measured on a real grid rather than asserted.
| Strategy | Trial placements | Guesses undone | Result |
|---|---|---|---|
| First-empty-cell backtracking, conflict check only | 4,208 | — | Solved, eventually |
| Constraint propagation (singles + pairs), search on stall | 51 | 0 | Solved, instantly |
A worked example, grid in and grid out
Here is the classic 30-clue example — the puzzle illustrated on the sudoku Wikipedia page — exactly as it should be typed into the solver. Dots or zeros mark blanks; either parses.
Input
53..7.... 6..195... .98....6. 8...6...3 4..8.3..1 7...2...6 .6....28. ...419..5 ....8..79
Output
534678912 672195348 198342567 859761423 426853791 713924856 961537284 287419635 345286179 Step log: 51 naked singles, 0 hidden singles, 0 pairs used, 0 guesses, 0 backtracks. Solved by propagation alone.
The step log is the interesting half of that block. Fifty-one placements, every one a cell whose candidates had been whittled to a single digit — no search, no guesses, no undo. The cascade never stalls: every placement clears the way for the next, which is exactly what makes this puzzle a textbook example rather than a hard one.
For contrast, take the same solution grid and remove clues down to 26 while keeping the solution unique. The solver's log shifts: 33 naked singles, then 22 hidden singles — the propagation loop has to work harder because fewer clues anchor the early cascades — and still zero guesses. Watch the technique mix change while the method holds; that is what a step log is for. Push a grid far enough down in clues, though, and propagation eventually stalls with ambiguity remaining, which is where the backtracker quietly earns its seat in the engine.
Edge cases: broken grids and honest answers
Most solver bugs are really honesty bugs — the tool returns an answer when the truthful response was none. These are the boundaries this solver keeps.
- Direct clue conflicts — two 8s in one row — are flagged before solving, with both cells highlighted. No solve is attempted on a contradictory input.
- Unsolvable-but-consistent puzzles pass the clue check and fail in search: the clues never clash directly, but every completion breaks a constraint somewhere. The solver reports unsolvable rather than returning a partial grid dressed as an answer.
- Under-clued puzzles can have thousands of solutions. The solver detects multiplicity, reports the puzzle as ambiguous, and shows one completion clearly labeled as not the answer. If you generated the puzzle yourself, fewer than 17 clues guarantees trouble.
- Seventeen is the floor: McGuire, Tugemann and Civario proved in 2012 by exhaustive search that no 16-clue puzzle with a unique solution exists. The proof reportedly consumed about 7.1 million core-hours, which is a reminder that easy-to-play and easy-to-analyze are different universes.
- Transposition errors are the leading user-side failure: one wrong digit makes a legitimate puzzle unsolvable, and the symptom is an error message rather than a solution. The conflict checker catches the direct cases; the rest fall to proofreading your entry.
- Variant grids — 6x6, 16x16, Samurai, Killer — are out of scope for this solver. The engine's unit model is hard-coded to 9x9 because that is where the daily-use demand lives.
Who keeps a solver bookmarked
The stuck-solver crowd is the obvious constituency, and the returning-session pattern in the usage data backs it up: people come back on roughly a daily rhythm, which is the rhythm of newspaper puzzles. Within that group the honest split is between checkers — solve by hand, verify here — and cell-takers, who use the solver as a precision hint machine for exactly one stubborn digit. Both uses are legitimate; the step log serves both.
Learners use it as a technique trainer. Run a puzzle, read the log, and the abstract names attach to concrete cells: this is what a hidden single looked like, here is the naked pair that broke the logjam. Teachers assign the same exercise — solve by hand, then reconcile your reasoning against the machine's trail — because the disagreement is where the learning happens. It works better than it sounds, and the constructed row example earlier in this page is drawn from exactly that exercise.
Developers show up too, usually mid-argument: implementing the algorithm, benchmarking propagation versus search, or generating puzzles by removing clues from a solution grid and testing uniqueness — the same pipeline that produced the 26-clue variant above. For that crowd the honest numbers on this page are the point: 4,208 versus 51 is a benchmark result you can reproduce from the example block.
Solver versus hint apps versus paper
The alternatives differ mostly in how much of the answer they insist on giving you.
| Approach | Gives you | Costs you |
|---|---|---|
| This solver | The full grid plus a technique-level step log, instantly, free | The solve, if you take everything at once |
| Hint-style apps | One graded nudge at a time, paced | A subscription, usually, and a nudge schedule the app controls |
| Paper and patience | The entire point of the hobby | Tuesday evenings, plural |
No tool on this site will lecture you about the third row of that table. The recommendation, offered once and then dropped: use the step log after finishing by hand, and the grid-fill when you genuinely need out. And if the puzzle-a-day habit has you hunting variety elsewhere, the Trivia Question Generator and Wordle Solver scratch the same daily-ritual itch in different costumes — links to both sit two sections down.
A puzzle grid is nobody's business
Privacy sections on a sudoku page are usually filler. This one gets one honest paragraph: the grid you enter is processed entirely on your device, nothing is stored, and there is no account to tie your solving habits to. The only network request the page makes is the ordinary fetch of the page itself.
The reason it is worth saying at all is architectural rather than principled — the same engine that runs propagation in your browser tab would run identically on a server, but a page that computes locally has no reason to exist as a service with log files, rate limits or an eventual premium tier. Solver pages that grew into apps grew those things. This one stays a page.
Questions the search box keeps asking
Collected from search queries and email, answered in the order they arrive. The longer treatments live in the sections above.
How fast is this sudoku solver?
Effectively instant — a standard 9x9 puzzle solves in well under a millisecond on any modern phone or laptop, because constraint propagation fills most of the grid before the search engine even wakes up. Even adversarial puzzles built to torment brute-force solvers finish in the low milliseconds here.
What happens if I enter an invalid puzzle?
The conflict checker runs before solving. Two identical digits in the same row, column or box get flagged immediately with the offending cells highlighted, and the solver refuses to run rather than returning nonsense. A puzzle with no solution but no direct clue conflicts is reported as unsolvable after search.
Can a sudoku have more than one solution?
Yes, if it is under-clued. Properly published puzzles have exactly one, but if you remove too many clues, multiple grids satisfy every constraint. The solver detects this and reports the puzzle as ambiguous rather than pretending its first answer is the answer.
Does the solver explain its steps?
It shows the technique trail — which cells fell to naked singles, which needed hidden singles, whether any naked pairs were used, and how many guesses backtracking required. It is a step log rather than a tutorial, but pairing it with the techniques section on this page makes each entry readable.
What is the minimum number of clues a sudoku can have?
Seventeen. A 2012 proof by McGuire, Tugemann and Civario established by exhaustive computer search that no 16-clue puzzle with a unique solution exists, after years of cataloging thousands of valid 17-clue puzzles.
Can I paste a puzzle as text?
Yes. The input accepts the common one-line format — 81 characters with zeros, dots or blanks for empty cells — as well as 9 lines of 9. Paste from a puzzle app or forum and the grid fills itself.
Is using a sudoku solver cheating?
Against yourself, maybe; against the paper, no. The productive uses are checking a finished grid, unsticking exactly one cell so you can finish by hand, and studying the step log to learn the technique you missed. If your goal is the solve itself, treat the solver as an answer key, not a teammate.
Does the solver work on my phone?
Yes — the grid is touch-optimized with a number pad that appears on tap, cell highlighting for the active row, column and box, and no install required. It runs on iOS Safari, Android Chrome and every desktop browser.
Neighbor tools and the short version
The solver lives among a small cluster of daily-driver diversions, and these three share the most workflows with it.
- Wordle Solver — the same constraint-elimination brain applied to five letters instead of 81 cells.
- Trivia Question Generator — for the post-puzzle coffee break that wants questions instead of digits.
- Random Number Generator — dice, draws and raffles when the evening moves on from puzzles.
When the grid needs an arbiter rather than a roll of the dice, neighbors like the DnD Dice Roller and the Wheel Spinner cover the chance-based half of game night — the solver stays deterministic on principle.
The short version: this is a 9x9 sudoku solver that validates your clues, distinguishes solved from unsolvable from ambiguous, and shows the technique trail — naked singles, hidden singles, pairs, and the rare honest guess — instead of hiding it. The method is documented above with numbers you can reproduce, the classic example puzzle is printed in full, and the grid never leaves your device. Type in Tuesday's puzzle and see which kind of evening it becomes.
Sources and further reading
- ArXiv — There is no 16-clue Sudoku (McGuire, Tugemann, Civario, 2012)(arxiv.org)
- Peter Norvig — Solving Every Sudoku Puzzle(norvig.com)
- Wikipedia — Sudoku(en.wikipedia.org)
- Wikipedia — Backtracking(en.wikipedia.org)
We cite primary sources (standards bodies, government agencies, official documentation) wherever they exist so you can verify every number on this page yourself.