Sudoku Solver

Hard

X-Wing (Col)

A rectangular pattern formed by a candidate appearing twice in two columns.

The X-Wing is one of the most famous advanced Sudoku strategies. It allows you to look beyond a single box or line and find a logical connection between different parts of the grid.

The X-Wing (Column) variation looks for a pattern based on columns.

Interactive Example

7
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
8
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
4
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
3
1 2 3 4 5 6 7 8 9
5
1 2 3 4 5 6 7 8 9
3
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
7
1 2 3 4 5 6 7 8 9
4
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
2
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
4
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
3
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
7
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1
1 2 3 4 5 6 7 8 9
9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
7
1 2 3 4 5 6 7 8 9
8
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
4
1 2 3 4 5 6 7 8 9
4
1 2 3 4 5 6 7 8 9
7
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
3
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
3
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
4
1 2 3 4 5 6 7 8 9
9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
7
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
6
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
2
1 2 3 4 5 6 7 8 9
5
1 2 3 4 5 6 7 8 9
4
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
7
1 2 3 4 5 6 7 8 9
2
1 2 3 4 5 6 7 8 9
5
1 2 3 4 5 6 7 8 9
3
1 2 3 4 5 6 7 8 9
8
1 2 3 4 5 6 7 8 9
6
1 2 3 4 5 6 7 8 9
7
1 2 3 4 5 6 7 8 9
9
1 2 3 4 5 6 7 8 9
4
1 2 3 4 5 6 7 8 9
1
1 2 3 4 5 6 7 8 9
8
1 2 3 4 5 6 7 8 9
4
1 2 3 4 5 6 7 8 9
7
1 2 3 4 5 6 7 8 9
1
1 2 3 4 5 6 7 8 9
3
1 2 3 4 5 6 7 8 9
9
1 2 3 4 5 6 7 8 9
6
1 2 3 4 5 6 7 8 9
5
1 2 3 4 5 6 7 8 9
2
1 2 3 4 5 6 7 8 9

Click "Apply Logic" to see the strategy in action.

Real Example Explanation

In the interactive example above, focus on the number 1:

  1. Scan Columns: Look at Column 5 and Column 7.
  2. Count Candidates:
    • In Column 5, the number 1 can only go in Row 3 (R3C5) and Row 5 (R5C5).
    • In Column 7, the number 1 can only go in Row 3 (R3C7) and Row 5 (R5C7).
  3. The Rectangle: Notice that these four spots align perfectly to form a rectangle.
  4. The Logic:
    • If R3C5 is the 1 for Column 5, then R5C7 must be the 1 for Column 7.
    • If R5C5 is the 1 for Column 5, then R3C7 must be the 1 for Column 7.
    • Either way, the two 1s for these two columns must occupy Row 3 and Row 5.
  5. The Elimination: Since Rows 3 and 5 are now "taken" by these columns, no other cell in Row 3 or Row 5 can be a 1. We remove the 1s from the red cells (R3C2 and R5C6).

The Core Logic

The X-Wing works because of a "locked set" across two units.

Imagine two vertical chutes (columns). Each chute needs a "ball" (the number 1). The only places for the ball in Chute A are at height X and height Y. The only places for the ball in Chute B are also at height X and height Y.

This creates a closed loop. If top-left has the ball, bottom-right must have it. If bottom-left has it, top-right must have it. In both scenarios, heights X and Y contain a ball. Therefore, nobody else at height X or Y (the horizontal rows) can have a ball.

How to Spot It

  1. Pick a Number: This strategy works on one specific number at a time (e.g., "Where are all the 7s?").
  2. Scan Vertical Lines: Look for columns where that number appears as a candidate exactly twice (or sometimes linked strongly).
  3. Check Alignment: If you find two columns where the candidates are in the exact same two rows, you have an X-Wing.
  4. Eliminate Horizontally: If you found the pattern in columns, you verify the logic and eliminate from rows.

(Note: If you find the pattern in rows, you eliminate from columns. That is an X-Wing (Row)).

Related Strategies

  • Naked Pair: A simpler form of locked candidates.
  • Swordfish: The logic expanded to three columns/rows.
  • Jellyfish: The logic expanded to four columns/rows.