How to solve sudoku

How to solve sudoku from the first clue to the last: the rules, scanning, pencil marks and the five techniques that finish most easy and medium puzzles. Practice below, with a hint whenever you need one.

Practice puzzle

Pick a level and solve. Every puzzle was generated by the solver, has exactly one solution, and is rated by the hardest technique it needs.

Learning how to solve sudoku takes one rule and a handful of habits. This guide goes from the rules to the techniques that crack most easy and medium puzzles: scanning, pencil marks, singles, pairs, pointing and box/line reduction. Every grid below is a real position, and the Show the step button runs the same engine as our sudoku solver, so the highlights and the explanation come straight from it. Press Apply it to make the move and keep solving from there.

The rules

A sudoku is a 9 by 9 grid split into nine 3 by 3 boxes. Some cells hold given digits, the clues. Fill every empty cell with a digit from 1 to 9 so that each row, each column and each box contains every digit exactly once. That is the whole rule set. A proper puzzle has exactly one solution, and there is no arithmetic: the digits are just nine different symbols.

Cells are named by row and column: R3C5 is row 3, column 5, counting from the top left. Rows, columns and boxes are called units. Every cell sits in three units and sees the 20 other cells that share one of them.

Step 1: scan for hidden singles

Pick a digit, say 1, and look at one box. Every 1 already placed rules out its whole row and column. If those lines cover all but one empty cell of the box, the 1 must go in that cell. This is a hidden single: the digit has only one place in a unit, even though the cell itself might take other digits. Work through the digits 1 to 9 box by box, then do the same along rows and columns. Easy puzzles fall to this alone.

When a row, column or box has only one empty cell left, the missing digit goes there. The solver calls this a full house, the easiest step of all.

Step 2: pencil marks

When scanning stops working, write the candidates: in each empty cell, the small digits not yet ruled out by its row, column and box. Do it once for the whole grid, then keep the marks up to date: every time you place a digit, erase it from every cell that the new digit sees. Pencil marks turn a search in your head into a checklist, and every technique past the singles works on them. In the grids here, tick Pencil marks to see them.

Step 3: naked singles

A naked single is a cell with only one candidate left: its row, column and box already hold the other eight digits between them. Hidden singles look at one digit across a unit; naked singles look at one cell across all digits. Use both.

Step 4: naked and hidden pairs

When no single is left, look for two cells in one unit that have the same two candidates and nothing else, for example 4 and 7. One of them is 4 and the other is 7, even if you cannot tell which yet. Either way, no other cell in that unit can be 4 or 7, so you cross those out. That is a naked pair.

The mirror image is a hidden pair: two digits that can only go in the same two cells of a unit. Those two cells must hold those two digits, so every other candidate in them can be erased. Hidden pairs are harder to see because the two cells are often cluttered with other marks.

Step 5: pointing and box/line reduction

These two use the overlap between a box and a line. If, inside one box, a digit can only go in cells of one row, that digit must sit in that row inside the box. So it cannot appear in the same row outside the box, and you cross it out there. This is a pointing pair (or triple, with three cells). The same works with columns.

Box/line reduction is the same idea the other way round: if, in a row or column, a digit can only go in cells that all belong to one box, the rest of that box loses that digit.

After singles, these two are the steps you will use most. In 12,000 puzzles we generated and rated with the solver, a box/line reduction was needed in 6,533 and a pointing pair in 2,218; a naked pair in 3,298 and a hidden pair in 2,129.

A whole puzzle, step by step

Here is an easy puzzle from the start. Try to find each step yourself, then press Show the step to compare with the solver and Apply it to move on. The buttons above the grid switch between four puzzles.

When to guess, and why you should not need to

Guessing means writing a digit you are not sure of and following it until the grid breaks or comes out. It can work, but a wrong guess spreads errors over the grid before you notice, and it teaches you nothing about the puzzle. If you are stuck, first redo your pencil marks: a missed elimination is the usual cause. Then look again for pairs, pointing and box/line reduction. Harder puzzles need the patterns on our sudoku techniques page, such as the X-wing. Every puzzle our solver rates Easy to Master can be finished with logic alone, no guess needed; the Master level uses chains and forcing chains. None of the 12,000 puzzles we generated needed a guess. Only a few famous puzzles built to be the hardest still get a trial step, rated Extreme, and even then it tests a single cell where every other digit leads to a contradiction.

Practice puzzles

The practice grid at the top of this page has puzzles at four levels. Each was generated by the solver, checked to have exactly one solution, and rated by the hardest technique it needs: Easy uses singles only; Medium adds pairs, pointing and box/line reduction; Hard adds triples, X-wings and XY-wings; Expert needs at least one of the advanced patterns. Press Hint when you are stuck and you get the next step with the reason. Solving a puzzle from a book or an app? Type it into the sudoku solver for hints on that exact grid. Once the classic rules feel easy, try the killer sudoku or jigsaw sudoku solvers.

Ready to try it? Play sudoku online at the easy level first, then sudoku X or jigsaw sudoku for a variation.

Solver tested . Found a problem? Tell us.

Questions

What is the first thing to do in a sudoku?

Scan for hidden singles. Take one digit at a time and look at each box: the copies of that digit already placed rule out rows and columns, and often only one cell is left. When scanning finds nothing, write pencil marks.

Do you have to guess in sudoku?

Usually not. Every puzzle our solver rates Easy to Master can be finished with logic alone, and none of the 12,000 puzzles we generated needed a guess. Only a few famous puzzles built to be the hardest still need a trial step, and even that is a test of one cell, not a blind guess.

What are pencil marks in sudoku?

Small digits written in an empty cell to list the candidates it can still take, given its row, column and box. Erase a mark as soon as the same digit is placed in a cell it sees. Most techniques beyond singles work on pencil marks.

What is the difference between a naked single and a hidden single?

A naked single is a cell with only one candidate left. A hidden single is a digit with only one possible cell in a row, column or box; that cell may still have other candidates. Both let you place a digit right away.

How many clues does a sudoku need?

At least 17 for a unique solution. Gary McGuire and colleagues proved in 2012, with an exhaustive computer search, that no 16-clue sudoku has exactly one solution. The number of clues does not set the difficulty; the techniques needed do.