Sudoku techniques

All 40 sudoku techniques our solver uses, from the full house to forcing chains, in the order it tries them. Each comes with a real position where the solver finds it and a grid you can keep solving.

Spot the technique

Pick a technique. The grid shows a real position where the solver finds it: try to spot the pattern, then press Show the step.

These are all the sudoku techniques our solver knows, from easiest to hardest, in the exact order it tries them. Each one has a real position where the solver finds it, with the cells and units highlighted and the solver's own explanation. Press Apply it to make the move and keep solving from there. The names match the hints in our sudoku solver.

The solver always takes the easiest technique that makes progress, so a puzzle's rating is the hardest technique it needs: Easy (singles), Medium (pointing, box/line, pairs), Hard (triples, X-wing, XY-wing), Expert (quads, swordfish, XYZ-wing, short one-digit patterns, coloring, W-wing, jellyfish, unique rectangles, remote pair, BUG+1, finned X-wing), Master (finned swordfish, chains, almost locked sets, forcing chains) and Extreme (trial). Of 12,000 puzzles we generated by removing clues from random full grids while the solution stayed unique, 4,984 were Easy, 2,225 Medium, 576 Hard, 1,716 Expert and 2,499 Master; none needed a trial step. New to sudoku? Start with how to solve sudoku.

Full house

A row, column or box has one empty cell left; it takes the one missing digit.

Hidden single

In a row, column or box, a digit fits in only one cell, because every other empty cell sees that digit somewhere. Scan one digit at a time across the boxes, then the lines.

Naked single

A cell where eight digits are already ruled out by its row, column and box, or by earlier eliminations. The last candidate is the answer. The solver checks hidden singles first.

Pointing pair (or triple)

Inside a box, every candidate for a digit lies in one row or one column. The digit must be in that line inside the box, so it comes out of the rest of the line.

Box/line reduction

The reverse: in a row or column, every candidate for a digit lies inside one box. The digit is in that box on that line, so the rest of the box loses it.

Naked pair

Two cells in one unit with the same two candidates and nothing else. Those two digits are used up by the pair, so they leave every other cell of the unit.

Hidden pair

Two digits that can only go in the same two cells of a unit. The cells must hold those two digits, so all their other candidates go.

Naked triple

Three cells in a unit whose candidates, taken together, are only three digits. A cell does not need all three: 1 2, 2 3 and 1 3 is a triple. Those digits leave the rest of the unit.

Hidden triple

Three digits confined to the same three cells of a unit. Every other candidate in those cells is removed.

X-wing

A digit has exactly two places in each of two rows, and they fall in the same two columns: the corners of a rectangle. The digit takes opposite corners, one per column, so it can be removed from the rest of both columns. It also works with rows and columns swapped. More examples on the X-wing page.

XY-wing

Three cells with two candidates each: a pivot XY that sees two wings, XZ and YZ. Whatever the pivot is, one wing becomes Z, so any cell that sees both wings cannot be Z.

XYZ-wing

Like the XY-wing, but the pivot holds all three digits XYZ. One of the three cells is Z, so Z comes out of cells that see all three.

Naked quad

Four cells in a unit with only four digits among them; those digits leave the rest of the unit. In 12,000 generated puzzles the solver needed one in only 29, because simpler techniques almost always make progress first.

Hidden quad

Four digits confined to four cells of a unit; the cells lose every other candidate. The solver needed one as its chosen step in just 2 of 12,000 puzzles, so some examples here were found by asking for a hidden quad directly.

Swordfish

An X-wing on three lines: in three rows, a digit's candidates lie within the same three columns, two or three per row. Each of those columns gets its copy from these rows, so the rest of the columns lose the digit. 143 of the 12,000 puzzles needed one.

Skyscraper

A digit has exactly two places in each of two rows, and one end of each pair shares a column. Those two ends cannot both hold the digit, so one of the other two ends does, and any cell that sees both of them loses it. It works with columns too. 1,678 of the 12,000 puzzles used one.

Two-string kite

A digit has two places in a row and two in a column, and one end of each lies in the same box. Those two cannot both be the digit, so it sits at one of the far ends, and the cell that sees both far ends loses it. 1,373 puzzles used one.

