Sudoku X Wing Explained: The Rectangle That Clears Two Lines
Here is the sudoku X wing explained in one sentence: pick a single digit, find two rows in which that digit has exactly two possible cells, and if those two pairs of cells sit in the same two columns, the digit can be erased from those two columns everywhere else on the grid.
Four cells at the corners of a rectangle. One digit. Two full columns cleaned out. It is the first technique that works on the geography of a digit rather than on the contents of a cell, and once you can see it, you can see it in about fifteen seconds per number.
Below: the exact conditions, the two-case proof, a fully worked row-based example with a real candidate map, a column-based one, the counting method for the payoff, and the four look-alikes that are not X-Wings.
Sudoku X wing explained: the pattern, stated precisely
An X-Wing is a single digit appearing in exactly two cells in each of two rows, with both rows using the same pair of columns — a 2×2 rectangle of candidates.
Every one of these conditions must hold:
| Requirement | Detail |
|---|---|
| One digit only | The whole pattern concerns a single number. Ignore every other candidate in those cells. |
| Two base rows | Two rows in which the digit has exactly two candidate cells each. |
| Matching columns | The candidate cells in both rows must fall in the same two columns. |
| Four corners | The result is a rectangle: R*a*C*x*, R*a*C*y*, R*b*C*x*, R*b*C*y*. |
| Elimination | The digit is removed from columns x and y in every row other than a and b. |
The pattern works identically with rows and columns swapped. Two columns each holding the digit in exactly two cells, both using the same two rows, lets you clear those two rows. The base lines and the cover lines simply trade places.
One thing that surprises people: the four corner cells may hold any number of other candidates. R2C3 can read {1, 4, 7, 9}. All that matters is where the digit 7 can and cannot go along the two base rows.
Why it works
Because the two base rows each need one copy of the digit, and the only columns available are the same two, those two columns are already fully committed — one digit each, both inside the base rows.
Take digit 7 with base rows 2 and 6, cover columns 3 and 8. There are exactly two ways to fill it:
| Arrangement | Row 2's 7 | Row 6's 7 | Column 3's 7 | Column 8's 7 |
|---|---|---|---|---|
| A | R2C3 | R6C8 | R2C3 | R6C8 |
| B | R2C8 | R6C3 | R6C3 | R2C8 |
The rows cannot both use column 3 — a column holds one 7. They cannot both use column 8 either. So the arrangement is one diagonal or the other, and in both arrangements column 3's single 7 and column 8's single 7 are already placed inside rows 2 and 6.
That means no cell in column 3 or column 8 outside those two rows can be a 7. You never find out which diagonal is live, and it does not matter — the conclusion is identical either way. This is a proof, not a trial.
Worked example: a row-based X-Wing on the digit 7
Map where a single digit can still go, row by row, and the pattern either exists or it does not.
Here is the full candidate map for the digit 7 on a stalled grid. Rows 3 and 9 already have their 7 placed.
Before — every cell that can still be a 7:
| Row | Columns where 7 is still possible | Count |
|---|---|---|
| R1 | C1, C4, C7 | 3 |
| R2 | C3, C8 | 2 |
| R3 | (7 already placed) | — |
| R4 | C3, C5, C9 | 3 |
| R5 | C2, C3, C8, C9 | 4 |
| R6 | C3, C8 | 2 |
| R7 | C1, C8 | 2 |
| R8 | C3, C5 | 2 |
| R9 | (7 already placed) | — |
Rows 2 and 6 each have exactly two homes for the 7, and both use columns 3 and 8. That is the X-Wing: corners at R2C3, R2C8, R6C3, R6C8.
Rows 7 and 8 also have exactly two homes each, but row 7 uses columns 1 and 8 and row 8 uses columns 3 and 5. Neither matches another row's column pair, so neither is part of a pattern.
Now clear columns 3 and 8, skipping rows 2 and 6.
| Cell | Was | Now |
|---|---|---|
| R4C3 | can be 7 | 7 removed |
| R5C3 | can be 7 | 7 removed |
| R8C3 | can be 7 | 7 removed |
| R5C8 | can be 7 | 7 removed |
| R7C8 | can be 7 | 7 removed |
Five eliminations from one observation. But the second-order effects are the real prize.
After — the same map:
| Row | Columns where 7 is still possible |
|---|---|
| R1 | C1, C4, C7 |
| R2 | C3, C8 |
| R4 | C5, C9 |
| R5 | C2, C9 |
| R6 | C3, C8 |
| R7 | C1 ← only one home left |
| R8 | C5 ← only one home left |
Two hidden singles fall out immediately. Row 7 had its 7 at C1 or C8; C8 is gone, so R7C1 = 7. Row 8 had its 7 at C3 or C5; C3 is gone, so R8C5 = 7.
Neither placement was available before the X-Wing. That is the shape of a good X-Wing find: a handful of erased candidates, and then the grid starts moving again on its own.
The column-based version
Swap the roles: two columns each holding the digit in exactly two cells, both using the same two rows, and you clear those two rows.
Digit 5. Column 2 can hold a 5 only at R1C2 and R9C2. Column 7 can hold a 5 only at R1C7 and R9C7. Same two rows — 1 and 9.
Corners: R1C2, R1C7, R9C2, R9C7. The two 5s for columns 2 and 7 sit on one diagonal or the other, and either way rows 1 and 9 have their 5s used up.
Erase 5 from every other cell in rows 1 and 9:
| Cell | Result |
|---|---|
| R1C5 | 5 removed |
| R1C9 | 5 removed |
| R9C4 | 5 removed |
Three eliminations. Smaller than the first example, and that is normal — the payoff depends entirely on how crowded the two cover lines are.
The direction matters for your search habit, not for the logic. Solvers who only ever scan rows find roughly half the X-Wings on a grid. Scan both.
How much is an X-Wing worth?
Count the digit's candidate cells in the two cover lines before you commit — an X-Wing on nearly empty columns eliminates nothing at all.
| Situation | Typical eliminations |
|---|---|
| Cover lines nearly empty of the digit | 0 — valid pattern, no payoff |
| One or two other candidates per cover line | 2–4 |
| Crowded cover lines | 5–7 |
A zero-elimination X-Wing is not a mistake; it is just a pattern that has already done its work through other techniques. Note it, move on, and do not spend time double-checking your logic — check the cover lines first, and only trace the geometry if there is something to erase.
Finding X-Wings without hunting blind
Work one digit at a time and write down the candidate map. The pattern is invisible in a normal candidate grid and obvious in a per-digit map.
- Complete your candidate grid. As with every technique above singles, acting on stale pencil marks will destroy the puzzle.
- Pick a digit. Start with the ones that already appear five or six times on the grid — the more copies placed, the more constrained the rest, and the more likely two rows have exactly two homes each.
- List, for each row, the columns where that digit is still possible. A nine-line list, exactly like the table above. Ignore rows where the digit is already placed.
- Circle every row with exactly two entries. On a stalled grid there are usually two to five.
- Compare the circled rows' column pairs. Any two rows sharing an identical pair is an X-Wing. This is a handful of comparisons, not a search.
- Repeat down the columns. Same list, built the other way.
- Erase, then return to singles. As the worked example showed, hidden singles are the usual follow-on.
The per-digit map is the whole trick. Trying to spot a rectangle inside a nine-by-nine field of pencil marks is genuinely hard; spotting a repeated pair in a nine-line list is trivial.
Four things that look like an X-Wing but are not
Every failed X-Wing traces back to one of these four, and all four are caught by re-reading the definition before you erase.
- Three candidate cells in a base row. If row 2 can hold the 7 at C3, C6 and C8, row 2 is not a base line. The row's 7 might go to C6, in which case column 3 and column 8 are not committed at all and the whole deduction collapses. Exactly two, no more.
- Column pairs that nearly match. Row 2 at columns 3 and 8, row 6 at columns 3 and 9. That shares one column, not two, and it proves nothing about either column. It is, however, the setup for a skyscraper — a genuine technique built precisely on this near-miss.
- Erasing from the rows instead of the columns. In a row-based X-Wing the base rows are already accounted for, and the eliminations land in the two columns. Mixing this up removes candidates that were perfectly legal and quietly ruins the grid.
- Erasing from the corners. The four corner cells keep their candidate. You do not know which diagonal is live, so all four remain possible.
The sentence check works here as well. "Rows 2 and 6 can only put their 7 in columns 3 and 8, so those two columns get their 7 from those two rows, so nothing else in columns 3 or 8 is a 7." If you cannot say it cleanly, you have not found one.
A geometric note worth knowing
Two base rows in the same band — rows 2 and 3, say — can only form an X-Wing if the two cover columns are in different stacks. If the columns were also in the same stack, all four corners would sit inside a single box, requiring two copies of the digit in one box. That is impossible, so the configuration never appears on a legal grid.
Finned X-Wings
If a pattern is a perfect X-Wing except for one extra candidate cell in a base line, and that extra cell sits in the same box as one of the corners, you have a finned X-Wing. It still eliminates — but only from cells that see both the fin and the corresponding corner, which is a much smaller set. It is worth knowing that the near-miss is not always worthless; it is not worth hunting for until the plain version is second nature.
Where the X-Wing sits in the ladder
The X-Wing is the entry point to single-digit pattern solving, and everything above it on the ladder is a variation on the same idea. Learn the sudoku X wing explained here and the swordfish costs you almost nothing extra.
| Order | Technique | Idea | Guide |
|---|---|---|---|
| 1 | Singles | One option left | How to play sudoku |
| 2 | Locked candidate | Digit trapped in an intersection | Locked candidate sudoku |
| 3 | Naked pairs | Two cells, two digits | Naked pairs sudoku |
| 4 | X-Wing | One digit, 2×2 rectangle | This page |
| 5 | Swordfish | One digit, 3×3 extension | Swordfish sudoku |
| 6 | Y-Wing | Three bi-value cells | Y wing sudoku |
| 7 | Skyscraper | Two conjugate pairs, shared base | Skyscraper sudoku |
The next technique to learn is the swordfish. It is the same logic stretched to three rows and three columns, and if you understand why the X-Wing works you already understand ninety percent of it. If this page felt like a jump, drop back to naked pairs first.
Our free puzzle maker generates unlimited classic 9×9 sudoku at easy, medium and hard, prints one to six per page with an answer key, and verifies a unique solution on every grid.
Frequently asked questions
What is an X-Wing in sudoku?
An X-Wing is a single-digit pattern made of four cells at the corners of a rectangle. Two rows each have exactly two remaining places for the digit, and both rows use the same two columns. Because each row must place one copy of the digit and only those two columns are available, both columns get their copy from inside those two rows — so the digit can be erased from those columns in every other row.
Why is it called an X-Wing?
Because of the two possible solutions. The digit ends up on one diagonal of the rectangle or the other, and drawing both diagonals over the four corners makes an X. The name has nothing to do with the shape of the eliminations, which run down two straight lines rather than diagonally.
Do the four cells of an X-Wing have to contain only that digit?
No, and this is the most common misunderstanding. The corner cells can hold any number of other candidates. The pattern is about a single digit's geography — where that number can still go along two lines — and every other candidate in those cells is irrelevant to the deduction.
Can an X-Wing work on three rows?
Not as an X-Wing. Extend it to three rows in which the digit is confined to the same three columns and you have a swordfish, which follows exactly the same reasoning at a larger size. Four rows and four columns is a jellyfish. Beyond that the patterns exist but are effectively never needed, since a five-line fish on a 9×9 grid always has a simpler counterpart.
How is the sudoku X wing explained differently from a skyscraper?
They start from the same place and separate on one column. An X-Wing needs both base rows to use the same two columns. A skyscraper takes the case where the two rows share one column and differ on the other — the shared column becomes the base, the two odd cells become the roof, and the eliminations land on cells that see both roof cells rather than down two full lines.
How often do X-Wings appear?
Rarely at easy and medium level, because those puzzles resolve through singles, locked candidates and pairs long before a digit gets constrained to two cells in two rows. On hard and expert grids an X-Wing shows up perhaps one time in three, usually in the middle of the solve once the candidate grid has thinned out. It is worth a dedicated per-digit scan whenever a grid stalls.
