Sudoku Solver โ Solve Any Puzzle Instantly
Stuck on a newspaper Sudoku? The AnyWordSolver Sudoku Solver takes any valid 9ร9 puzzle and computes its unique solution in milliseconds using backtracking search with constraint propagation. Enter the givens, hit Solve, and get the complete grid โ plus a built-in generator for fresh practice puzzles at every difficulty. Free, instant, no login.
How to Use the Sudoku Solver
- Enter the givens: type the known numbers from your newspaper, book, or app puzzle into the blank 9ร9 grid. Leave unknown cells empty.
- Hit Solve: the engine validates the input, then fills every remaining cell with the unique solution โ or tells you if the puzzle has no solution or multiple solutions.
- Study the answer: compare the solution against your stuck position. The cells where you diverged reveal exactly which deduction you missed.
- Generate practice: use the built-in generator to create fresh puzzles at Easy, Medium, Hard, or Expert โ or play them directly in our Sudoku game.
Sudoku Rules Refresher
- Rows & columns: every row and every column must contain the digits 1โ9 exactly once.
- 3ร3 boxes: the grid splits into nine 3ร3 sub-grids, each of which must also contain 1โ9 exactly once.
- No math required: despite the digits, Sudoku is pure logic and elimination โ no arithmetic.
- Unique solution: a proper Sudoku has exactly one solution. Our solver verifies uniqueness, so ambiguous puzzles get flagged, not faked.
Learn From the Solver โ 5 Techniques It Demonstrates
- Naked singles: a cell whose row, column, and box already contain 8 different digits must be the 9th. Spot these first โ they cascade.
- Hidden singles: within a row, column, or box, a digit with only one legal cell must go there even if that cell has other candidates.
- Naked pairs: two cells in one unit sharing exactly the same two candidates (say 3 and 7) claim those digits โ eliminate 3 and 7 from every other cell in that unit.
- Pointing pairs: when a digit's candidates inside a box all sit in one row or column, eliminate that digit from the rest of that row or column outside the box.
- X-Wing (advanced): a digit appearing in exactly two cells in two rows, aligned in the same two columns, eliminates that digit from all other cells in those columns.
Solver vs Practice โ When to Use Each
Use the solver to unstick yourself: enter the position, solve, find where you diverged, learn the missed technique, then replay similar puzzles in the Sudoku game at increasing difficulty. Solvers that only hand you answers build dependence; solvers paired with deliberate practice build skill. That is exactly how this page is designed to be used.
Common Solver Mistakes
- Entering givens in wrong cells. One transposed digit produces a "no solution" error or a wrong answer. Double-check each given against the source puzzle before solving.
- Solving instead of learning. If you copy answers without studying where you diverged, the next identical pattern will stump you again. Always identify the missed technique.
- Trusting ambiguous puzzles. Some app puzzles have multiple solutions due to generation bugs. If our solver flags non-uniqueness, the puzzle itself is broken โ find a better source.
What the Solver Actually Does
A Sudoku solver is not a pattern matcher. It is a constraint satisfaction engine, and the two techniques it combines โ constraint propagation and backtracking โ explain both why it never guesses wrong and why it feels instant.
Constraint propagation is the deduction layer. For every empty cell the solver maintains a candidate set: the digits 1โ9 that do not already appear in that cell's row, column, or 3ร3 box. Placing a digit removes it from the candidate sets of twenty other cells โ eight in the row, eight in the column, and the remaining cells of the box, with the overlaps counted once. That cascade is why one correct placement often unlocks several more.
Backtracking is the safety net. If propagation stalls โ no cell has a single candidate left โ the solver picks the most constrained empty cell, tries one candidate, and propagates again. If that branch produces a contradiction (a cell with no candidates), it undoes the guess and tries the next candidate. The search is exhaustive in the worst case, but on real puzzles the deduction layer does almost all the work and the guess stack stays shallow.
Two implementation choices matter for correctness. First, the solver validates the givens before searching: a duplicated digit in any row, column, or box means no solution exists, and it should say so immediately rather than searching forever. Second, it counts solutions rather than stopping at the first one. A well-formed puzzle has exactly one; if a second appears, the puzzle is ambiguous and the solver flags it instead of pretending the first answer is definitive.
A Worked Example: Row, Column, and Box Together
Take the classic newspaper puzzle below, with dots for empty cells. The three deductions that follow are the entire foundation of Sudoku, and each one uses the same candidate-set logic.
5 3 . | . 7 . | . . . 6 . . | 1 9 5 | . . . . 9 8 | . . . | . 6 . ------+-------+------ 8 . . | . 6 . | . . 3 4 . . | 8 . 3 | . . 1 7 . . | . 2 . | . . 6 ------+-------+------ . 6 . | . . . | 2 8 . . . . | 4 1 9 | . . 5 . . . | . 8 . | . 7 9
Step 1 โ row elimination at r5c5. Row 5 already contains 4, 8, 3, and 1. Column 5 already contains 7, 9, 6, 2, 1, and 8. The centre box (rows 4โ6, columns 4โ6) already contains 6, 8, 3, and 2. Union those three sets and you get 1, 2, 3, 4, 6, 7, 8, 9 โ every digit except 5. The cell has exactly one candidate, so r5c5 = 5. That is a naked single: the cell is forced by its own neighbourhood.
Step 2 โ a hidden single in row 3. Ask where the digit 1 can go in row 3. The empty cells are c1, c4, c5, c6, c7, and c9. Column 4 contains a 1 at r2c4, column 5 contains a 1 at r8c5, column 7 contains a 1 at r2c7, and column 9 contains a 1 at r5c9. The top-middle box contains a 1 at r2c4, and the top-right box contains a 1 at r2c7. Only c1 survives every filter, so r3c1 = 1 even though that cell had several candidates. This is the key distinction: a naked single is about the cell, a hidden single is about the digit.
Step 3 โ box logic. Inside the centre box, the digit 5 has only one legal home: r5c5. Every other cell in the box sees a 5 somewhere in its row or column. That is the same deduction as Step 1 viewed from the box's perspective, and it is the reason the three constraints are best applied together rather than one at a time.
After those placements, re-run the candidate sets: each new digit removes options from its row, column, and box, and new singles appear. That loop โ place, propagate, look for singles, repeat โ solves most easy and medium puzzles without a single guess.
When to Use a Solver and When to Learn
A solver answers "what is the solution". A player needs to answer "which deduction did I miss". Those are different questions, and using the tool for the first when you need the second is how people stay stuck at the same difficulty forever.
Use the solver when you are genuinely blocked and the alternative is quitting. Enter the position exactly as it stands โ all givens plus every digit you have correctly placed โ and compare the output to your grid. The first cell where your grid and the solution disagree is the exact point where your reasoning went wrong. That cell, not the final answer, is the useful output.
Do not use it to check every move. Constant verification prevents you from ever building the internal feedback loop that makes a solver fast, because you never sit with an uncertain deduction long enough to learn whether it was sound. A better ratio: solve unaided, mark the cell where you got stuck, then use the solver once at the end to study that position.
There is also a legitimate pure-use case: transcription. If you are transferring a puzzle from a newspaper into a digital format, or verifying that a puzzle you generated is solvable, the solver is doing data work rather than solving work. Nobody needs to feel guilty about that.
Difficulty Explained: Givens and Techniques
The number of givens is a weak proxy for difficulty, and treating it as a reliable one is the most common misconception in Sudoku. A 30-clue puzzle can require advanced chains; a 22-clue puzzle can fall to singles. What actually determines difficulty is the technique ladder required to finish without guessing.
- Easy: naked and hidden singles only. Solvable by scanning one unit at a time, no notation needed.
- Medium: singles plus locked candidates (pointing and claiming pairs). Requires looking at how a box interacts with a row or column.
- Hard: subsets (naked and hidden pairs, triples) and the simpler fish patterns. Requires pencil marks, because the deduction is about candidate sets rather than placed digits.
- Expert: X-Wing, Swordfish, XY-Wing, and short chains. Requires deliberate candidate notation and the discipline to eliminate rather than place.
- Extreme: long forcing chains, uniqueness arguments, or trial-and-error in practice. At this level even strong human solvers use a solver to verify.
Two useful facts frame the whole scale. The minimum number of givens that can define a unique Sudoku is 17 โ proven exhaustively in 2012 โ and puzzles at that minimum tend to be very hard, though not always. And the total number of completed 9ร9 grids is about 6.67 ร 1021, of which roughly 5.47 billion are essentially different once rotations, reflections, and digit relabelling are discounted. The puzzle you are solving is one arrangement out of a space that large, which is why "just try numbers" is not a strategy.
The Three Hard Techniques, Briefly
Once singles run out, the next tier of techniques all do the same thing: they eliminate candidates that look possible but cannot be true. Learning to see them is mostly about knowing where to look.
Naked pairs
Two cells in the same row, column, or box contain exactly the same two candidates โ say 3 and 7 โ and nothing else. Those two digits must occupy those two cells in some order, so they cannot appear anywhere else in that unit. Cross 3 and 7 out of every other cell in the unit. The pattern is easy to spot once you are writing full candidate lists; it is nearly invisible if you are only tracking placed digits. A naked triple is the same idea with three cells and three digits.
Pointing pairs
Inside a box, all the remaining candidates for a digit sit in a single row or column. Since the digit must go somewhere in that box, and every option lies on that line, the digit can be eliminated from the rest of the line outside the box. This is the most productive hard technique for beginners because it needs no notation: just ask, for each digit in each box, "are all its homes on one line?" Pointing pairs are also called locked candidates, and the mirror-image version โ a digit confined to one box within a row โ is called a claiming pair.
X-Wing
Find a digit that appears in exactly two cells in each of two rows, and those four cells occupy the same two columns. The digit must take one of the two positions in each row, which means the two columns are fully claimed by those rows โ so eliminate the digit from every other cell in both columns. The rectangle is the signature. X-Wing is the first technique that requires you to think across two units at once, which is why it feels like a jump in difficulty even though the logic is identical to a pair.
Common Input Mistakes
Most "the solver is broken" cases are transcription errors. The solver is deterministic: if the givens are right, the answer is right. Check these before assuming a bug.
- Transposed rows. Copying a puzzle from a photo or a newspaper often swaps two adjacent rows, especially when the grid lines are faint. One transposition usually produces "no solution" rather than a subtly wrong answer.
- Entering pencil marks as givens. Only place digits you know are part of the puzzle. If you enter a candidate you guessed as a given, you have changed the puzzle and the solution is meaningless.
- Using 0 and blank inconsistently. Some import formats use 0 for an empty cell, others use a dot, and some use spaces. A stray 0 read as a digit creates an instant duplicate and a false "no solution".
- Missing a given. Nine times out of ten this is why a puzzle "has two solutions". A puzzle with a digit removed really is ambiguous; the solver is correctly telling you the grid is under-constrained.
- Duplicated givens. Two 7s in one row is not a hard puzzle, it is an invalid one. Check for repeats in every row, column, and box before blaming the engine.
- Pasting a formatted string. Separators, box-drawing characters, and line breaks can shift the 81 characters out of alignment. Strip everything except digits and dots before importing.
Why a Valid Puzzle Has Exactly One Answer
Sudoku is a constraint problem with a very large but finite solution space. A puzzle is well-formed when its givens admit exactly one completion. That is not a stylistic preference; it is what makes the puzzle solvable by logic rather than by guessing.
If a grid has two valid completions, then every cell where they differ is genuinely undetermined by the givens. No amount of reasoning can choose between them, because both satisfy every rule. A solver that returns one answer without checking for a second is hiding that ambiguity, which is why proper solvers count solutions. If you get a "multiple solutions" message, the puzzle is broken โ usually because a clue was omitted in transcription or because the app generated it carelessly.
Publishers guarantee uniqueness during construction: they start from a complete grid and remove clues one at a time, keeping a removal only if the puzzle still has exactly one solution. That process explains why hard puzzles are not simply "puzzles with fewer numbers". Each removal is a negotiation between clue count and solvability, and the resulting technique requirement is what players experience as difficulty.
The one-answer guarantee also gives you a debugging tool. When your own solve produces a contradiction, you do not need to restart. Backtrack to the last cell you were unsure about, reopen its candidate set, and check whether you eliminated a digit for a valid reason. The unique solution means exactly one branch is correct, and every wrong branch will eventually contradict itself.
Import Tips โ 81-Digit Strings
Many sites share puzzles as 81-character strings (row by row, 0 or . for blanks, e.g. 530070000600195...). Paste the full string into the import box and hit Load โ the grid fills instantly. This is the fastest way to transfer newspaper, book, and app puzzles into the solver.
What the Solver Tells You, Line by Line
The status line under the grid is the solver's notebook. It is short by design, but every message it can print tells you something specific about the state of the board. Learning the vocabulary makes the tool much quieter to use, because you stop guessing what happened and start reading what happened.
| What you see | What it actually means |
|---|---|
| Empty board. Type, paste, or generate a puzzle. | Nothing has been entered yet. It is a starting prompt, not an error. |
| N empty cells left โ no conflicts so far. | A live count of what is still open, and a clean bill of health. This message updates after every keystroke. |
| Conflicts detected โ red cells break a rule. | A digit you typed shares a row, column or box with the same digit. Both cells turn red, and the red cells are the ones to fix first. |
| Fix the red conflicting digits first. | Solve refuses to run while a conflict exists. That is deliberate: a search from an invalid position can produce a misleading answer. |
| Import needs exactly 81 digits (0 or . = empty). | The import box takes a flat 81-character string, one character per cell, in reading order. Anything else is rejected before it reaches the grid. |
| Puzzle loaded โ Solve, or edit by hand. | The imported digits are now treated as givens. You can still type over the board before solving. |
| User entries cleared. | Clear removes only the digits you typed. The puzzle's givens stay on the board, so you can wipe your working and start again from the printed clues. |
| Generated: N clues in X ms โ unique solution. | The generator built a puzzle and confirmed that exactly one completion exists. N is the real clue count for that board, which is often a few higher than the difficulty label suggests. |
| Solved in X ms. | The search finished and the grid now holds the full solution. Cells you typed keep their own colour; solved cells are filled in separately so givens stay visually distinct. |
| No solution exists for this puzzle โ check for mistakes. | The givens are contradictory. Almost always this is a transcription error rather than a broken puzzle. |
| Complete and valid! | Every square is filled and no rule is broken. The board is a genuine solution, whether you typed it or the solver did. |
Two small things about the board itself are worth knowing. The digits printed by the puzzle's source stay in a different style from the digits you type, so you can always see at a glance which squares are given and which are yours. And clicking any square highlights its row, its column and its box at once โ that highlight is the elimination tool described next.
Using the Highlight as an Elimination Tool
Sudoku has exactly three constraints, and every legal digit has to satisfy all three at once: it cannot repeat in its row, it cannot repeat in its column, and it cannot repeat in its box. The solver's selection highlight draws all three of those neighbourhoods around the square you click, which turns the rule into something you can check by eye in a second.
- Pass one โ read the neighbourhood, not the cell. Click an empty square and look at what is already in the highlighted band. Anything already present in that band is a digit that cannot go here. If exactly one digit survives, you have a naked single and it is free.
- Pass two โ flip the question. Instead of asking which digit fits this cell, ask where a particular digit can go in this row, column or box. If it has only one home, it is a hidden single, and it goes there even when that cell looks busy with other candidates.
- Pass three โ look for sets, not digits. Two empty squares in the same unit holding exactly the same two candidates claim those two digits, so you can cross them out everywhere else in that unit. Three squares holding the same three candidates work the same way.
- Pass four โ only now reach for the solver. Enter your position, press Solve, and compare the filled grid against yours. The first cell where the two disagree is the exact place your reasoning broke. That single cell is worth more than the whole solution.
A useful habit falls out of this: type in only the digits you are sure of, and let the red colouring tell you when you are not. A cell you typed by mistake is not neutral โ it poisons every crossing it touches, and the red conflict markers make that visible immediately rather than three moves later. Keeping the board clean of guesses means the highlight always shows you the true candidate set.
Our Sudoku tips and strategies guide works through the same four passes in more detail, with the advanced patterns that only appear once singles and pairs stop paying off.
A Four-Step Routine That Keeps the Solver Useful
The solver is a diagnostic instrument, and like any instrument it produces the wrong answer if you feed it the wrong question. This is the routine that keeps it on your side.
- Attempt first, with a marker. Solve the puzzle from the printed clues with no help, and mark the cell where you stalled. Stopping there is the important part; stopping with a blank board is not, because then the solver has nothing to compare against.
- Enter your position, not just the givens. Type the puzzle's givens and then add every digit you placed yourself. The solver's answer now describes the grid as it stands in front of you, so the comparison is meaningful.
- Read the first disagreement. Solve, then scan for the earliest cell where your grid and the solution differ. Re-derive that cell on paper, naming the technique you skipped. Usually it is a pair you never looked for, because naked and hidden singles had already covered your attention.
- Replace the puzzle, not the habit. Generate a fresh board at the same difficulty from the dropdown and solve it without the tool. If you stall at the same kind of cell again, you have found the specific gap worth practising, and the techniques guide will point you at it.
The same four steps work for a puzzle you are transferring from a newspaper, except that step one becomes transcription and step three becomes proofreading: if the solver reports no solution, the error is in what you typed, not in the puzzle.
When the Solver Earns Its Place
It helps most in three situations: you are genuinely blocked and the alternative is quitting; you are checking whether a puzzle someone else made is solvable and unique; or you are moving a puzzle between formats and need the givens verified. In all three, the solver is doing work you could not reasonably do by hand.
It helps least when you use it to avoid the interesting part. Because it returns the completed grid rather than the next logical step, it cannot show you which technique would have produced a digit โ so a solver used as a shortcut teaches you nothing and quietly makes the next puzzle harder. The rule of thumb is simple: one call to the solver per puzzle, made after a genuine attempt, and never before.
Once the 9×9 grid is comfortable, the same elimination logic carries over to the variants on this site: Killer Sudoku adds cage sums, Jigsaw Sudoku swaps the regular boxes for irregular regions, Sandwich Sudoku adds outside line sums, and Sudoku X adds the two diagonals. If you would rather start smaller, the mini Sudoku plays the same rules on a 6×6 board, and the full list sits on our number games hub.