X-Wing Sudoku Technique

Updated

An X-Wing is a fish pattern where a digit is confined to the same two lines — the same two columns across two rows, or the same two rows across two columns — which lets that digit be erased from every other cell along those two lines.

When an X-Wing applies

Subsets reason inside a single unit. Fish patterns are the first techniques on this list that reason across two units of the same kind at once — two rows, or two columns. An X-Wing needs a digit that, in two separate rows, can only go in exactly two cells each. If those four cells line up in exactly two columns, the digit is trapped in a rectangle: whichever row eventually takes it in one column, the other row must take it in the other column. Either way, no cell outside those two rows can hold the digit in either of those two columns, so every other candidate for it in those columns is impossible.

The same logic runs sideways: two columns with exactly two candidate cells each, aligned on the same two rows, trap the digit just as tightly and let it be erased from the rest of those two rows instead. X-Wings are the smallest fish, sized at two lines by two lines; Swordfish and Jellyfish, later on this list, stretch the same idea to three and four lines.

Worked example

The digit 2 is confined to columns 1 and 4 in rows 5 and 6. That rectangle removes 2 from every other cell in columns 1 and 4, which the solver reports as an elimination at r7c4.
c1c2c3c4c5c6c7c8c9
r1953168742
r286273459591
r341759592836
r47489658915931459258
r5238912568945693595897
r62348952897191349638
r71538256912591569125674
r81574381561256159
r96294157135158358
Pattern cells
r5c1, r5c4, r6c1, r6c4
Eliminations
2 from r7c4

Look at rows 5 and 6. In row 5, the only cells that can still hold 2 are r5c1 and r5c4. In row 6, the only cells that can still hold 2 are r6c1 and r6c4. Both rows restrict the digit to exactly the same pair of columns, 1 and 4, so the four corner cells r5c1, r5c4, r6c1 and r6c4 form an X-Wing on 2.

One of those two rows must place 2 in column 1, and the other must place it in column 4 — there is no third option, because nowhere else in either row can 2 go. That means column 1 and column 4 each get their 2 from row 5 or row 6, which is enough to rule the digit out everywhere else in both columns. r7c4 carried 2, 5, 6 and 9 before the deduction; the X-Wing removes the 2 and leaves 5, 6 and 9 behind. No other cell in columns 1 or 4 outside rows 5 and 6 still had 2 as a candidate on this board, so r7c4 is the pattern’s only elimination here.

How to spot an X-Wing

  1. Pick a digit and scan the rowsFor one digit at a time, note every row where it has exactly two remaining candidate cells. Rows with three or more candidates for that digit are not useful here.
  2. Compare the columns those cells sit inTake any two such rows and check whether their candidate cells share the same two columns. If they do, the four cells form a rectangle.
  3. Confirm the rectangle is exactBoth rows must be limited to precisely those two columns for the digit. A stray third candidate cell in either row breaks the pattern completely.
  4. Erase the digit from the rest of both columnsRemove the digit from every other cell in the two columns, outside the two base rows, then repeat the search on the column axis.

Common mistakes

X-Wing FAQ

Does an X-Wing place a digit directly?

No. It only proves that a digit cannot appear in certain cells. Like the subset techniques before it, it usually exposes a single or another elimination on the next pass rather than filling a cell itself.

Why is it called an X-Wing?

The four candidate cells sit at the corners of a rectangle, and tracing the two diagonals across it sketches an X shape over the grid. The name describes the pattern, not the underlying logic.

What is the difference between a row-based and column-based X-Wing?

They are the same rectangle read from two directions: a row-based X-Wing eliminates along its two cover columns, and a column-based X-Wing eliminates along its two cover rows.

How does an X-Wing relate to a Swordfish?

A Swordfish is the same reasoning extended from two lines to three. Both are fish patterns; the X-Wing is the smallest member of the family, and the size keeps growing until the pattern stops being practical to spot by eye.