Sudoku solver step by step
Most people who get stuck on a sudoku are not missing a technique. They are working in the wrong order: hunting for clever deductions before the easy digits are on the board, or writing candidates in every cell before they have scanned for a single number. This page is the order to work in, from the moment you open the grid to the moment you decide you would rather have the answer. It is shorter than it looks — the whole routine takes about twenty minutes on a medium newspaper puzzle.
The four techniques themselves, with examples of how they work, are on the how to solve sudoku page. This page assumes you know what they are and tells you when to use each one.
Step 0 — Look before you write (2 minutes)
Do not start placing digits yet. First:
- Count the givens. A 9×9 puzzle normally starts with 22 to 36 numbers. If you count fewer than 20, the puzzle is either very hard or was copied incorrectly.
- Find the most frequent digit. Count how many times each of 1 to 9 appears. The digit that appears most often is the easiest to place, because more of its row and column crossings are already decided for you.
- Check for duplicates. Read every row and every column you can fill in quickly. Two of the same digit in one row means the puzzle as given is broken, and nothing you deduce from it will be true. It is worth 30 seconds now and saves you a wasted hour later.
That is the whole warm-up. The point is not to solve anything; it is to know what you are working with.
Step 1 — Scan digit by digit (5 to 10 minutes)
Take one digit at a time, in order, and ask where it can go in each 3×3 box that does not already contain it. Do not switch digits halfway. Finish all nine before you decide the scan is done.
This is the single most productive part of solving a sudoku, and it is also the part people rush. Two habits make it go faster:
- Start from the digit with the most copies already on the board. If there are six 7s, the remaining three 7s usually have only one place each to go.
- Work box by box, not row by row. Inside a box, the rows and columns that already hold the digit cross out cells quickly. Your eye follows the same path each time and gets faster with practice.
When this step is finished: you have passed over all nine digits and placed nothing new. Some puzzles crack here and hand you half the grid. Most hand you three to six digits.
Step 2 — Look for cells with one answer left (5 minutes)
A cell is a naked single when eight different digits already point at it — its row, its column and its box between them rule out everything except one number. You do not need candidates written in pencil to find these: pick an empty cell, name the digits already visible in its row, its column and its box, and count.
The best place to look is the row, column or box that already has the most numbers filled in. Fewer unknown digits means fewer numbers to count.
When this step is finished: you have walked the empty cells once and everything you could see by counting is filled in. Go back to Step 1 for any digit that got a new copy placed — one placement often opens up a scan you already gave up on.
Steps 1 and 2 alternate. Scan, place, count, place, scan again. On easy puzzles this loop alone finishes the grid.
Step 3 — Hidden singles (the step that breaks medium puzzles)
Now the cell has several candidates, but only one cell in a whole row, column or box can take a particular digit. The approaches are opposite to Step 2: instead of asking what can go in this cell, ask where in this unit can this digit go.
Pick one unit (a row, a column, or a box). Pick one missing digit. Check every empty cell in that unit: if exactly one of them can hold it, write it in, even if that cell has three other candidates pencilled in. The digit is hidden among the candidates, not the cell.
When this step is finished: you have swept all 27 units — 9 rows, 9 columns, 9 boxes — once. Sweep them in a fixed order so you can tell you have not skipped one.
Step 4 — Only now, write candidates
Pencil marks slow you down if you write them too early, because half of them will be crossed out by the scan before you use them. Write them when counting in your head stops being reliable — usually somewhere around the halfway point of a medium puzzle.
The useful version of this step:
- Fill candidates one box at a time, not cell by cell across the grid. A box is small enough to hold in your head.
- Cross a digit out everywhere in the box the moment it is placed, not just in the cell you placed it in.
- If a cell ends up with one candidate, you have a naked single — fill it and start the loop again.
When this step is finished: every empty cell in the box you chose has its full candidate list, and you have not yet found a placement from it. Move to the next box.
Step 5 — Box-line reduction, once
Look at a box where a digit can only go in cells that all sit in the same row, or all sit in the same column. That digit must be inside that row or column within that box, so it cannot go anywhere else in that row or column outside the box. Cross those candidates out.
This is the first technique that needs candidates on the board to be worth doing, which is why it comes after Step 4 and not before. Do this only after Steps 1 to 3 have stalled.
When this step is finished: you have removed something, or you have checked every box and found nothing to remove. If nothing came out of it, you are in Step 6.
Step 6 — The stuck checklist
When nothing moves, work through this list in order. In practice one of the first three catches it most of the time.
- Re-read your own digits. A digit written one cell to the left, or a 5 that should be a 6, poisons every deduction after it. This is the most common reason a grid looks impossible.
- Re-check the last three placements. The mistake is usually recent, not early.
- Sweep a unit you have not checked. If you have been working in the top three rows, the answer is often in a column you have not looked at for ten minutes.
- Look for a hidden single you dismissed. A cell with four candidates that you decided was "too messy" often holds a digit that has only one home in that unit.
- Take a break. Five minutes away genuinely works. Nothing about the grid changes, but your eye stops skipping the same cells.
What is not on the list: guessing. If you guess, you have to remember the guess and be able to undo it, and a unique answer does not guarantee that these four techniques will be enough. If they stall, consider more advanced deductions or use the solver.
Step 7 — When to stop and let the solver do it
Being honest about this saves time. There are three situations where a solver is not cheating, just faster:
- You only wanted the answer, not the practice. A puzzle from a newspaper you are not going to finish, a grid a friend sent you to check, a puzzle you are setting and want to verify. Go straight to the solver on the homepage and skip to the end.
- You need one nudge, not the whole grid. Press Enter your own puzzle, type your digits in, and press Hint — it adds one correct cell per press, so the rest of the solve stays yours. That is the difference between a hint and an answer.
- The grid looks broken. If it seems to have no solution at all, the digits were almost certainly entered wrong. Typing them into the board shows this immediately: repeating a digit in a row, a column or a box turns that cell red as you type, so a typo surfaces while you enter it rather than after you have built deductions on top of it. Press Solve and the board tells you which of the four cases you are in — a repeated digit, fewer than 17 givens, no solution, or more than one solution.
Once your grid is on the board, everything from Step 1 to Step 6 still works on it. Press Clear after a Solve and the digits the solver added come off, leaving your own numbers as a normal puzzle, with Hint and Check working on it.
The orders that do not work
Worth naming, because they are the usual reasons a solve goes badly:
- Candidates first, on a fresh grid. You fill 40 candidate lists, then discover that scanning would have placed six digits and crossed out half of what you wrote. Scan first, always.
- Jumping between digits during the scan. You lose track of which digits you have already swept, and you end up checking 4 three times and 8 not at all.
- Advanced techniques too early. Box-line reduction is powerful and completely useless on a grid where two naked singles are still sitting unfound.
- Guessing to "get moving". A guess you cannot undo turns a hard puzzle into an unsolvable-looking one, because the wrong digit is now indistinguishable from a given.
Where to go next
- The four techniques in detail, with what each one looks like on the board.
- What 9×9 actually means — the grid rules, the 27 units, and why 17 clues is the mathematical minimum.
- Open the board and try this order on a generated puzzle at Easy, Medium or Hard. Easy puzzles finish inside Steps 1 and 2, which is the point: the routine should feel boring before it feels clever.