Minimal Sudoku
X-Wing pattern in Sudoku showing candidate elimination
Learn Section

X-Wing

The Classic Fish Pattern for Candidate Elimination

By Minimal Sudoku TeamLast updated:

The X-Wing is one of the most famous advanced Sudoku strategies. It's the simplest member of the "Fish" family and a gateway to more complex patterns like Swordfish and Jellyfish.

Quick Summary
  • What: A rectangle pattern of 4 cells containing the same candidate
  • Where: 2 rows × 2 columns, with exactly 2 candidates per row (or column)
  • Result: Eliminate that candidate from other cells in the aligned columns (or rows)
  • Difficulty: Advanced — requires full candidate notation

The Concept

An X-Wing occurs when a candidate appears in exactly two cells in each of two different rows (or columns), and those cells align perfectly — forming a rectangle.

The pattern can be found two ways:

Row-Based X-Wing

Find 2 rows where a candidate appears in exactly 2 cells, aligned in the same columns.

→ Eliminate from those columns

Column-Based X-Wing

Find 2 columns where a candidate appears in exactly 2 cells, aligned in the same rows.

→ Eliminate from those rows

The Golden Rule

✈️ X-Wing Rule
When a candidate forms a rectangle across 2 rows and 2 columns (appearing exactly twice per row or column), eliminate that candidate from all other cells in the aligned columns or rows.

How to Find an X-Wing

1

Find a candidate with exactly 2 positions

Look for a row (or column) where a specific candidate appears in exactly 2 cells. For example, digit 7 appears only in columns 4 and 7 of row 2.
2

Find a matching row or column

Look for another row (or column) where the same candidate also appears in exactly 2 cells — and those cells must align with the first pair.
3

Verify the rectangle

Confirm the 4 cells form a perfect rectangle. The candidate appears at all 4 corners, and nowhere else in those defining rows/columns.
4

Eliminate candidates

Remove the candidate from all other cells in the aligned rows or columns (depending on whether you found a row-based or column-based X-Wing).

Practical Example

X-Wing on Digit 7

X-Wing pattern on digit 7 in columns 4 and 7

In this example, we've found a column-based X-Wing for the digit 7:

  • Column 4: Digit 7 appears only in rows 2 and 4
  • Column 7: Digit 7 also appears only in rows 2 and 4

The 4 cells at R2C4, R2C7, R4C4, and R4C7 form a perfect rectangle. Since 7 must occupy exactly one cell in each column, and both columns are locked to rows 2 and 4, we know:

Elimination
Remove 7 as a candidate from all other cells in rows 2 and 4 (outside columns 4 and 7).

Why It Works

The logic is elegant: the candidate must appear somewhere in each column (or row). Since it can only go in two spots per column, and those spots align in the same two rows, the candidate is "locked" into those four cells.

One of the two diagonals will be the solution — either (R2C4 and R4C7) or (R2C7 and R4C4). We don't need to know which one! Either way, rows 2 and 4 are "claimed" by this X-Wing for digit 7, so we can safely eliminate 7 from any other cell in those rows.

Visual representation:
X-Wing pattern on digit 7Two columns and two rows with 7s at the four intersections, forming an X.Col 4Col 7Row 2Row 47777
Rows 2 and 4 intersect columns 4 and 7 — the four 7s form the X-Wing.
→ Eliminate 7 from other cells in rows 2 and 4.

Detection Tips

Start with Rare Candidates
Look for candidates that appear infrequently in the grid. A digit that only shows up 6-8 times total is more likely to form an X-Wing than one appearing 15+ times.
Scan Systematically
For each digit 1-9, scan each row looking for exactly 2 occurrences. When you find one, immediately check if another row has the same digit in the same columns.
Works Both Ways
If you find an X-Wing by scanning rows, you eliminate from columns. If you find it by scanning columns, you eliminate from rows. The pattern is symmetrical.
Common Mistake
Don't forget: the candidate must appear in exactly 2 cells per row/column. If it appears 3 times, it's not an X-Wing (though it might be a Swordfish).

X-Wing is the foundation of the "Fish" family. Once you've mastered it, you can tackle its larger cousins:

SwordfishAdvanced

Swordfish

The 3×3 extension of X-Wing. Same logic, but with 3 rows and 3 columns.