SudokuHint
Advanced

X-Wing

The first "advanced" technique most solvers learn — a single digit caught in a 2x2 rectangle, locking two entire rows or columns. X-Wings are the gateway from Hard puzzles to Expert ones.

By SudokuHint TeamLast updated

What is an X-Wing?

An X-Wing happens when one digit has exactly two candidate cells in two different rows — and those two pairs of cells line up vertically into the same two columns. The four cells form a rectangle.

Wherever the digit eventually lands, it has to take two corners of that rectangle on opposite diagonals (one in each row, one in each column). That guarantees the two columns will hold the digit inside the rectangle — so the digit can be eliminated from every other cell in those two columns.

The trick works just as well rotated 90°: two columns with exactly two candidate cells lined up in the same two rows. Then the two rows get cleared outside the rectangle.

Why it works (the logic)

Take the row-based version. Suppose digit 4 can only go in columns 3 and 7 in row 2, and digit 4 can only go in columns 3 and 7 in row 8 as well.

Row 2 must contain a 4 somewhere. It will land in either (R2C3) or (R2C7). Symmetric argument for row 8.

If both rows place 4 in column 3, column 3 has two 4s — illegal. Same for column 7. So the 4s must split diagonally: one row places its 4 in column 3, the other in column 7.

Whichever diagonal it is, column 3 has its 4 inside the rectangle, and column 7 has its 4 inside the rectangle. Neither column needs a 4 anywhere else. You can erase 4 from every other cell of columns 3 and 7.

How to spot an X-Wing

  1. Pick a digit. Pencil marks must be filled in already.
  2. For every row, list the columns where that digit is still a candidate.
  3. Find two rows that have exactly two candidate cells each, in the same two columns.
  4. Verify the elimination is useful — at least one of those two columns must contain the digit as a candidate outside the rectangle.
  5. Erase the digit from every cell in those two columns that lies outside the rectangle.

Then repeat with columns instead of rows. Many puzzles only contain the rotated form.

Why "X-Wing"?

The four candidate cells, if you trace the diagonals of the rectangle, form an X. Whichever diagonal the digit ends up on, it traces one stroke of that X. The name comes from sudoku notation tradition; it has nothing to do with Star Wars.

X-Wing is the smallest member of a family called fish. The 3-line version is called Swordfish, the 4-line version Jellyfish, and so on. Once you understand X-Wing, the rest of the fish family is just "more of the same."

Common beginner mistakes

  • The rows must have exactly two candidates each. Not three, not "mostly two." If a row has the digit in three columns, there is no guarantee about which two it ends up in.
  • The two columns must be identical. If row 2 has the digit in columns 3 and 7 but row 8 has it in columns 3 and 6, no X-Wing.
  • Pencil marks accuracy matters. An X-Wing is invisible without correct candidate notes. One missed candidate ruins the geometry.
  • The erasure happens outside the rectangle. The four corner cells themselves keep their digit candidates — you do not erase those.

When does an X-Wing appear?

X-Wings show up in Hard and Expert puzzles, typically after you have already applied every Naked Pair, Hidden Pair, Pointing Pair, and Box-Line Reduction you can find. If the puzzle is still deadlocked, scan for X-Wings before resorting to chains or guessing.

One X-Wing is often enough to unblock a stuck Expert puzzle. The eliminations it generates frequently cascade into a wave of Hidden Singles and Naked Singles.

Try it on a real puzzle

Open a hard puzzle on SudokuHint. Fill in pencil marks once the basic techniques run out. If the engine's 💡 Hint surfaces an X-Wing, you will see the four corner cells and the two lines being cleared — a complete worked example, live.

Article draft v1 · pending native-speaker review