Simple coloring

Follow one digit through units where it has exactly two places, coloring the cells in two alternating colors: one color holds every copy. If two cells of the same color see each other, that color is wrong. A cell that sees both colors cannot hold the digit.

W-wing

Two cells with the same two candidates, X and Y, that do not see each other. If a unit elsewhere has X in only two places, one seeing each cell, the pair cannot both be X; one is Y, so cells that see both lose Y.

Empty rectangle

Inside a box, every candidate for a digit lies in one row or one column, in an L or cross shape. Add a column outside the box where the digit has only two places, one of them on the row of the box: if that one holds the digit, the digit of the box is pushed into the column of the box; if not, the other place holds it. One cell sees both outcomes and loses the digit (it works with rows and columns swapped too). 589 puzzles used one.

Jellyfish

The four-line fish: four rows whose candidates for a digit lie within four columns, or the other way round. It is rare: 2 of the 12,000 puzzles needed one, and some examples here were found by asking for it directly.

Unique rectangle (type 1)

Four cells at the corners of a rectangle across two boxes. Three of them hold only the same two digits. If the fourth could also be just those digits, they could swap and the puzzle would have two solutions, so the fourth cell loses both. It relies on the puzzle being unique, and the solver does not use it on grids with diagonals, cages or other extra rules.

Unique rectangle type 2

Two corners hold only the two rectangle digits, and the other two hold the same digits plus one extra digit, the same in both. One of those two must take the extra digit, or the rectangle could swap, so cells that see both lose that digit.

Unique rectangle type 4

Two corners hold only the rectangle digits, and in a row, column or box that holds the other two corners, one rectangle digit has no other place. One of those corners is that digit, so neither can be the other rectangle digit.

Unique rectangle type 3

The two corners with extra digits act like one cell holding just the extras: one of them must take an extra digit. Together with other cells of their row, column or box they form a naked subset, so its digits leave the rest of that unit.

Hidden unique rectangle

One corner holds only the two digits. If the opposite corner has the first digit in only the rectangle's places along both its row and its column, it cannot be the second digit: that would force the first digit into the other two corners and leave a rectangle that could swap. 935 puzzles used one, more than the plain type 1.

Remote pair

A path of cells that all hold the same two digits, each seeing the next. The values alternate along the path, so two cells an odd number of steps apart hold different digits, and a cell that sees both loses both digits. In all 12,000 puzzles another technique got there first, so these examples were found by asking for a remote pair directly.

BUG+1

Every empty cell has exactly two candidates except one, which has three. If that cell did not take the digit appearing three times in its row, column and box, the grid would have two solutions, so that digit goes there.

Finned X-wing (and sashimi X-wing)

An X-wing with one or two extra candidates, the fin, in one of its boxes. Either a fin cell holds the digit or the X-wing works, so the cells the X-wing would clear that also see the fin lose the digit. When the fin stands in for a corner of the rectangle, the pattern is called sashimi. More on the X-wing page.

Finned swordfish (and sashimi swordfish)

The same idea on three lines: a swordfish with fin cells in one box removes the digit only where the swordfish and the fin agree. It is the first technique of the Master level.

X-chain (and X-cycle)

Follow one digit through strong links (only two places in a row, column or box, written =) and weak links (two cells that see each other, written -). A chain that starts and ends with a strong link puts the digit at one of its two ends, so cells that see both ends lose it. A chain that closes into a loop is an X-cycle. The skyscraper and the kite are short X-chains. The grid draws strong links as solid lines and weak links as dashed ones.

XY-chain

A chain of cells with two candidates each, every cell seeing the next. If the first cell is not Z, the chain forces the last cell to be Z, so Z is at one of the two ends, and cells that see both lose it. The XY-wing is the shortest XY-chain.

Alternating inference chain (AIC)

The general chain: a strong link can be the two places of a digit in a unit or the two candidates of a cell, and a weak link joins two candidates that cannot both be true. A candidate that clashes with both ends is removed. The hint writes the chain in the usual notation, for example (4)R2C3 = (4)R2C7 - (7)R2C7 = (7)R5C7. It was the solver's most frequent Master step: 7,273 times in 1,612 puzzles.

Grouped inference chain

