How to solve Sudoku
Every Sudoku in our books can be solved by logic alone, with no guessing. This guide takes you from the first easy placements to the patterns that crack hard and extreme puzzles. The same row and column techniques also help with Calcudoku, Futoshiki and Killer Sudoku.
In the examples, rows are numbered 1 to 9 from the top and columns 1 to 9 from the left, so "r5c3" means row 5, column 3. Small numbers in a square are candidates: the values that square could still hold.
The rules
Fill the grid so that every row, every column and every 3×3 box contains each of the numbers 1 to 9 exactly once. The numbers already printed are the clues and never change.
Sudoku builds on the much older Latin Square, a grid in which every row and column holds each number once. Standard Sudoku adds the nine 3×3 boxes as a third rule, and those three overlapping rules are what make the logic work.
A tip before you start: once the easy placements run out, pencil in the candidates for each empty square. Most of the techniques below work by removing candidates until only one is left.
Sole candidate
Pick an empty square and check its row, its column and its box. Cross off every number you can see in any of them. If only one number is left, that is the answer for the square.
In the example, the green square's row already holds 2, 4, 5 and 7, its column holds 1, 8 and 9, and its box holds 2 and 6. That rules out everything except 3.
Unique candidate
This works the other way round. Pick a number and a box, and ask: where in this box can that number go? Every row and column that already contains the number blocks the squares it passes through. If only one square in the box is left, the number goes there, even if that square still has other candidates.
In the example we are placing an 8 in the middle-left box. The 8 in row 6 blocks the bottom row of the box, the 8s in columns 2 and 3 block those columns, and the top-left square is already filled with a 7. The only square left for 8 is the green one.
Block and row or column interaction
Sometimes you can't yet say exactly where a number goes in a box, but you can say it must be in one particular row or column of that box. When that happens, the number can't appear anywhere else in that row or column outside the box.
In the example, the 2 in column 2 rules out the middle column of the middle-left box, and the other squares are filled. So the box's 2 must be in one of the two green squares, both in row 5. Whichever it is, row 5 gets its 2 from this box, so 2 can be crossed off every other square in row 5.
Block and block interaction
Look at three boxes side by side (or stacked). If, in two of them, a number is confined to the same two rows, then those two boxes take both of those rows for that number. The third box must place it in the remaining row.
In the example, the 6s in columns 3 and 6 and the filled squares in row 2 mean that in each of the top-left and top-middle boxes, 6 can only go in rows 1 or 3 (green). Between them they use up rows 1 and 3, so the top-right box's 6 must be in row 2, and 6 is crossed off rows 1 and 3 of that box.
Naked subsets (pairs, triples and quads)
If two squares in the same row, column or box have exactly the same two candidates and nothing else, those two numbers must go in those two squares. You don't know which way round yet, but you can remove both numbers from every other square in that row, column or box.
In the example, two squares in column 6 can only be 4 or 7 (green). So 4 and 7 are taken, and they can be removed from the other squares in the column (red). The same idea works with three squares that share three candidates (a naked triple), or four with four (a naked quad).
X-Wing
An X-Wing uses two rows and two columns. Choose a number. If in two rows that number can only go in the same two columns, the four squares form a rectangle. The number must sit in opposite corners of it, either top-left and bottom-right or top-right and bottom-left.
Either way, each of the two columns gets its copy of the number from one of those rows. So the number can be removed from every other square in those two columns.
In the example, 4 can only go in the green squares in rows 2 and 8 (the rest of each row, red, can't hold a 4). The green squares line up in columns 2 and 8, so 4 can be removed from the rest of columns 2 and 8.
Swordfish and larger fish
A Swordfish is an X-Wing stretched over more rows. The idea is the same: if a number is confined to the same set of columns across the same number of rows, those rows use up all of those columns between them. You can then remove the number from the rest of those columns.
Our example uses four rows and four columns (the four-row version is sometimes called a Jellyfish). Follow it in four steps:
Forcing chains
When nothing else works, follow a chain of squares that each have just two candidates. Assume one value, follow the consequences from square to square, and see what happens. If the chain leads to a contradiction, the assumption was wrong, so the other value must be right.
In the example, the bottom-middle box can only take its 5 in one of two squares: r7c6 or r8c5 (the arrow). Suppose r8c5 were 3 rather than 5. Then:
- r8c2 (1 or 3) can't be 3 because of row 8, so it's 1.
- r4c2 (1 or 7) can't be 1 because of column 2, so it's 7.
- r4c6 (5 or 7) can't be 7 because of row 4, so it's 5.
- r7c6 (5 or 7) can't be 5 because of column 6, so it's 7.
Now the box has nowhere left for its 5, which is impossible. So r8c5 can't be 3, and must be 5.