Sudoku technique · Candidate elimination

X-Wing

An X-Wing appears when one digit has candidates in exactly two cells in each of two base rows or columns, and those four cells lie on the same two crossing columns or rows.

Topic role
Candidate-elimination proof
Engine rank
Rank 8
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

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

Pattern cells: R3C6, R3C7, R8C6, R8C7. Remove 8 from R1C7.

Pattern cells
R3C6, R3C7, R8C6, R8C7
Pattern digits
8
Orientation
Row-based
Base lines
Row 3, Row 8
Cover lines
Column 6, Column 7

Exact candidate changes

  • Remove 8 from R1C7Before: 1, 2, 8After: 1, 2
  1. Choose one digit and compare the complete candidate positions in pairs of rows, then pairs of columns.
  2. Find two base lines where the digit appears in exactly two cells and both pairs use the same two cover lines.
  3. Keep all four pattern candidates because the digit can occupy either diagonal of the rectangle.
  4. Remove only that digit from the cover lines outside the two base lines.

Fixed practice

Track one digit at a time and write down every position in each possible base line before comparing the two cover lines.

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

Pattern cells: R1C5, R1C9, R9C5, R9C9. Remove 7 from R9C1; Remove 7 from R9C2; Remove 7 from R9C3; Remove 7 from R9C4.

Pattern cells
R1C5, R1C9, R9C5, R9C9
Pattern digits
7
Orientation
Column-based
Base lines
Column 5, Column 9
Cover lines
Row 1, Row 9

Exact candidate changes

  • Remove 7 from R9C1Before: 1, 2, 7, 8After: 1, 2, 8
  • Remove 7 from R9C2Before: 2, 5, 7, 9After: 2, 5, 9
  • Remove 7 from R9C3Before: 1, 2, 7, 8, 9After: 1, 2, 8, 9
  • Remove 7 from R9C4Before: 5, 7, 8After: 5, 8

Common mistakes

Common mistakes

Calling the shape an X-Wing when either base line has a third position for the digit or the two pairs use different cover lines.

Removing the digit from a pattern cell, from outside the two cover lines, or from a cell on one of the base lines.

Review information

What is verified here

The independent verifier recomputes the chosen digit’s exact positions, the row-based or column-based orientation, both base and cover lines, and the complete ordered deletion list.

Fixture ID
p3d-x-wing-row-01 / p3d-x-wing-column-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.