X-Wing in Sudoku
The X-Wing is the gateway to advanced sudoku. It's the first technique that spans the whole grid instead of working inside a single row, column, or box — four cells forming a rectangle, locking one digit into a cross-grid pattern. If you've built the habit of digit-first scanning from hidden pairs, the X-Wing is where that habit starts paying serious dividends on expert puzzles.
What Is an X-Wing?
An X-Wing occurs when a digit has exactly two possible cells in each of two different rows — and those cells sit in the same two columns. The four cells form the corners of a rectangle.
When that happens, the digit is trapped: it must occupy two opposite corners of the rectangle, one per row. Whichever pair of corners it takes, both columns receive the digit — so it can be eliminated from every other cell in those two columns.
The same works with the axes swapped: two columns where the digit has exactly two cells, aligned in the same two rows — eliminating from the rows instead.
Why Does This Work?
Look at the rectangle and play out the possibilities. Take the top-left corner: either the digit goes there, or it goes in the top-right corner — the top row has no third option. If it's top-left, the bottom row's left corner is blocked (same column), so the bottom row must use its right corner. If it's top-right, the bottom row must use bottom-left. Two scenarios, and they trace the two diagonals of an X — that's the name.
Now notice what both scenarios have in common: each puts one copy of the digit in the left column and one in the right column. You don't know which diagonal is true, but both columns are consumed either way. Any other candidate for that digit in those columns is dead.
How to Find X-Wings
- Pick a digit — ideally one that's already placed five or six times.
- For each row that doesn't contain the digit yet, count its possible cells. Keep the rows where the count is exactly two.
- Among those rows, look for two whose candidate cells sit in the same two columns.
- Found a match? Eliminate the digit from all other cells of those two columns. Then repeat the scan with columns as the base.
Example: Row-Based X-Wing
In the grid below, follow the digit 7. Row 2 is nearly full — the 7 fits only in C3 and C8. Row 6 is more open, but the columns do the blocking: C1 has a 7 lower down, and the 7s in columns C4, C5, and C6 rule out the middle — again only C3 and C8 remain. Two rows, each with exactly two spots, in the same two columns: an X-Wing on 7.
The green cells are the payoff. R1C8 and R4C3 both currently allow a 7 — but columns C3 and C8 are claimed by the X-Wing, so both candidates are eliminated:
Verify it yourself: in row 2 and row 6, try to put a 7 anywhere outside the amber cells — every gray cell is covered by a placed 7 in its column or box. The rectangle is real, and the eliminations follow.
Column-Based X-Wing
Rotate the idea a quarter turn. Below, the digit 4 has exactly two possible cells in column C2 and exactly two in column C6 — and they align in rows 3 and 8. The rectangle stands on its side, and the eliminations sweep along the rows: the 4s at R3C4 and R8C1 are gone.
Always run both scans. Row-based and column-based X-Wings are equally common, and a grid that hides one often reveals the other.
How to Spot X-Wings Faster
- Chase the crowded digits. A digit placed six times has only three rows left to live in — its remaining positions are tightly constrained, which is exactly what an X-Wing needs.
- Count positions, not patterns. Don't look for rectangles directly. For your chosen digit, write down each row's possible columns; two matching pairs jump out of that list far faster than they do off the grid.
- Rows with two candidates are rare — remember them. Whenever routine scanning shows you a row where a digit has just two spots, make a mental note. The second half of an X-Wing often turns up several moves later.
Beyond the X-Wing: Swordfish
The X-Wing generalizes. Three rows in which a digit is confined to the same three columns form a Swordfish — same logic, one size up: the three columns are consumed, and the digit disappears from their other cells. If you're comfortable with X-Wings, you already understand Swordfish; the only extra difficulty is spotting it.
When to Use X-Wings
X-Wings belong to expert and evil territory. Reach for them when singles, pairs, and triples have all gone quiet and the grid still won't move. Like all elimination techniques, an X-Wing rarely places a digit directly — its job is to break the deadlock, and the naked and hidden singles that follow do the filling in.
Practice on a free Expert Sudoku →