sudoku · 8 min read
Sudoku Technique: The XY-Wing
Master the grid through the absolute placement of non-repeating digits.
The XY-Wing is the first multi-digit chain technique most Sudoku solvers learn. Unlike X-Wing or Swordfish, which are single-digit patterns, the XY-Wing weaves three different digits through three cells to force an elimination somewhere else entirely.
It looks intimidating on paper, but the logic is clean once you see the pattern. Master it and you've graduated from intermediate to advanced Sudoku.
The Setup
The pattern uses three cells with very specific candidate lists:
- One cell — call it the pivot — has exactly two candidates:
{X, Y} - One cell — wing A — has exactly two candidates:
{X, Z}and shares a row, column, or box with the pivot - One cell — wing B — has exactly two candidates:
{Y, Z}and also shares a unit with the pivot
Note that all three cells together involve three distinct digits: X, Y, and Z. The pivot doesn't carry Z, and the two wings each carry Z plus one of {X, Y}.
The XY-Wing Rule
Example
Here's an XY-Wing using digits X = 2, Y = 5, Z = 9:
- Pivot at row 3, col 3 — candidates
{2, 5} - Wing A at row 3, col 7 — candidates
{2, 9}(shares row 3 with the pivot) - Wing B at row 5, col 3 — candidates
{5, 9}(shares col 3 with the pivot)
Following the logic
The pivot is either 2 or 5 — those are its only two options.
- Suppose the pivot is 2. Wing A (in the same row) can't also be 2 — that would put two 2s in row 3. So wing A's only remaining option is 9.
- Suppose the pivot is 5. Wing B (in the same column) can't also be 5. So wing B's only remaining option is 9.
We don't know which of the two cases is true — but in either case, one of the two wings is 9. We're certain of that.
The elimination
Now look for a cell that sees both wings. In our example, cell (5, 7) — the green-tinted cell at row 5, col 7 — sees both:
- It's in the same column (col 7) as wing A at (3, 7).
- It's in the same row (row 5) as wing B at (5, 3).
We just established that one of those two wings will be 9. So no matter which case turns out to be true, cell (5, 7) shares a unit with a cell holding 9. Therefore (5, 7) cannot be 9.
Why is this powerful?
The XY-Wing finds eliminations that no “local” technique (singles, pairs, X-Wing) can spot. The eliminated cell can be far from the three pattern cells — anywhere in the grid that sees both wings is fair game.
It's also the seed of more advanced techniques. XY-Wings extend naturally to XYZ-Wings (where the pivot also carries Z), and ultimately to longer chains and forcing nets.
How to spot an XY-Wing in practice
- Look for cells with exactly 2 candidates. XY-Wings require all three pattern cells to be 2-candidate cells.
- Pick a candidate pivot. Note its two values {X, Y}.
- Search its peers (cells in the same row, column, or box) for a partner cell with candidates
{X, Z}for some Z ≠ Y. - Search again in the pivot's peers for a third cell with candidates
{Y, Z}— same Z as before. - Find the “sees both wings” cells. Any cell sharing a unit with both wings can have Z eliminated.
Common mistake: forgetting the Z constraint
The Z value only appears in the wings, never in the pivot. If you find three cells with candidates {2,5}, {2,9}, and {5,7}, the Z digits don't match — that's not an XY-Wing. Both wings must share the same third candidate.