Sudoku technique · Candidate elimination

XY-Wing

An XY-Wing uses a two-candidate XY pivot and two distinct two-candidate wings, XZ and YZ, that each see the pivot; Z can be removed from other cells that see both wings.

Topic role
Candidate-elimination proof
Engine rank
Rank 9
Play a Sudoku puzzleView all techniques

Learning order

Topic relationships

These links express the same learning and proof relationships used throughout the library.

Verified example

Work through the example

XY-Wing · Verified example
R1C1: empty; Pivot; Before 4, 6
R1C2: empty
R1C3: empty
R1C4: given 9
R1C5: empty
R1C6: given 5
R1C7: given 2
R1C8: empty; XZ wing; Before 3, 6
R1C9: empty
R2C1: empty
R2C2: empty
R2C3: empty
R2C4: given 3
R2C5: empty
R2C6: given 1
R2C7: empty
R2C8: empty
R2C9: given 4
R3C1: empty
R3C2: given 7
R3C3: given 3
R3C4: given 6
R3C5: empty
R3C6: empty
R3C7: empty
R3C8: empty
R3C9: empty
R4C1: given 7
R4C2: given 6
R4C3: given 9
R4C4: given 4
R4C5: given 3
R4C6: given 2
R4C7: given 5
R4C8: given 8
R4C9: given 1
R5C1: empty
R5C2: empty
R5C3: empty
R5C4: given 8
R5C5: given 9
R5C6: given 6
R5C7: given 4
R5C8: given 7
R5C9: given 2
R6C1: given 8
R6C2: given 2
R6C3: given 4
R6C4: given 1
R6C5: given 5
R6C6: given 7
R6C7: empty
R6C8: empty
R6C9: empty
R7C1: empty
R7C2: given 5
R7C3: empty
R7C4: empty
R7C5: given 1
R7C6: empty
R7C7: empty
R7C8: empty
R7C9: empty
R8C1: empty; YZ wing; Before 3, 4
R8C2: empty
R8C3: empty
R8C4: empty
R8C5: given 6
R8C6: given 9
R8C7: empty
R8C8: empty; candidate deletion 3; Before 1, 2, 3, 4; After 1, 2, 4
R8C9: given 5
R9C1: given 1
R9C2: empty
R9C3: given 2
R9C4: given 5
R9C5: empty
R9C6: empty
R9C7: empty
R9C8: empty
R9C9: empty
  • Pivot: X=6, Y=4
  • XZ wing: X=6, Z=3
  • YZ wing: Y=4, Z=3

Pattern cells: R1C1, R1C8, R8C1. Remove 3 from R8C8.

Pattern cells
R1C1, R1C8, R8C1
Pattern digits
6, 4, 3
Pivot
R1C1
XZ wing
R1C8
YZ wing
R8C1
Digit roles
X=6, Y=4, Z=3

Exact candidate changes

  • Remove 3 from R8C8Before: 1, 2, 3, 4After: 1, 2, 4
  1. Find a two-candidate pivot and label its candidates X and Y.
  2. Find an XZ wing and a YZ wing that each see the pivot.
  3. Reason that whichever value enters the pivot, at least one wing must contain Z.
  4. Remove only Z from other cells that see both wings.

Fixed practice

Start with a two-candidate pivot, label X and Y, then verify both peer relationships before looking for cells that see the two wings together.

Fixed practice · R5C8
XY-Wing · Fixed practice
R1C1: given 4
R1C2: given 1
R1C3: given 6
R1C4: given 9
R1C5: given 7
R1C6: given 5
R1C7: given 2
R1C8: given 3
R1C9: given 8
R2C1: given 9
R2C2: given 8
R2C3: empty
R2C4: given 3
R2C5: given 2
R2C6: given 1
R2C7: empty
R2C8: empty
R2C9: given 4
R3C1: given 2
R3C2: empty
R3C3: empty
R3C4: given 6
R3C5: given 4
R3C6: given 8
R3C7: given 1
R3C8: empty
R3C9: given 9
R4C1: given 7
R4C2: empty
R4C3: empty
R4C4: given 4
R4C5: given 3
R4C6: empty; candidate deletion 6; Before 2, 6; After 2
R4C7: given 5
R4C8: given 8
R4C9: empty; XZ wing; Before 1, 6
R5C1: given 5
R5C2: empty
R5C3: empty
R5C4: given 8
R5C5: given 9
R5C6: empty; YZ wing; Before 6, 7
R5C7: given 4
R5C8: empty; Pivot; Before 1, 7
R5C9: given 2
R6C1: given 8
R6C2: empty
R6C3: given 4
R6C4: empty
R6C5: empty
R6C6: empty
R6C7: empty
R6C8: empty
R6C9: empty
R7C1: given 6
R7C2: empty
R7C3: given 8
R7C4: empty
R7C5: empty
R7C6: given 4
R7C7: empty
R7C8: empty
R7C9: empty
R8C1: given 3
R8C2: empty
R8C3: empty
R8C4: empty
R8C5: given 6
R8C6: given 9
R8C7: given 8
R8C8: empty
R8C9: given 5
R9C1: given 1
R9C2: empty
R9C3: empty
R9C4: empty
R9C5: given 8
R9C6: given 3
R9C7: empty
R9C8: empty
R9C9: given 7
  • Pivot: X=1, Y=7
  • XZ wing: X=1, Z=6
  • YZ wing: Y=7, Z=6

Pattern cells: R5C8, R4C9, R5C6. Remove 6 from R4C6.

Pattern cells
R5C8, R4C9, R5C6
Pattern digits
1, 7, 6
Pivot
R5C8
XZ wing
R4C9
YZ wing
R5C6
Digit roles
X=1, Y=7, Z=6

Exact candidate changes

  • Remove 6 from R4C6Before: 2, 6After: 2

Common mistakes

Common mistakes

Using a wing that does not see the pivot, has an extra candidate, or does not form the exact XZ and YZ digit roles.

Removing Z from a cell that sees only one wing, or deleting a candidate from the pivot or either wing.

Review information

What is verified here

The independent verifier recomputes the pivot and both wings, their exact X/Y/Z candidate roles and peer relationships, and every Z deletion from the shared peers of the wings.

Fixture ID
p3d-xy-wing-row-column-01 / p3d-xy-wing-box-row-01
Engine version
legen-sudoku-engine/1.3.0
Verification status
Independent candidate-elimination verifier passed
Facts reviewed
2026-07-18
Technique terminology and examples are tied to the published engine version. See the review information below for scope and dates.