- Home
- Techniques
- X-Wing
Sudoku technique
X-Wing
A digit is only possible on two rows, and on each of those rows only in the same two columns. Whichever way it ends up splitting between them, those two columns already have their occurrence inside the pattern: the digit gets eliminated everywhere else on those columns.
A puzzle that requires it
Level Expert — the puzzle is shown twice: right below, and again in the demo that follows.
| 6 | 9 | 3 | 7 | |||||
| 8 | 2 | |||||||
| 5 | 1 | 6 | ||||||
| 6 | 7 | 2 | 9 | |||||
| 5 | 8 | |||||||
| 2 | 3 | 5 | 7 | |||||
| 8 | 1 | 7 | ||||||
| 2 | 6 | |||||||
| 7 | 6 | 4 | 8 |
Demonstration
State of the grid right when the technique applies, after 20 earlier deductions.
Demo — watch first, you'll play right after.
- Technique's pattern
- Candidates removed
- Solved earlier
- Given (clue)
| 6 | 9 | 3 | 7 | 2 | ||||
| 8 | 3 | 2 | 7 | 6 | ||||
| 5 | 7 | 2 | 1 | 6 | 3 | |||
| 6 | 8 | 7 | 3 | 2 | 9 | 5 | ||
| 7 | 5 | 6 | 2 | 8 | 3 | |||
| 2 | 3 | 8 | 5 | 6 | 7 | |||
| 6 | 8 | 1 | 7 | |||||
| 8 | 7 | 2 | 1 | 6 | ||||
| 1 | 7 | 3 | 6 | 4 | 1 | 8 |
X-Wing
Le 1 n'occupe que 2 colonnes sur ces 2 lignes, et elles s'alignent. Quelle que soit la répartition, ces 2 colonnes ont déjà leur 1 à l'intérieur du motif : il disparaît partout ailleurs sur elles.
Candidates removed:
- the 1 from cell L9C2
- the 1 from cell L8C8
- the 1 from cell L9C8
The X-Wing is the first technique of the fish family. When a digit is possible in only two cells on each of two rows, and those four cells fall in the same two columns, they form a rectangle. The digit is then eliminated from the rest of those two columns.
The principle
Choose a digit, say 7. Find two rows where 7 is possible in only two places, and where those two places are in the same columns, say column 3 and column 7. The four cells concerned are the corners of a rectangle, hence the name X-Wing: draw the diagonals and you get an X.
Why does it work? Each row must contain a 7, and it has only two possible places. For the first row, there are therefore two cases. Either the 7 is in column 3, and then the second row can no longer put it in that column: it goes in column 7. Or the 7 is in column 7, and the second row puts it in column 3.
In both cases, the two 7s fill column 3 once and column 7 once. Those two columns therefore already have their 7 inside the rectangle. You do not know which of the two placements is the right one, but you can remove the 7 from every other cell of those two columns.
The X-Wing belongs to the fish family, which reasons about digits confined to a small number of rows and columns. It is a fish of size 2. The Swordfish and the Jellyfish push the same idea to three and four rows and columns.
How to spot it
You need candidate notes. Take one digit at a time and scan the rows: look for those where it appears exactly twice. If two of those rows have their two cells in the same columns, you have an X-Wing. The rows do not need to be adjacent, nor to lie in the same band of boxes.
Then run the same search with rows and columns swapped: two columns where the digit has only two places, in the same rows, give an X-Wing that cleans those two rows. Otherwise, remove the digit from the other cells of the two columns of the rectangle.
A good habit: every time a column or a row thins out, revisit the digits that now have only two spots left on it. X-Wings tend to appear once the grid has already cleared a good deal.
A worked example
On row 2, cells R2C1, R2C2, R2C4, R2C5, R2C6, R2C8 and R2C9 already hold 4, 6, 2, 5, 9, 8 and 3. The two remaining digits, 1 and 7, go in R2C3 and R2C7. On row 2, the 7 therefore has only two possible places: column 3 and column 7.
On row 6, the seven filled cells hold 2, 9, 6, 8, 3, 5 and 1, leaving 4 and 7 for R6C3 and R6C7. The 7 has two spots there too, in the very same columns. That is an X-Wing on digit 7, with corners R2C3, R2C7, R6C3 and R6C7. The 1 does not show on row 6 and the 4 does not show on row 2: neither digit forms a second X-Wing that would contradict the elimination.
Apply the elimination to column 3: R4C3 used to hold candidates 1 and 7. Remove the 7, only the 1 remains, and we place that 1. On column 7, likewise, remove the 7 from R1C7, R3C7, R4C7, R5C7, R7C7, R8C7 and R9C7 wherever it still shows. The four corners of the rectangle keep their candidates untouched: that is exactly where the 7 will end up.
| 4 | 6 | 2 | 5 | 9 | 8 | 3 | ||
| 2 | 9 | 6 | 8 | 3 | 5 | 1 | ||
Eliminations and placements
In the example, removing the 7 from R4C3 leaves a single candidate in that cell, 1 — a Naked Single, which gets placed at once. On column 7, the eliminations do not necessarily unlock a cell straight away, but they bring each cell one step closer to a Naked Single or a Hidden one.
The X-Wing does not place a digit by itself. Its job is to remove one candidate in several places at once — often many, over two whole columns — so that simpler techniques can take over next.
Common mistakes
The most common mistake is to eliminate in the wrong place. When the rectangle is formed by two rows, you clean the columns, never the other cells of those two rows. The corners of the rectangle are precisely where the 7 will end up.
Another trap is to accept a row where the digit is possible in three cells, or two columns that do not match. You need exactly two cells per row, and the same columns for both rows. One cell too many and the reasoning no longer holds.
Last watch-out: the X-Wing also works the other way around (two columns that share the same two rows). If you spotted it from the rows, also check from the columns — the eliminations are not the same.
Related patterns
The Swordfish is a fish of size 3: a digit confined to three rows and three columns. Each row does not need exactly three places — two is fine, as long as the three rows together only span three columns. The eliminations run on those three columns.
The Jellyfish is one step further, with four rows and four columns. The pattern gets much more tedious to find by hand, and it is rare on regular puzzles.
The XY-Wing and XYZ-Wing are not fish: they use three cells with two or three candidates linked by chains. They can show up at the same level as the X-Wing, and unlock positions where no fish is present.
When to use it
The X-Wing is expected at the Expert level, along with the triples and the quads. It paves the way for the Swordfish and the Jellyfish, which take the same reasoning to three, then four rows, and which you meet at the Extreme level.
To practice, Expert puzzles are a good ground: the X-Wing is the hardest technique the engine allows at that level, alongside triples and quads. If you stall on an Extreme puzzle, try the X-Wing before reaching for Swordfish or XY-Wing: it is simpler to check by hand.
- Expert sudoku
- Extreme sudoku
- Technique: the Swordfish
- Technique: the XY-Wing
- All solving techniques
- How to solve a sudoku
- Learn the techniques
Frequently asked questions
Why does the X-Wing eliminate the digit in the columns?
Because each of the two rows of the pattern must have that digit, and their two possible places are in the same columns. In either case, each of those columns gets its digit inside the rectangle: it can no longer appear elsewhere in those columns.
Can an X-Wing also be built with columns?
Yes. If the digit is possible in only two cells on each of two columns, and those cells fall in the same two rows, remove it from the other cells of those two rows.
Do the two rows have to be adjacent?
No. They can be anywhere in the grid, and so can the two columns. All that matters is that the columns match between the two rows.
Does an X-Wing place a digit?
No, it removes candidates. Those eliminations can then leave a Naked or Hidden Single, which lets you place a digit.
What is the difference between the X-Wing and the Swordfish?
The X-Wing works on two rows and two columns, the Swordfish on three. Both belong to the fish family and share the same reasoning, at different sizes.
Practice
Every technique helps remove candidates ; once a cell has only one left, you place it.
Three puzzles where X-Wing is the key move, served right before the step, with a coach.
Puzzle 1
Expert
The technique is used once in this puzzle
Puzzle 2
Expert
The technique is used once in this puzzle
Puzzle 3
Expert
The technique is used twice in this puzzle
Puzzles change every day.