X-Wing

Volodymyr Sakhan  · 

X-Wing is one of the most well-known advanced sudoku techniques. It lets you eliminate candidates across two entire columns (or rows) in a single step — something that naked pairs and hidden pairs cannot do.

To use X-Wing you need pencil marks filled in. This technique appears in hard and expert puzzles, when simpler methods are exhausted and you need to look across multiple rows and columns at once.

What Is X-Wing?

An X-Wing is a pattern where a single digit appears as a candidate in exactly two cells of one row, and also in exactly two cells of another row — and both times those cells fall in the same two columns. The four cells form a rectangle.

Because the digit must occupy one corner of each of the two rows, it will always land in both of those columns — either on one diagonal of the rectangle or the other. Either way, no other cell in those two columns can hold that digit. The name comes from imagining the two diagonals of the rectangle crossing each other like an X. You can find more techniques in our full solving guide.

When to Use X-Wing

Look for X-Wing when simpler techniques are no longer making progress. Here are the conditions that must all be true:

Step-by-Step Example

Below are two worked examples — one row-based and one column-based — so you can see both orientations of the technique.

Row-Based X-Wing: Digit 4, Rows 4 & 5

In this expert puzzle, after filling pencil marks, digit 4 appears as a candidate in only two cells of row 4 (F4 and H4) and only two cells of row 5 (F5 and H5). Both pairs land in columns F and H — a perfect X-Wing.

  1. Fill pencil marks for all empty cells.
  2. Scan each row for digit 4. In row 4, digit 4 is a candidate only in cells F4 and H4 — exactly 2 cells.
  3. Scan the remaining rows. In row 5, digit 4 is a candidate only in cells F5 and H5 — exactly 2 cells, and in the same columns F and H.
  4. X-Wing confirmed: F4, H4, F5, H5 form a rectangle. Digit 4 must occupy either the diagonal {F4, H5} or the diagonal {H4, F5}.
  5. In both cases, column F receives a 4 (at row 4 or row 5) and column H receives a 4 (at row 4 or row 5).
  6. Therefore digit 4 cannot appear anywhere else in column F or column H.
  7. Eliminate 4 from F8. Its candidates shrink from {2, 4, 5, 8} to {2, 5, 8} — one cell closer to being solved.
5485362963483464567785246124634982974245896ABCDEFGHI123456789
Row-based X-Wing: digit 4 is locked to F4, H4, F5, H5 (green). Cell F8 (orange) loses candidate 4.

Once you confirm digit 4 is locked to exactly two cells in each of two rows — and always in the same two columns — you can safely remove it from the rest of those columns.

Column-Based X-Wing: Digit 2, Columns B & C

X-Wing works identically when scanned column by column. Here, digit 2 appears as a candidate in only two cells of column B (B5 and B8) and only two cells of column C (C5 and C8), both times in rows 5 and 8.

  1. Scan each column for digit 2. In column B, digit 2 is a candidate only in B5 and B8 — exactly 2 cells.
  2. In column C, digit 2 is a candidate only in C5 and C8 — exactly 2 cells, in the same rows 5 and 8.
  3. X-Wing confirmed: B5, B8, C5, C8 form a rectangle. Digit 2 occupies either {B5, C8} or {C5, B8}.
  4. Either way, row 5 receives a 2 in column B or C, and row 8 receives a 2 in column B or C.
  5. Therefore digit 2 cannot appear anywhere else in rows 5 or 8.
  6. Eliminate 2 from G5 — candidates shrink from {2, 6, 7, 8} to {6, 7, 8}.
  7. Also eliminate 2 from I5, H8, and I8 — four cells cleared in a single step.
249153967322892891267832678951647289278913524678926789642ABCDEFGHI123456789
Column-based X-Wing: digit 2 is locked to B5, B8, C5, C8 (green). Cells G5, I5, H8, I8 (orange) all lose candidate 2.

Column-based X-Wing yields the same logic rotated 90°: two columns lock the digit into exactly two rows, eliminating all other occurrences in those rows at once.

Practice X-Wing Online

X-Wing requires patience and systematic scanning — go through each digit from 1 to 9, check every row (or column) for exactly two candidate cells, and note which columns (or rows) they fall in. When two rows match, you have your X-Wing.

Once you are comfortable with X-Wing, look for Swordfish — the same logic extended to three rows and three columns. For cases where the rectangle has an extra candidate cell outside the pattern, study Finned X-Wing next.

Frequently Asked Questions

X-Wing is an advanced sudoku candidate-elimination technique. It occurs when a single digit appears as a candidate in exactly two cells of one row and exactly two cells of another row, and both times those cells fall in the same two columns — forming a rectangle. Because the digit must land in one of the two diagonals of that rectangle, it can be safely eliminated from every other cell in those two columns.

To find X-Wing, first fill in pencil marks for all empty cells. Then pick a digit and scan each row: look for a row where that digit is a candidate in exactly two cells, and note which columns those cells are in. If you find a second row where the same digit is also a candidate in exactly two cells in those same two columns, you have an X-Wing. Eliminate that digit from every other cell in both columns.

X-Wing and Swordfish use the same underlying logic but at different scales. X-Wing involves two rows and two columns — a 2×2 rectangle. Swordfish extends this to three rows and three columns, forming a larger pattern that allows eliminations across three columns at once. X-Wing is the simpler pattern to spot; Swordfish is the natural next step once X-Wing becomes familiar.

X-Wing is considered an advanced sudoku technique. It requires pencil marks and appears in hard and expert-level puzzles, typically only after naked singles, hidden singles, naked pairs, and hidden pairs are fully exhausted. The scanning process is systematic but takes practice — most solvers encounter X-Wing only after they have a solid grasp of candidate-elimination basics.

Ready to try X-Wing? Play hard sudoku and scan for the rectangle pattern — or create a free account to track your progress.