X-Wing is the move where a sudoku stops being a puzzle you can brute-force and becomes a puzzle you have to reason about. It is also the technique most people are looking for when they search for how to beat expert sudoku — and in our grading, it is exactly the line: a puzzle that needs an X-Wing is Expert.
The shape is a rectangle. One digit, two rows, two columns — four cells. Once you see it, the eliminations are free.
X-Wing
How to spot it
For one digit, find two rows where it can only go in the same two columns (or two columns sharing the same two rows). The four cells form a rectangle.
What to do
The digit must sit on opposite corners, so it can be removed from the rest of both columns or both rows. This is where expert puzzles usually turn.
Other techniques: Naked single, Hidden single, Locked candidates, Naked pair / triple, Hidden pair, Naked triple, XY-Wing, Swordfish, Naked quad, Hidden triple, XYZ-Wing, W-Wing
How to spot it
Take one digit and one direction:
- Rows. Find two rows in which that digit can go in only two cells — and in the same two columns in both rows.
- Columns. The mirror image: find two columns in which the digit can go in only two cells, both in the same two rows.
If a row has three possible places for the digit, it is not part of an X-Wing. Two is the requirement.
A real example. Take this position and hunt for the digit 9:
1 2 3 4 5 6 7 8 9
+-------+-------+-------+
1 | 1 . 8 | . . . | . . 3 |
2 | . 2 3 | 8 . . | . 1 7 |
3 | 5 . 7 | 3 1 2 | . 8 . |
+-------+-------+-------+
4 | 2 . 1 | 7 . 6 | . 5 8 |
5 | 8 3 6 | . 5 1 | . 7 2 |
6 | . 7 5 | 2 . . | 1 . . |
+-------+-------+-------+
7 | 6 8 . | 1 9 . | . . 5 |
8 | 7 5 9 | 6 . 4 | . . 1 |
9 | 3 1 . | 5 . . | . . 9 |
+-------+-------+-------+
Look along row 3. It already holds 5, 7, 3, 1, 2 and 8. The empty cells and their candidates are r3c2 {4,6,9}, r3c7 {4,6,9} and r3c9 {4,6}. The digit 9 fits in only two of them: r3c2 and r3c7.
Now look along row 4. It holds 2, 1, 7, 6, 5 and 8. Its empty cells: r4c2 {4,9}, r4c5 {3,4} and r4c7 {3,4,9}. Again, the 9 fits in exactly two: r4c2 and r4c7.
Two rows, and in both of them the 9 is confined to columns 2 and 7. That is the rectangle:
3 | . 9 . | . . . | . 9 . | <- the 9 in row 3 is only at c2 or c7
4 | . 9 . | . . . | . 9 . | <- and in row 4 at c2 or c7 too
c2 c7
What to do with it
Row 3 must contain a 9, and it has to be in column 2 or column 7. Row 4 must contain a 9, also in B or G. And they cannot both be in the same column, because column 2 can only hold one 9.
So the 9s are on opposite corners of the rectangle. There are exactly two ways that can happen, and the table is the whole proof:
| row 3 puts its 9 in | so row 4 must put its 9 in | column 2’s 9 is used by | column 7’s 9 is used by |
|---|---|---|---|
| c2 | c7 | r3c2 | r4c7 |
| c7 | c2 | r4c2 | r3c7 |
Read the last two columns: in both rows of the table, the 9 of column 2 sits inside the rectangle and so does the 9 of column 7. The puzzle has no third case, so that is a fact, not a guess — and it is where the eliminations come from. Delete the 9 candidate from:
- r1c2, r1c7 (row 1)
- r2c7 (row 2)
- r5c7 (row 5)
Notice what makes this hard: the conclusion is not about the four corners. It is about the columns those corners sit in. Beginners check the rectangle, delete nothing, and move on.
Variations
The same logic works on columns instead of rows — two columns, one digit, two rows. It is the identical pattern rotated, and it is worth practising both, because in a real puzzle you will spot whichever one your eyes happen to fall on.
The next size up is the Swordfish: three rows, three columns, same argument. And if you prefer patterns built from two-candidate cells, XY-Wing is the other big expert weapon.
Where it sits
X-Wing is level 7 — the first technique our engine treats as expert. If you can reliably find X-Wings, you can solve puzzles that most “hard” sudoku apps will not give you, because most of them cap out right here.
Common mistakes
Counting three positions in a row. The x-wing needs exactly two candidate positions in each base line. Three positions is a different fish (and usually not one this site’s grader will call an x-wing).
Mixing the digit. All four corners must be candidates for the same digit. A rectangle with 3 in one corner and 7 in the other is not an x-wing, it is a coincidence.
Eliminating from the corners. The rectangle keeps its four candidates — that is the point of it. The eliminations are the same digit in the other cells of the two cover lines.
Only scanning rows. An x-wing is usually taught base rows / cover columns, but it works just as well base columns / cover rows, and the column version is often the only one visible in a given grid. Scan both.
Confusing it with an xy-wing. An x-wing is one digit forming a rectangle across two lines. An xy-wing is three cells holding two candidates each, in three different units, and it removes a different digit. The names are alike; the pictures are not.
Telling it apart from a swordfish
Count the lines: two rows (or two columns) that each offer the digit exactly twice is an x-wing; three lines whose candidates fall in only three cover lines is a swordfish. A swordfish row may have two candidate cells as well, so the safe test is not “how many per row” but “how many cover lines hold all the candidates”.
Next step up: XY-Wing — three bivalue cells doing one digit’s work. Previous step: Naked triple. All Thirteen, in order: the strategy hub.
New to the notation? This page writes a cell as r3c8 — row 3, column 8 — and the notation page explains the rest of the shorthand.
Practise it: X-Wing drill — every puzzle in the index is a position where the next move really is an X-Wing. Related: Swordfish (the three-line version) · XY-Wing (the other expert weapon).