An AIC in which a node can be a group: two or three cells of one box that share a row or column, standing for the digit being in one of them. Written like (4)R2C7/8, groups let a chain pass through a box where the digit has more than two places.

ALS-XZ

An almost locked set is a group of cells in one unit with one candidate more than cells, such as two cells holding 1, 2 and 3 between them. Take two such sets sharing a digit X whose cells all see each other: at most one set holds X, so the other is left with exactly its other digits. If they also share a digit Z, one of them must hold Z, and cells that see every Z in both lose it.

ALS-XY-wing

Three almost locked sets: a middle set linked to one outer set by a digit X and to the other by a digit Y. The middle set holds X or Y, which pushes one outer set to drop its link digit and hold a digit Z they share, so cells that see every Z of the outer sets lose it.

Cell forcing chain

When no chain or set works, the solver tries each candidate of a cell with two or three candidates and follows only singles and box/line overlaps. If every branch leads to the same placement or removal, that result holds whatever the cell turns out to be. The hint lists each branch, such as R1C1=3 → R1C5=7 → R5C5=4, and the grid draws dotted arrows from each step to the next.

Digit forcing chain

The same with the two or three places of a digit in a row, column or box: one of them holds the digit, so a result reached from every place is certain.

Contradiction chain

A single assumption followed to a dead end: if a digit in a cell forces another cell to lose every candidate, or leaves a row, column or box with no place for a digit, that digit is removed from the cell. 167 of the 12,000 puzzles needed one, and it is often the step that breaks the hardest puzzles open.

Trial and error

When nothing on this list applies, the solver picks a cell with the fewest candidates. Its exact search has already proved the solution is unique, so every other digit in that cell leads to a contradiction; the step just does not show the whole chain. None of the 12,000 generated puzzles needed it. These examples come from famous puzzles built to be as hard as possible, such as Easter Monster and Golden Nugget, which still need one or two trial steps after everything above. A puzzle that needs it is rated Extreme.

Variant puzzles add their own steps: cage combinations and the 45 rule in the killer sudoku solver, and diagonal units in the sudoku X solver. The jigsaw sudoku solver uses the same techniques, with irregular regions in place of boxes. The chain, set and forcing techniques run on grids of 9 by 9 and smaller; the unique rectangles only on plain grids without extra rules.

Practice these techniques on our play pages: classic sudoku online, killer sudoku, samurai sudoku and the big 16x16 sudoku, where the hint names the technique for each step.

Solver tested . Found a problem? Tell us.

Questions

What is the hardest sudoku technique?

Among the techniques this solver uses, the forcing chains come last: cell and digit forcing chains and contradiction chains, after the alternating inference chains and almost locked sets, all at the Master level. Puzzle fans go further, with nested forcing chains and rare patterns this solver does not have; a few famous puzzles, like Easter Monster, still need a trial step here, which is what the Extreme rating means.

Which sudoku techniques do I need most?

Singles first, then box/line reduction, naked pairs, hidden pairs and pointing pairs. In 12,000 puzzles we generated, 4,984 needed only singles, and box/line reduction was needed in 6,533.

What is the difference between naked and hidden pairs?

A naked pair is two cells whose only candidates are the same two digits; it clears those digits from the rest of the unit. A hidden pair is two digits that can only go in two cells; it clears the other candidates from those two cells.

Is the unique rectangle technique allowed?

It assumes the puzzle has exactly one solution, which every proper sudoku does. Our solver proves uniqueness with an exact search before it gives any hint, so the step is safe here. On a puzzle with several solutions it would not be.

What do = and - mean in a sudoku chain?

= is a strong link: at least one of the two candidates is true, because a digit has only those two places in a unit or a cell has only those two candidates. - is a weak link: the two candidates cannot both be true, because their cells see each other or they share a cell. A chain alternates the two, so a chain that starts and ends with = proves one of its two ends is true.

Why does the solver sometimes use trial and error?

Because none of its 39 logical techniques applies in that position. None of the 12,000 puzzles we generated needed it; a few famous puzzles built to be the hardest, like Easter Monster and Golden Nugget, still do. The solver then picks a cell with few candidates and shows that every digit but one leads to a contradiction. Puzzles that need this are rated Extreme.