Skip to content

Sudoku X-Wing: how to spot and use it

How to spot a Sudoku X-Wing, with a worked example for the digit 4, the logic behind it, and the mistakes that make people eliminate the wrong candidates.

RedFoxApps cover: How to spot a Sudoku X-Wing

An X-Wing is a Sudoku technique that removes candidates for one digit. Find two rows where the digit has only two possible cells, both pairs in the same two columns. The digit must take one diagonal pair of the four corners, so delete it from all other cells in those two columns.

An X-Wing is a Sudoku technique that removes candidates for one digit. You find two rows where that digit has only two possible cells, and those cells sit in the same two columns. The digit must fill one diagonal pair of the four corner cells, so you can delete it from every other cell in those two columns. This guide shows how to spot the pattern, why it works and where people go wrong. It assumes you already use pencil marks; if not, start with how to play Sudoku.

X-Wing at a glance

Question Answer
Difficulty Expert (comes after pairs, pointing pairs and box/line reduction)
Works on One digit at a time
What you need Pencil marks for every empty cell
What it does Removes candidates; it never places a digit by itself
Where to look Two rows (or two columns) where the digit has exactly two candidate cells

What is an X-Wing in Sudoku?

An X-Wing is a rectangle of four cells that all hold the same candidate digit, set across two rows and two columns. In each of the two rows, the digit has only those two cells left. Because the digit has to appear once in each row, it must take opposite corners of the rectangle. Either diagonal works, and both put the digit in both columns.

You do not know which diagonal is right, but you know the digit lands in both columns inside those two rows. So no other cell in those columns can be that digit.

How to spot an X-Wing step by step

  1. Pick one digit: work with a single digit and ignore the rest of the pencil marks.
  2. Find rows with exactly two candidates. Scan each row for that digit. Note every row where it can go in exactly two cells.
  3. Match the columns. Look for two of those rows whose two cells fall in the same two columns.
  4. Check the rectangle. The four corners should form a rectangle. Two cells in one row, two in the other, lined up in the same columns.
  5. Eliminate. Remove the digit from every other cell in those two columns, outside the two base rows.
  6. Go back to singles. Fresh eliminations often create a new hidden or naked single.

Repeat the search for columns. The logic is identical with rows and columns swapped: two columns, each with two candidates for the digit, in the same two rows. Then you clear the digit from the rest of those two rows.

A worked X-Wing example

The example below is a constructed illustration of the pattern for the digit 4, not a full puzzle. The table shows only the cells that still have 4 as a candidate. A dot means 4 is not possible in that cell.

C1 C2 C3 C4 C5 C6 C7 C8 C9
R3 · 4 · · · · 4 · ·
R5 · 4 · 4 · · · · 4
R8 · 4 · · · · 4 · ·

Row 3 has a 4 only in columns 2 and 7. Row 8 has a 4 only in columns 2 and 7. That is an X-Wing.

There are two ways to fill the 4s. Either R3C2 and R8C7 hold 4, or R3C7 and R8C2 hold 4. In both cases, one 4 sits in column 2 and one sits in column 7, inside rows 3 and 8. Column 2 and column 7 already have their 4, so any other 4 candidate in those columns is false.

Here that means you can delete the 4 from R5C2. The 4s in R5C4 and R5C9 are not in the two columns, so they stay.

Why the X-Wing logic works

Take the two possible fillings and compare them. If R3C2 is 4, then R8C2 cannot be 4 because they share a column, so R8 must take its 4 in column 7. If R3C7 is 4, the same reasoning puts R8's 4 in column 2. Both branches end with a 4 in column 2 and a 4 in column 7, within rows 3 and 8. Whatever the real solution is, those columns are covered.

This is also why you can call it a "fish" pattern. The X-Wing is the smallest member of a family that continues with Swordfish, which uses three rows and three columns. Our Sudoku strategies guide places all of them in order.

Common X-Wing mistakes

  • A row has three candidates. If the digit has a third possible cell in either base row, the pattern is broken. The rows must have exactly two.
  • The columns do not match. Two rows with two candidates each is not enough. Both pairs must sit in the same two columns.
  • Stale pencil marks. An X-Wing built on candidates you forgot to remove leads to a false pattern, and then wrong eliminations. Update your marks after every placement.
  • Deleting in the wrong place. Eliminate only from the other cells of the two columns (or rows). Never clear the four corners.
  • Expecting a placement. An X-Wing removes candidates. The solved digit usually comes from the next scan.

X-Wing variations to learn next

  • Column-based X-Wing. The same pattern with columns as the base lines; the eliminations run along the rows.
  • Finned X-Wing. An X-Wing with one extra candidate in a base row, inside the same box as a corner. It allows fewer eliminations but still works.
  • Swordfish. The three-row, three-column version of the same idea.
  • Y-Wing. A different technique that uses three cells with two candidates each.

Learn the plain X-Wing before any of these.

Next steps

Practise on a puzzle where you can switch on notes. Minimal Sudoku has pencil-mark notes and levels up to expert, which is where X-Wings start to appear. We make the game, so we are biased, but any puzzle source with candidate notes will let you practise this technique. For the full ladder of techniques, return to the Sudoku strategies guide.

Sources

  1. X-Wing Strategy (SudokuWiki.org)
  2. Sudoku solving algorithms (Wikipedia)
  3. Learn X-Wing (sudoku.coach)

Frequently asked questions

What is an X-Wing in Sudoku?

A pattern where one digit has exactly two possible cells in each of two rows, and those cells share the same two columns. The digit can then be removed from every other cell in those two columns.

How do you find an X-Wing in Sudoku?

Pick one digit, find rows where it has exactly two candidate cells, then look for two such rows whose cells fall in the same two columns. Do the same check with columns and rows swapped.

Does an X-Wing place a digit?

No. It only removes candidates. The eliminations often create a naked or hidden single, and that single is what you place.

What comes before X-Wing in Sudoku?

Scanning, naked and hidden singles, pencil marks, naked and hidden pairs, pointing pairs and box/line reduction. Learn those first, because X-Wing is an expert-level technique.

What is the difference between X-Wing and Swordfish?

X-Wing uses two rows and two columns. Swordfish applies the same logic across three rows and three columns.

Keep reading.

Have a game or app to build, publish or grow?

Tell us what you are working on. We reply with a clear next step.

Contact us