Sudoku Solver
Enter any Sudoku to solve it instantly or step by step, with each technique explained.
Type the givens, or tap a cell then a digit. 0 givens so far.
The puzzle is solved first. Then see the solution, step through it, or add your own digits and check them.
Type or paste a Sudoku to see its solution, or work through it one logical step at a time, each step naming its technique and pointing at the cells it rests on. Add the digits you have so far to check them, or to get the next step from where you are. Each puzzle is also graded, from Easy to Extreme.
The solver runs in your browser, and the puzzle you are working on stays on this device, so a reload carries on where you were.
How to use it
Enter the puzzle on the empty grid: select a cell and type, and each digit moves on to the next cell, so a puzzle can be typed straight through; 0, . or Space leaves a blank. Or paste 81 characters, row by row, with 0 or . for an empty cell (spaces and line breaks are ignored). Digits that clash in a row, column or box show in red.
Lock givens solves the puzzle before anything else, and says so if it has no solution. The givens then show in bold, and digits you add go on top of them in another colour. The arrow keys move around the board, Backspace, Delete or 0 clears a cell, Ctrl+Z undoes and Ctrl+Y redoes.
- Solve fills every open cell, replacing any wrong digits of yours; Undo takes it back.
- Next step first points out a digit of yours that is wrong. Otherwise it finds the simplest next step from the givens and your correct digits, highlights the cells involved and explains it; Place or Apply to notes makes it. A step that rules digits out writes them into the notes of the cells it touches, struck through, so it shows even when the grid has no notes.
- Check marks your wrong digits in red and says how many of your digits are right, without solving anything.
- Show all steps lists the whole solving path from the givens, in order.
- Play this puzzle opens it in Sudoku, with a timer, notes and hints. Edit puzzle goes back to the givens.
A puzzle with more than one solution is still solved, and Solve fills in one of them. Next step, Check and the step list need exactly one solution, so they are off for it. A sparse grid can take long to solve; solving stops after 10 seconds.
How it solves and grades
Each row, column and 3 × 3 box holds the digits 1 to 9 once. A cell is named by row then column, so r4c7 is row 4, column 7, and the boxes are numbered 1 to 9 from the top left.
The solution comes from a backtracking search, which also looks for a second solution, so a puzzle with several is told apart from one with a single answer. The steps solve it the way a person does: take the simplest step any technique finds, apply it, and start again from the simplest. The grade is the level of the hardest technique that path needs, the same grading as Sudoku's puzzles.
Where no technique finds a step, the puzzle is “Beyond Extreme”, and the step list ends with the cells left to the search. Next step then offers to reveal the open cell with the fewest candidates.
Worked examples
A Hard puzzle, step by step
- Puzzle
..6 ... 34. ... 46. 9.. 8.. ... .5. 65. .7. ... 3.. 8.2 ..5 ... .5. .97 .2. ... ..1 ..5 .31 ... .81 ... 4..
- Grade
- Hard, 56 steps
- Step 1
- Hidden single: r4c9 is the only cell in box 6 that can be 4.
- Step 2
- Hidden single: r4c8 is the only cell in box 6 that can be 3.
- Step 15
- Pointing pair: in box 5, 6 can only go in r6c4 and r6c6, both in row 6. Whichever holds it is the 6 of row 6: r6c7 can't be 6.
Singles place a digit at each of steps 1 to 14. Step 15 is the first that only rules a digit out, with a pointing pair or triple, a hard technique.
AI Escargot, beyond the techniques
- Puzzle
1.. ..7 .9. .3. .2. ..8 ..9 6.. 5.. ..5 3.. 9.. .1. .8. ..2 6.. ..4 ... 3.. ... .1. .4. ... ..7 ..7 ... 3..
- Grade
- Beyond Extreme
- Step 1
- Hidden single: r8c3 is the only cell in box 7 that can be 1.
- Step 2
- No logical step found — the remaining 57 cells are solved by trial (backtracking).
Solve still fills it in at once, and Next step offers to reveal a cell where the logic runs out.
A puzzle with more than one solution
- Puzzle
..6 ... 34. ... 46. 9.. 8.. ... .5. 65. .7. ... 3.. 8.2 ..5 ... .5. .97 ... ... ... ... ... ... ... ... ...
- Result
- More than one solution
- One solution
716 589 342 523 467 981 894 123 756 652 971 438 379 842 615 148 356 297 231 695 874 465 738 129 987 214 563
Hard #10 with its last three rows left empty. Solve shows one of its solutions, but no single answer exists to check digits against or to step towards.
Techniques and levels
| Level | Techniques it adds |
|---|---|
| Easy | Full house, Hidden single in a box, Naked single |
| Medium | Hidden single in a row or column |
| Hard | Pointing pair or triple, Box-line reduction, Naked pair, Hidden pair |
| Expert | Naked triple, Hidden triple, X-Wing, XY-Wing, Naked quad, Hidden quad |
| Master | Swordfish, XYZ-Wing, Simple colouring, Unique rectangle (type 1) |
| Extreme | X-chain, XY-chain, Alternating inference chain |
Frequently asked questions
See also
- Sudoku — to play puzzles at six levels, a daily puzzle, or this one with a timer and hints.