The X-wing technique in Sudoku, explained
· 8 min read
The X-wing is where Sudoku stops being about one unit at a time. Everything before it — singles, subsets, locked candidates — lives inside a single row, column or box. An X-wing needs two rows and two columns held in mind at once, and that is why it feels like a step up.
It is also the pattern most often learned too early. It is worth knowing precisely when to reach for it, so the last section is as important as the first.
The pattern
Find a digit that appears as a candidate in exactly two cells in one row, and in exactly two cells in another row, with all four cells in the same two columns. Those four cells form a rectangle. The digit can then be removed from every other cell in those two columns.
The name comes from the two diagonals you can draw between the corners. Below, the digit 1 appears exactly twice in row 5 and exactly twice in row 9, and in both cases in columns 1 and 3:
Why it works
Take it in two steps. First, row 5 must contain a 1, and only those two cells can hold it — so either R5C1 or R5C3 is the 1. The same is true of row 9: either R9C1 or R9C3.
Now consider the only two ways that can be arranged:
- Row 5 takes column 1. Then column 1 already has its 1, so row 9 cannot use column 1 — row 9 must take column 3. Both columns now have their 1.
- Row 5 takes column 3. By the same argument row 9 must take column 1. Both columns again have their 1.
Either way, columns 1 and 3 both get their 1 from inside the rectangle. You never learn which corner is which — and, as with a naked pair, you do not need to. That is enough to clear the digit from the rest of both columns:
Two eliminations from a fair amount of work. That is typical, and it is worth being honest about: an X-wing rarely cracks a puzzle open on its own. It removes just enough to let a cheaper technique take over.
Rows and columns are interchangeable
Everything above works with the roles swapped. If a digit appears exactly twice in each of two columns, and those cells share the same two rows, then the digit is eliminated from the rest of those two rows.
This is not a second technique, just the same rectangle read the other way — but you have to search both orientations, and forgetting the column-first version means missing about half of them.
How to actually find one
Scanning all 36 pairs of rows for all nine digits is not a realistic thing to do by eye. Narrow it first — you need complete pencil marks, then:
- Pick one digit and count its candidate cells in every row. Write down only the rows where the count is exactly two, along with which columns.
- Look for two rows in that shortlist with matching column pairs. Usually the shortlist has two or three entries, so this is a glance rather than a search.
- Repeat by column for the other orientation.
- Then move to the next digit.
The key economy is step 1: “exactly two” is a hard filter that throws out most of the board instantly. Digits already placed six or seven times are the best candidates, because they have the fewest homes left.
When not to bother
This matters more than the technique. An X-wing costs real effort to find, and almost every position that has one also has something cheaper. Work through the list in order and only then look:
- Naked and hidden singles — a full sweep, all nine digits.
- Pointing pairs and box/line reduction — cheap, and they do not even need full marks.
- Naked pairs and triples, then hidden pairs.
- Only now, X-wings.
The failure mode is spending ten minutes hunting a rectangle in a position where a hidden single was sitting in the open. Beginners who learn the X-wing early get slower before they get faster, and this is why.
What comes after
An X-wing is the smallest member of a family. The same argument over three rows and three columns is a Swordfish; over four, a Jellyfish. Confusingly, the larger fish do not require exactly two candidates per line — two or three will do for a Swordfish, as long as all of them stay within the three chosen columns.
There is also a shorter path worth knowing: a Skyscraper is what you get when the rectangle is almost there — two rows with two candidates each, sharing one column but not the other. It is easier to spot than a full X-wing and turns up more often.
A note on this site: Explain next step teaches four techniques and stops short of the X-wing, and it says so rather than inventing an explanation. Expert puzzles here are defined as the ones that need patterns past those four — so if you have swept thoroughly on an Expert board and found nothing, a rectangle is a reasonable next thing to look for.
Keep reading
- Pointing pairs and box/line reductionLocked candidates in both directions: when a digit in a box is stuck on one line, and when a digit on a line is stuck in one box. Both shown on the same grid.
- Hidden pairs and hidden triples in SudokuHidden subsets are the mirror image of naked ones, and often easier to spot once you know to count digits instead of comparing cells. Worked example on a real grid.
- What actually makes a Sudoku puzzle hard?Clue count is a bad measure of difficulty, and here is why. How puzzles are really graded, why 17 clues is the minimum, and what “unique solution” guarantees.
Every diagram on this page is a real position from a generated puzzle, and every elimination shown is checked against that puzzle’s unique solution as part of the test suite. Want a move explained on your own board? Play a puzzle.