Extreme

X-Wing

A digit confined to two cells in each of two rows (or columns), forming a rectangle that locks the digit.

What Is It?

An X-Wing is a pattern where a single digit is confined to exactly two cells in each of two rows, and those cells share the same two columns (or vice versa, two columns sharing two rows). The four cells form a rectangle.

The logic is elegant: in each of the two rows, the digit must occupy one of the two candidate cells. Since both rows use the same two columns, each column must contain exactly one instance of the digit. Therefore, the digit can be eliminated from all other cells in those two columns.

X-Wing is the simplest "fish" pattern, a family that includes Swordfish (3 rows x 3 columns) and Jellyfish (4 x 4). Mastering X-Wing gives you the foundation for all fish techniques.

How It Works

Pick a digit and scan the rows (or columns). For each row, count how many cells have that digit as a candidate. You need exactly two rows where the digit appears in exactly two cells. In each of the two rows, the digit must appear in exactly two columns, and those columns must be identical for both rows.

Once you find the rectangle, apply the elimination. Since each row must contain the digit once, and both rows restrict the digit to the same two columns, those two columns must each contain exactly one instance of the digit. Therefore, the digit can be eliminated from all other cells in those two columns.

The X-Wing works in both orientations. A "row-based" X-Wing has the defining pairs in rows and eliminates from columns. A "column-based" X-Wing has the defining pairs in columns and eliminates from rows.

Worked Example

Example 1: X-Wing in Rows

Step 1: Scanning digit 2 across the grid, we find that in row 1 and row 4, digit 2 appears as a candidate in exactly two cells each, and they line up in the same columns: columns 2 and 7.

Step 2: The four cells R1C2, R1C7, R4C2, and R4C7 form an X-Wing rectangle. Since each row must contain the digit once, and both rows restrict digit 2 to the same two columns, columns 2 and 7 must each contain exactly one instance of digit 2. Therefore, digit 2 can be eliminated from all other cells in those two columns.

Step 3: Eliminate digit 2 from all other cells in columns 2 and 7. Here, 2 is removed from R6C2 and R5C7.

Example 2: X-Wing in Columns

Step 1: Now consider digit 9 in columns 3 and 4. Each column has exactly two cells with digit 9 as a candidate, and they share the same rows: rows 5 and 8.

Step 2: The four cells R5C3, R5C4, R8C3, and R8C4 form an X-Wing. Since each column must contain the digit once, and both columns restrict digit 9 to the same two rows, rows 5 and 8 must each contain exactly one instance of digit 9. Therefore, digit 9 can be eliminated from all other cells in those two rows.

Step 3: Eliminate digit 9 from all other cells in rows 5 and 8. Here, 9 is removed from R5C1, R5C2, and R8C1.

Key Points

Related Techniques

All Sudoku Techniques

Explore all 28 solving techniques in our complete technique guide.