Sudoku X-Wing Explained Simply (With a Step-by-Step Example)
X-Wing is the first "advanced" Sudoku technique most players learn. Here is how to spot it and why it works.
When cross-hatching, singles and pairs stop working, many harder Sudoku puzzles can still be solved with a technique called X-Wing. The name sounds intimidating, but the idea is simple once you see it. You will need pencil marks (candidates) in your grid to use it.
If you are new to candidates, read our beginner techniques guide first.
The idea in one sentence
If a digit can only go in exactly two cells in each of two different rows, and those cells line up in the same two columns, then that digit can be removed from every other cell in those two columns.
The same works with rows and columns swapped.
Step-by-step example
Imagine we are looking at the digit 7.
- In row 2, after checking candidates, 7 can only go in column 3 or column 8.
- In row 6, 7 can also only go in column 3 or column 8.
Those four cells form the corners of a rectangle:
| Column 3 | Column 8 | |
|---|---|---|
| Row 2 | 7? | 7? |
| Row 6 | 7? | 7? |
Now think about where the 7s in rows 2 and 6 must be:
- Option A: row 2 has its 7 in column 3. Then row 6 cannot also use column 3 (same column), so row 6 has its 7 in column 8.
- Option B: row 2 has its 7 in column 8. Then row 6 must have its 7 in column 3.
Either way, column 3 gets one 7 from these rows, and column 8 gets the other. That means no other cell in column 3 or column 8 can be a 7.
So you can erase 7 as a candidate from every other cell in columns 3 and 8. Often this creates a new single somewhere, and the puzzle opens up again.
How to spot an X-Wing
Searching for it at random is slow. A more efficient approach:
- Pick one digit.
- Go through each row and note the rows where that digit has exactly two candidate positions.
- Compare those rows. If two of them have their candidates in the same two columns, you have found an X-Wing.
- Repeat the same check using columns instead of rows.
Highlighting one digit at a time (many apps can do this) makes the pattern much easier to see.
Common mistakes
- Three candidates in a row. If the digit has three possible positions in one of the rows, it is not an X-Wing. Both rows must have exactly two.
- Mismatched columns. The candidates must be in the same two columns in both rows. Columns 3 and 8 in one row and columns 3 and 9 in the other do not form an X-Wing.
- Removing from the wrong lines. When the pattern is found in rows, you eliminate from the columns, and vice versa.
Where X-Wing fits in your solving order
Try these first, because they are faster:
- Cross-hatching and singles.
- Naked and hidden pairs.
- Pointing pairs.
Then look for X-Wings, one digit at a time. Many puzzles labeled "hard" or "expert" need one or two X-Wing eliminations to break open.
Going further
X-Wing has bigger relatives: Swordfish uses three rows and three columns, and Jellyfish uses four. They work on exactly the same principle. Once you understand why X-Wing works, those techniques are just a larger version of the same idea.