XY-Wing

A pivot and two wings force a digit out of the cells they all see.

An XY-Wing is a three-cell chain built entirely from bivalue cells — cells holding exactly two candidates. One cell is the pivot, carrying candidates XY, and it sees two "wing" cells carrying XZ and YZ, so the two wings share a third digit Z that the pivot does not hold. Whatever the pivot turns out to be, one wing is forced to Z, which is what makes XY-Wing sudoku eliminations possible: you can remove Z from any cell that sees both wings, without ever having pinned down Z directly.

Worked example

Pivot R5C5={5,7} with wings R5C2 and R2C5 forces 8 out of R2C2 (shown greyed) — an XY-Wing.87858577596169348126243
Pivot R5C5={5,7} with wings R5C2 and R2C5 forces 8 out of R2C2 (shown greyed) — an XY-Wing.

Here the pivot is R5C5 with candidates {5,7}. Its two wings are R5C2={5,8}, which shares the 5 with the pivot along row 5, and R2C5={7,8}, which shares the 7 with the pivot down column 5 — and both wings carry 8 as their third digit. If R5C5 is 5, then R5C2 cannot also be 5 and is forced to 8; if R5C5 is 7, then R2C5 cannot also be 7 and is forced to 8. Either way an 8 must appear in one of the two wings, so R2C2 — which sees R5C2 down column 2 and R2C5 along row 2 — cannot be 8, and 8 is eliminated from R2C2.

When to use it

Reach for the XY-Wing once singles, naked/hidden pairs and pointing candidates are exhausted and the grid is dotted with bivalue cells but nothing else is cracking. To spot one, pick a bivalue pivot XY, look at the bivalue cells it can see, and find two of them that each share exactly one of X or Y with the pivot while carrying the same third digit Z; then check whether any cell sees both of those wings and still lists Z to remove.

How to use it

  1. Find the pivot. Find a cell with exactly two candidates — call them X and Y. This bivalue cell is the pivot of the wing.
  2. Find the two wings. Find two more bivalue cells the pivot can see: one with candidates X and Z, the other with Y and Z. Each shares one digit with the pivot plus a common third digit, Z.
  3. Eliminate the shared digit. Whichever value the pivot takes, one wing is forced to Z. So Z cannot go in any cell that sees both wings — remove it there.
Practice this in an interactive lesson Play a free puzzle

Frequently asked questions

What is an XY-Wing in Sudoku?

An XY-Wing is a pattern of three bivalue cells: a pivot with candidates XY that sees one wing with XZ and another with YZ. Because the pivot must be either X or Y, one of the wings is always forced to the shared digit Z. Any cell that sees both wings therefore cannot be Z. In the worked board the pivot R5C5={5,7} forces an 8 into either R5C2 or R2C5, eliminating 8 from R2C2.

How do I spot an XY-Wing?

Start from a cell with exactly two candidates (the pivot). Trace the other bivalue cells it can see and look for two that each match one — and only one — of the pivot's digits, and that both contain the same leftover digit Z. The pivot's digits act as the two hinges (5 with R5C2, 7 with R2C5 in the example) and Z is the digit both wings hold in common (8 here). Once found, any cell seeing both wings loses Z.

Why do all three cells have to be bivalue?

The logic relies on each cell having no third option to hide behind. The pivot must collapse cleanly to X or Y, and each wing must fall to Z the instant its shared digit is taken by the pivot — if a wing had a spare candidate it could dodge Z and the forcing chain breaks. When the middle cell has three candidates instead of two the shape becomes an XYZ-Wing, which needs the pivot to also see the target and eliminates in a different geometry.