Extreme

X-Wing

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

In short

Pick a digit and look for two rows where it has exactly two possible cells, with both rows using the same pair of columns. The four cells form a rectangle that locks the digit into those columns, so you can eliminate it from every other cell in them. The same pattern works with rows and columns swapped.

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.

Frequently Asked Questions

How do I spot an X-Wing?

Pick one digit and count its candidate cells row by row. You want two rows where the digit has exactly two possible cells, and where those cells sit in the same two columns. The four cells form a rectangle. Repeat the scan down the columns to catch column-based X-Wings.

Why does an X-Wing found in rows eliminate from the columns?

Because the two rows fill both columns between them. Each row must place the digit in one of the two shared columns, and they cannot use the same column, so one instance lands in each. Every other cell in those two columns is therefore ruled out. Inside the two rows there is nothing left to remove.

What is the difference between an X-Wing, a Swordfish and a Jellyfish?

They are the same fish logic at different sizes: an X-Wing uses two rows and two columns, a Swordfish three, and a Jellyfish four. Larger fish also relax the counting — a Swordfish row may hold two or three candidate cells, a Jellyfish row two to four, provided the columns used stay within the limit.

Does the digit have to be a candidate in all four corners of an X-Wing?

Yes. The digit must be a candidate in all four corner cells, otherwise there is no rectangle to lock. If one of the two cells in a row loses the digit, that row has only one place left for it, which is a hidden single — a simpler deduction that places the digit outright.

Is an X-Wing the same thing as a Naked Pair?

No. A Naked Pair is two cells in one unit whose only candidates are the same two digits, and it clears those digits from the rest of that unit. An X-Wing tracks a single digit across two separate rows (or columns) and clears it from the two crossing lines instead. Different pattern, different elimination zone.

Key Points

Related Techniques

All Sudoku Techniques

Explore all 28 solving techniques in our complete technique guide.