X-Wing Sudoku: How to Spot and Use the Strategy
An X-Wing is a sudoku strategy for a single digit. When that digit has only two possible squares in each of two rows, and those squares line up in the same two columns, it has to sit in opposite corners of that rectangle. So you can remove it from every other square in those two columns.
Updated
The X-Wing in short
One digit, two rows, two columns. If a digit can only go in the same two columns in two different rows, each of those columns gets that digit from one of the two rows. Erase it from the rest of both columns. Flip rows and columns and the rule works the same way.
Grid squares here are named by column and row: columns run from A to I and rows from 1 to 9, so D3 is column D, row 3. Candidates are the digits that can still go in an empty square. If you need a refresher on candidates, pairs and pointing pairs first, start with our sudoku tips and tricks.
How to find an X-Wing in four steps
- Fill in every candidate in every empty square. An X-Wing built on incomplete notes isn’t an X-Wing.
- Pick one digit and look only at that digit. Ignore all other candidates.
- Find rows where the digit has exactly two possible squares. If two of those rows use the same two columns, you’ve found an X-Wing.
- Erase the digit from every other square in those two columns. Then run the same search with columns instead of rows.
Example 1: an X-Wing in rows
This position comes from the hard puzzle at the end of this page, after the first 29 easy moves. Twenty-two squares are still empty, and none of them can be filled with a single. Here are all the candidates:
The hard puzzle after 29 singles, with every candidate for the 22 empty squares
- Row 1: 8, empty (candidates 4 9), 3, empty (candidates 1 4 5 9), empty (candidates 5 9), 2, empty (candidates 1 5 7), 6, empty (candidates 5 7)
- Row 2: 6, 1, 5, 3, 7, 8, 4, 9, 2
- Row 3: 7, empty (candidates 4 9), 2, empty (candidates 1 4 5 9), 6, empty (candidates 1 9), 8, empty (candidates 1 3), empty (candidates 3 5)
- Row 4: 5, 3, empty (candidates 1 9), empty (candidates 1 9), 8, 4, 2, 7, 6
- Row 5: 4, 2, 6, 7, 3, 5, 9, 8, 1
- Row 6: empty (candidates 1 9), 7, 8, 6, 2, empty (candidates 1 9), 3, 5, 4
- Row 7: 3, 6, empty (candidates 1 9), empty (candidates 5 9), 4, 7, empty (candidates 1 5), 2, 8
- Row 8: 2, 5, 7, 8, 1, 3, 6, 4, 9
- Row 9: empty (candidates 1 9), 8, 4, 2, empty (candidates 5 9), 6, empty (candidates 1 5 7), empty (candidates 1 3), empty (candidates 3 5 7)
Now look only at the 9. In row 4, it can only go in C4 or D4. In row 7, it can only go in C7 or D7. Those four squares form a rectangle in columns C and D.
Only the candidates for 9: C4, D4, C7 and D7 marked, columns C and D highlighted, the 9 crossed out in D1 and D3
- Row 1: 8, empty (candidates 9), 3, empty (candidates 9, 9 eliminated), empty (candidates 9), 2, empty, 6, empty
- Row 2: 6, 1, 5, 3, 7, 8, 4, 9, 2
- Row 3: 7, empty (candidates 9), 2, empty (candidates 9, 9 eliminated), 6, empty (candidates 9), 8, empty, empty
- Row 4: 5, 3, empty (candidates 9) (C4 marked), empty (candidates 9) (D4 marked), 8, 4, 2, 7, 6
- Row 5: 4, 2, 6, 7, 3, 5, 9, 8, 1
- Row 6: empty (candidates 9), 7, 8, 6, 2, empty (candidates 9), 3, 5, 4
- Row 7: 3, 6, empty (candidates 9) (C7 marked), empty (candidates 9) (D7 marked), 4, 7, empty, 2, 8
- Row 8: 2, 5, 7, 8, 1, 3, 6, 4, 9
- Row 9: empty (candidates 9), 8, 4, 2, empty (candidates 9), 6, empty, empty, empty
If the 9 in row 4 is in C4, then row 7 has to put its 9 in D7, because column C already has one. If it’s in D4, row 7’s 9 goes in C7. Either way, columns C and D each get their 9 from row 4 or row 7, so no other square in those columns can hold a 9. Cross it out of D1 and D3.
That doesn’t place a digit yet: D1 and D3 are each left with 1, 4 and 5. That’s normal in hard puzzles, where one elimination often just sets up the next. You’ll see where it leads in the Swordfish and XY-Wing sections below.
Example 2: an X-Wing in columns
The same pattern works sideways. This second position comes from a different puzzle, also with exactly one solution, at a point where no single is left. This time, look at the 6. In column C, it can only go in C1 or C7. In column H, it can only go in H1 or H7. So both columns get their 6 from row 1 or row 7, and the 6 can’t go anywhere else in those two rows: not in A1, and not in D7.
Second example, only the candidates for 6: C1, H1, C7 and H7 marked, rows 1 and 7 highlighted, the 6 crossed out in A1 and D7
- Row 1: empty (candidates 6, 6 eliminated), 1, empty (candidates 6) (C1 marked), 3, 5, 2, empty, empty (candidates 6) (H1 marked), 4
- Row 2: empty (candidates 6), 8, 3, 1, 7, 4, 5, 2, empty (candidates 6)
- Row 3: 4, 2, 5, 9, 6, 8, 1, 7, 3
- Row 4: 3, 4, empty, empty (candidates 6), 1, empty (candidates 6), 2, 9, empty
- Row 5: 2, 5, 9, 4, 8, 7, 6, 3, 1
- Row 6: empty, 6, 1, 2, 3, 9, empty, empty, 5
- Row 7: 5, 3, empty (candidates 6) (C7 marked), empty (candidates 6, 6 eliminated), 9, 1, empty, empty (candidates 6) (H7 marked), 2
- Row 8: empty (candidates 6), 9, 4, empty (candidates 6), 2, empty (candidates 6), empty, 1, empty (candidates 6)
- Row 9: 1, 7, 2, 8, 4, empty (candidates 6), empty, 5, empty (candidates 6)
This one pays off right away. D7 could only be a 6 or a 7, so with the 6 gone, it’s a 7. Keep the direction straight: when the pattern sits in rows, you erase along the columns. When it sits in columns, you erase along the rows.
Why it’s called an X-Wing
The four squares always form a rectangle, and the digit ends up in two opposite corners. Those two possible placements run along the rectangle’s diagonals, which cross like an X. You don’t know which diagonal is the right one, and you don’t need to: both put exactly one copy of the digit in each of the two columns, and that’s all the elimination relies on.
The four corners don’t have to be close together or in the same boxes. In example 1, the two columns sit side by side. In example 2, they’re far apart, in columns C and H. What matters is that the digit has no other spot in the two rows (or columns) you start from.
Common X-Wing mistakes
- Erasing in the wrong direction. For an X-Wing in rows, you remove the digit from the columns, never from the two rows themselves. Those rows are exactly where the digit is guaranteed to be.
- Missing a third spot. If the digit has a third possible square anywhere in one of the base rows, it’s not an X-Wing. That’s why complete notes come first.
- Mixing digits. An X-Wing always applies to a single digit. Other candidates in the same squares don’t matter.
- Expecting an instant payoff. Sometimes an X-Wing places a digit right away, as in example 2. Sometimes it only narrows things down, as in example 1. Both are progress.
Beyond the X-Wing: the Swordfish
A Swordfish is an X-Wing with three rows. If a digit can only go in the same three columns across three rows, those three rows will place it once in each of the three columns. Erase it from the rest of those columns. Each row needs two or three of the spots, not necessarily all three.
Back to the hard puzzle, after the X-Wing, and now look at the 1. In row 1, it can only go in D1 or G1. In row 4, only in C4 or D4. In row 7, only in C7 or G7. That’s just three columns between them: C, D and G.
Only the candidates for 1: D1, G1, C4, D4, C7 and G7 marked, columns C, D and G highlighted, the 1 crossed out in D3 and G9
- Row 1: 8, empty, 3, empty (candidates 1) (D1 marked), empty, 2, empty (candidates 1) (G1 marked), 6, empty
- Row 2: 6, 1, 5, 3, 7, 8, 4, 9, 2
- Row 3: 7, empty, 2, empty (candidates 1, 1 eliminated), 6, empty (candidates 1), 8, empty (candidates 1), empty
- Row 4: 5, 3, empty (candidates 1) (C4 marked), empty (candidates 1) (D4 marked), 8, 4, 2, 7, 6
- Row 5: 4, 2, 6, 7, 3, 5, 9, 8, 1
- Row 6: empty (candidates 1), 7, 8, 6, 2, empty (candidates 1), 3, 5, 4
- Row 7: 3, 6, empty (candidates 1) (C7 marked), empty, 4, 7, empty (candidates 1) (G7 marked), 2, 8
- Row 8: 2, 5, 7, 8, 1, 3, 6, 4, 9
- Row 9: empty (candidates 1), 8, 4, 2, empty, 6, empty (candidates 1, 1 eliminated), empty (candidates 1), empty
Three rows need three 1s, each in a different column. Since only C, D and G are available, each of those columns gets its 1 from row 1, 4 or 7. So the 1 comes out of D3 and G9. Now D3 is down to two candidates, 4 and 5, and that sets up the last move.
A different kind of wing: the XY-Wing
Despite the name, an XY-Wing works differently. It uses three squares that each have exactly two candidates. The middle one, the pivot, holds x and y. It sees two other squares, the wings, one with x and z and one with y and z. “Sees” means they share a row, a column or a box. Whatever the pivot turns out to be, one of the wings becomes z, so z can’t go in any square that sees both wings.
In the puzzle, E1 is the pivot with 5 and 9. B1 (4 and 9) sees it along row 1, and D3 (4 and 5) sees it inside the top-middle box. If E1 is a 9, B1 has to be a 4. If E1 is a 5, D3 has to be a 4. Either way, one of the wings is a 4.
XY-Wing with pivot E1 (5 9) and wings B1 (4 9) and D3 (4 5), the 4 crossed out in D1 and B3
- Row 1: 8, empty (candidates 4 9) (B1 marked), 3, empty (candidates 1 4 5, 4 eliminated), empty (candidates 5 9) (E1 marked), 2, empty, 6, empty
- Row 2: 6, 1, 5, 3, 7, 8, 4, 9, 2
- Row 3: 7, empty (candidates 4 9, 4 eliminated), 2, empty (candidates 4 5) (D3 marked), 6, empty, 8, empty, empty
- Row 4: 5, 3, empty, empty, 8, 4, 2, 7, 6
- Row 5: 4, 2, 6, 7, 3, 5, 9, 8, 1
- Row 6: empty, 7, 8, 6, 2, empty, 3, 5, 4
- Row 7: 3, 6, empty, empty, 4, 7, empty, 2, 8
- Row 8: 2, 5, 7, 8, 1, 3, 6, 4, 9
- Row 9: empty, 8, 4, 2, empty, 6, empty, empty, empty
D1 shares row 1 with B1 and column D with D3. B3 shares the top-left box with B1 and row 3 with D3. Cross the 4 out of both. Now B3 can only be a 9, and the rest of the puzzle falls with singles, starting with the 4 in B1 and the 9 in B3. If you look closely, there’s a second XY-Wing here too: pivot D3 (4 and 5) with wings E1 (5 and 9) and B3 (4 and 9). It removes the 9 from B1 and F3 and gets you to the same place.
Practice: a hard sudoku with a full solution path
Here’s the whole puzzle the examples came from. We made it for this page: 30 clues and exactly one solution. A checking program confirmed both, and that it can be solved without guessing. Its solution path uses each of the three techniques on this page once, and none of them can be skipped. Try it yourself first, then open the solution path.
Hard 9×9 sudoku with 30 clues
- Row 1: empty, empty, empty, empty, empty, 2, empty, 6, empty
- Row 2: empty, 1, 5, 3, empty, 8, empty, empty, 2
- Row 3: 7, empty, empty, empty, 6, empty, empty, empty, empty
- Row 4: empty, 3, empty, empty, empty, 4, 2, empty, empty
- Row 5: 4, empty, 6, 7, empty, 5, 9, empty, 1
- Row 6: empty, empty, 8, 6, empty, empty, empty, 5, empty
- Row 7: empty, empty, empty, empty, 4, empty, empty, empty, 8
- Row 8: 2, empty, empty, 8, empty, 3, 6, 4, empty
- Row 9: empty, 8, empty, 2, empty, empty, empty, empty, empty
The path below lists every move in the order the checking program verified it: 29 singles, the three eliminations, then 22 more singles. You can solve the singles in a different order; the digits they place stay the same.
Show the solution path and answer
| No. | Move | Reason |
|---|---|---|
| Phase 1: singles until you’re stuck | ||
| 1 | A2 = 6 | only spot in box A1–C3 |
| 2 | A1 = 8 | only spot in box A1–C3 |
| 3 | A4 = 5 | only spot in box A4–C6 |
| 4 | I4 = 6 | only spot in box G4–I6 |
| 5 | C9 = 4 | only spot in box A7–C9 |
| 6 | B7 = 6 | only spot in box A7–C9 |
| 7 | B8 = 5 | only spot in box A7–C9 |
| 8 | F9 = 6 | only spot in box D7–F9 |
| 9 | H7 = 2 | only spot in box G7–I9 |
| 10 | G2 = 4 | only spot in row 2 |
| 11 | I6 = 4 | only spot in box G4–I6 |
| 12 | B6 = 7 | only spot in column B |
| 13 | B5 = 2 | only spot in box A4–C6 |
| 14 | C3 = 2 | only spot in box A1–C3 |
| 15 | C1 = 3 | only spot in box A1–C3 |
| 16 | E6 = 2 | only spot in box D4–F6 |
| 17 | E5 = 3 | only spot in box D4–F6 |
| 18 | E4 = 8 | only spot in box D4–F6 |
| 19 | G6 = 3 | only spot in box G4–I6 |
| 20 | H4 = 7 | only spot in box G4–I6 |
| 21 | H5 = 8 | only spot in box G4–I6 |
| 22 | G3 = 8 | only spot in box G1–I3 |
| 23 | E2 = 7 | only spot in row 2 |
| 24 | F7 = 7 | only spot in box D7–F9 |
| 25 | C8 = 7 | only spot in box A7–C9 |
| 26 | H2 = 9 | only spot in row 2 |
| 27 | A7 = 3 | only spot in row 7 |
| 28 | E8 = 1 | only spot in row 8 |
| 29 | I8 = 9 | only spot in row 8 |
| Stuck: 22 empty squares, no single | ||
| – | remove 9 from D1 and D3 | X-Wing: in rows 4 and 7, the 9 can only go in columns C and D. |
| – | remove 1 from D3 and G9 | Swordfish: in rows 1, 4 and 7, the 1 can only go in columns C, D and G. |
| – | remove 4 from D1 and B3 | XY-Wing: pivot E1, wings B1 and D3. |
| Phase 2: singles to the finish | ||
| 30 | B1 = 4 | only spot in box A1–C3 |
| 31 | B3 = 9 | only spot in box A1–C3 |
| 32 | D3 = 4 | only spot in box D1–F3 |
| 33 | E1 = 9 | only spot in box D1–F3 |
| 34 | D1 = 5 | only spot in box D1–F3 |
| 35 | F3 = 1 | only spot in box D1–F3 |
| 36 | G1 = 1 | only spot in box G1–I3 |
| 37 | I3 = 5 | only spot in box G1–I3 |
| 38 | H3 = 3 | only spot in box G1–I3 |
| 39 | I1 = 7 | only spot in box G1–I3 |
| 40 | D4 = 1 | only spot in box D4–F6 |
| 41 | A6 = 1 | only spot in box A4–C6 |
| 42 | C4 = 9 | only spot in box A4–C6 |
| 43 | F6 = 9 | only spot in box D4–F6 |
| 44 | C7 = 1 | only spot in box A7–C9 |
| 45 | A9 = 9 | only spot in box A7–C9 |
| 46 | E9 = 5 | only spot in box D7–F9 |
| 47 | D7 = 9 | only spot in box D7–F9 |
| 48 | H9 = 1 | only spot in box G7–I9 |
| 49 | I9 = 3 | only spot in box G7–I9 |
| 50 | G7 = 5 | only spot in box G7–I9 |
| 51 | G9 = 7 | only spot in box G7–I9 |
The full solution of the hard sudoku
- Row 1: 8, 4, 3, 5, 9, 2, 1, 6, 7
- Row 2: 6, 1, 5, 3, 7, 8, 4, 9, 2
- Row 3: 7, 9, 2, 4, 6, 1, 8, 3, 5
- Row 4: 5, 3, 9, 1, 8, 4, 2, 7, 6
- Row 5: 4, 2, 6, 7, 3, 5, 9, 8, 1
- Row 6: 1, 7, 8, 6, 2, 9, 3, 5, 4
- Row 7: 3, 6, 1, 9, 4, 7, 5, 2, 8
- Row 8: 2, 5, 7, 8, 1, 3, 6, 4, 9
- Row 9: 9, 8, 4, 2, 5, 6, 7, 1, 3
Where the X-Wing fits in your solving order
Advanced patterns are rarer and harder to spot than simple moves, so check for them in a fixed order and go back to the top after every new digit or elimination:
- Singles: scanning, the only spot in a row, column or box, the only digit for a square.
- Notes: every candidate in every empty square, cleaned up after each move.
- Pairs and pointing pairs.
- X-Wing: one digit at a time, rows and columns with exactly two spots.
- Swordfish: the same search with three rows or columns.
- XY-Wing: a square with two candidates and two matching wings it can see.
For fish patterns like the X-Wing and the Swordfish, the single-digit view from the grids above makes all the difference. Many sudoku apps can highlight one digit across the grid; on paper, a highlighter does the same job. There are more advanced techniques beyond these, such as chains of two-candidate squares. They follow the same idea as the XY-Wing: a chain of if-then steps that ends in a safe elimination.
Sudoku in Sudocrime
In Sudocrime, the sudoku is the key to the case, not the final boss. Every sudoku in the stories can be solved with scanning and singles, including the classic 9×9 puzzles from chapter 5 of “The Venice Night Train”. If you do get stuck, the hint walks you through the next step in three stages: where to look, the reasoning, and finally the number.
The real deduction comes afterward, on the floor plan. That’s where you place the suspects based on statements and clues, using a rule that’s a close cousin of sudoku: exactly one person per row and column. To see how the sudoku, the statements and the floor plan come together, read How a murder sudoku works, or brush up on the basics in our sudoku rules.
Frequently asked questions
What is an X-Wing in sudoku?
An X-Wing is a pattern for one digit. If that digit has exactly two possible squares in each of two rows, and those squares sit in the same two columns, it has to land in opposite corners of the rectangle they form. That means you can remove the digit from every other square in those two columns. The same works with columns and rows swapped.
How do you find an X-Wing?
Pick one digit and ignore every other candidate. Look for rows where that digit has exactly two possible squares. If two of those rows use the same two columns, you have an X-Wing. Then repeat the search with columns instead of rows, and move on to the next digit.
What is the difference between an X-Wing and a Swordfish?
A Swordfish is an X-Wing stretched to three rows and three columns. The digit can only appear in the same three columns across three rows, with two or three spots per row. You then remove it from the rest of those three columns.
Is an XY-Wing the same as an X-Wing?
No. An X-Wing looks at one digit across two rows and two columns. An XY-Wing looks at three squares that each have exactly two candidates: a pivot with x and y, and two wings with x and z and with y and z. Whatever the pivot turns out to be, one wing becomes z, so z can go in no square that sees both wings.