XY-Wing is the most elegant technique in sudoku, and the one people most often read about three times without quite getting it. It uses three cells, each with exactly two candidates, and it eliminates a single digit elsewhere on the board. Nothing gets placed.
Here is the whole idea in one sentence: a cell with two candidates that can “see” two other two-candidate cells makes one digit impossible for every cell that sees both of them. The rest of this page is just unpacking that.
XY-Wing
How to spot it
Find a cell with two candidates (the pivot) that sees two other two-candidate cells, each sharing one digit with the pivot and one digit with each other.
What to do
Whichever way the pivot resolves, one pincer takes the shared digit - so it can be removed from any cell that sees both pincers.
Other techniques: Naked single, Hidden single, Locked candidates, Naked pair / triple, Hidden pair, Naked triple, X-Wing, Swordfish, Naked quad, Hidden triple, XYZ-Wing, W-Wing
The three cells
- The pivot — a cell with two candidates, say {6, 9}.
- Two pincers — two other cells, each with two candidates, that the pivot can see (same row, column or box).
- Together, the three cells use exactly three digits: {6, 9}, {6, 8}, {8, 9}.
One pincer shares one digit with the pivot, the other shares the pivot’s other digit, and the two pincers share a digit with each other. That shared digit — here 8 — is the one that gets eliminated.
Why it works
The pivot is either 6 or 9. There is no third possibility.
- If the pivot is 6, then the pivot’s 9 must go somewhere — and the pincer that shares only 6 with the pivot cannot hold 6 any more, so it is forced to its other digit.
- If the pivot is 9, the same argument forces the other pincer.
In both cases, one of the two pincers ends up holding the shared digit 8. Whichever it is, a cell that can see both pincers cannot be 8 — because 8 is already used up in one of them, and a cell that sees both would contradict whichever branch is true. Since the elimination holds in both branches, it holds always.
That is the part worth internalising: an XY-Wing is a proof by cases that produces a fact independent of the case.
A real example. Take this position:
1 2 3 4 5 6 7 8 9
+-------+-------+-------+
1 | 8 6 2 | 4 . . | 5 9 3 |
2 | 3 4 9 | . . . | 1 8 7 |
3 | 1 7 5 | 8 9 3 | 6 4 2 |
+-------+-------+-------+
4 | . 3 1 | . 4 . | . 6 5 |
5 | . 2 . | 1 . . | . 3 4 |
6 | 5 . 4 | 7 3 6 | . 2 1 |
+-------+-------+-------+
7 | . 1 7 | . . 4 | 3 5 . |
8 | 2 5 . | 3 . . | 4 7 . |
9 | 4 . 3 | 5 . . | 2 1 6 |
+-------+-------+-------+
Read the three relevant cells:
- r7c1: {6, 9} — the pivot.
- r8c3: {6, 8} — a pincer. It sees the pivot (both are in the bottom-left box) and shares the 6.
- r7c9: {8, 9} — the other pincer. It sees the pivot (same row) and shares the 9.
Three cells, three digits: 6, 8, 9. The pincers share 8.
What to do with it
Lay the three cells out before reading the elimination — the pattern is the point:
| cell | candidates | role | what it means |
|---|---|---|---|
| r7c1 | {6, 9} | pivot | the cell that is either 6 or 9, never anything else |
| r8c3 | {6, 8} | pincer | sees the pivot in its box, so it cannot be the pivot’s value |
| r7c9 | {8, 9} | pincer | sees the pivot in its row |
| r8c9 | — | ★ | sees both pincers, so it cannot be 8 |
Find a cell that can see r8c3 and r7c9 — same row, column or box as each of them. That is r8c9 (marked ★): it is in row 8 with r8c3, and in column 9 with r7c9.
Whatever the pivot turns out to be, one of those two pincers is an 8. So delete 8 from r8c9.
(Here the elimination happens to reduce r8c9 to a single candidate — but even when it does not, the deletion is what makes the next move visible.)
The part people get wrong
“Sees” means shares a row, column or box. It does not mean “is nearby”. A pincer that shares only a diagonal, or nothing at all, breaks the pattern — and so does a pivot with three candidates. If any of the three cells holds more than two candidates, it is not an XY-Wing.
Also note the direction: the eliminated digit is the one the two pincers share. Confusing it with a digit the pivot shares is the classic mistake, and it produces deletions that are not valid.
Where it sits
XY-Wing is level 8 in our grading — Evil territory. Together with X-Wing and Swordfish it covers essentially every technique our bank needs. If a puzzle cannot be solved with everything on this site, our engine does not publish it.
Common mistakes
Making the pincers see each other instead of the pivot. The pattern is a pivot {A,B} with one pincer {A,C} and one pincer {B,C}, each pincer seeing the pivot. The pincers need not see each other — and if they do, the shape you have is not the one this technique describes.
Getting the doomed digit wrong. The digit that cannot appear in both pincers at once is the shared one, C. Eliminate C from every cell that sees both pincers. Eliminating A or B is a common slip and it is always wrong.
Eliminating C from the pincers themselves. They still need it; only the cells that see both pincers lose it.
Calling an xyz-wing an xy-wing. If the pivot carries three candidates, the pattern is the bigger relative and the eliminations change. Count the pivot’s candidates first.
Telling it apart from a naked triple
A naked triple is three cells in one unit whose candidates add up to three digits, and it eliminates inside that unit. An xy-wing is three bivalue cells spread across different units, and it eliminates outside all of them.
The giveaway is where the cells sit: if all three share a row, column or box, you are probably looking at a triple (or a pair with a guest); if they are three separate places that see each other one by one through the pivot, you are looking at a wing.
Next step up: Swordfish — three lines, three covers. Previous step: X-Wing. All Thirteen, in order: the strategy hub.
New to the notation? This page writes a cell as r3c8 — row 3, column 8 — and the notation page explains the rest of the shorthand.
Practise it: XY-Wing drill. Related: X-Wing (the rectangle) · Swordfish (the three-line version).