X-Wing: How to Find It and Why It Works
The X-wing is the first technique most people learn that looks at the whole grid instead of one row, column or box. It sounds advanced, but the logic is short, and once you've seen one you will start finding them in expert puzzles.
An X-wing works on candidates, so you need full notes. Our pencil marks guide covers how. Rows are numbered 1 to 9 from the top and columns 1 to 9 from the left.
The pattern
Pick one digit. Find two rows where that digit has exactly two possible squares each, and where those squares are in the same two columns. The four squares form the corners of a rectangle.
In the first row the digit is in one of its two corners; in the second row, the same. And because the two corners in one column can't both hold the digit (a column only holds it once), the digit must sit in two opposite corners: top-left and bottom-right, or top-right and bottom-left. Those two diagonals form the X that gives the technique its name.
Either way, the digit ends up once in each of the two columns. So every other square in those two columns can't have it, and you can cross it off.
The same works with rows and columns swapped: two columns where the digit has the same two possible rows clear the digit from the rest of those rows.
A real example
This position comes from a puzzle with exactly one solution. Every simpler technique (singles, locked candidates, and pairs, triples and quads) has already been used, so this X-wing is the next step.
14 | 9 | 147 | 135 | 2 | 15 | 8 | 6 | 37 |
| 2 | 3 | 6 | 48 | 48 | 7 | 1 | 9 | 5 |
| 8 | 5 | 17 | 139 | 39 | 6 | 37 | 2 | 4 |
| 6 | 8 | 45 | 37 | 1 | 45 | 2 | 37 | 9 |
14 | 7 | 3 | 2 | 6 | 9 | 5 | 14 | 8 |
59 | 2 | 1459 | 3457 | 35 | 8 | 37 | 14 | 6 |
| 7 | 4 | 2 | 59 | 59 | 3 | 6 | 8 | 1 |
39 | 1 | 89 | 6 | 78 | 2 | 4 | 5 | 37 |
35 | 6 | 58 | 148 | 478 | 14 | 9 | 37 | 2 |
Highlighted: 7 the pattern · struck through: 7 removed
Look at the digit 3. In column 5, only rows 3 and 6 can hold a 3, and in column 7, only rows 3 and 6. That's the rectangle, shown with the four highlighted candidates. Here the pattern runs down two columns, so it clears rows: the 3s must sit in opposite corners, one in row 3 and one in row 6. No other square in those two rows can be a 3.
That removes 3 from row 3, column 4 and row 6, column 4. After that, the next step our solver found was an XY-wing.
Checking it the long way
If the rectangle argument feels too quick, test one of the eliminations directly. Suppose row 3, column 4 were the 3. Then row 3 would have its 3, so neither of the rectangle's corners in that row could be 3. Both columns 5 and 7 would then need their 3 in the rectangle's other row, and a row can only hold one 3. That's impossible, so the assumption was wrong. Every elimination an X-wing makes can be checked this way, and doing it a few times is the quickest way to trust the pattern.
Why "wing", and why "fish"
The name comes from the X drawn by the two diagonals the digit can take. Solvers also group the X-wing with larger patterns called "fish": the same reasoning with three lines is a swordfish and with four a jellyfish. You don't need the names to use them, only the idea that a set of lines can use up a digit in an equal set of crossing lines.
How to look for X-wings
- One digit at a time. X-wings are about a single digit, so scan the grid for one digit only. It helps to pick a digit that has many candidates left.
- Find lines with exactly two spots. Go along the rows and note which ones have the digit in only two squares. Then do the same for the columns.
- Match the positions. Two rows with their two spots in the same pair of columns are an X-wing. Two columns with their spots in the same pair of rows are one too.
- Check for something to remove. An X-wing is only useful if the digit appears elsewhere in the cleared lines. Often it doesn't, and you move on.
Mistakes to avoid
- Clearing the wrong lines. If the two lines with exactly two spots are rows, you clear the columns. If they are columns, you clear the rows. Clearing the same lines you started from removes nothing useful and can remove a correct candidate if your rectangle wasn't quite right.
- Three spots in a row. If either base row has the digit in a third square, it isn't an X-wing. (It might be part of a swordfish, which is next.)
- Out-of-date notes. An X-wing is only as good as the candidates it's built on. A missing or extra note can fake a rectangle.
Bigger versions
The X-wing is the two-line member of a family. Three rows whose candidates for a digit fit into three columns make a swordfish; four make a jellyfish. Our guide to swordfish and jellyfish explains them, with real examples. A different kind of pattern, using squares with two candidates rather than one digit, is the XY-wing.
Practise
X-wings appear in our expert puzzles, which need something beyond singles, locked candidates and naked pairs. Not every expert puzzle has one, but many do. If you are not yet comfortable with locked candidates and pairs, start there: they come up far more often.