The X-wing in sudoku

The X-wing is the first sudoku technique that ignores boxes and reads the whole board. It works on one digit at a time, it lives entirely in your pencil marks, and once you know its shape it announces itself: four candidate cells forming a rectangle. This guide shows you the pattern, the scan that finds it, and the near misses that eat solving time.

The pattern

Pick one digit and look only at its candidates. You are hunting rows where the digit has exactly two possible cells left. Find two such rows, check which columns those cells sit in, and if both rows use the same two columns, the four cells form a rectangle. That rectangle is the X-wing.

Candidate 6, two homes in each of the marked rows, same two columns. The rectangle is the X-wing.

The “exactly two” part is the whole engine. In each of those rows, the digit has nowhere else to go: one of the two marked cells must take it.

Check the claim on the board above; it plays fair. Each marked row has one more empty cell besides the highlighted pair. In the upper row that spare cell shows 3 and 8, and it cannot take a 6 because a placed 6 already sits further down its column. In the lower row the spare cell shows 2 and 9, blocked because its 3x3 box already holds the other placed 6. Filled cells cover everything else, so each row genuinely has two homes for its 6, and the rectangle turns that pair of facts into something bigger.

Why the elimination works

Suppose the top-left corner takes the digit. The bottom-left sits in the same column, so it cannot, and the bottom row only had two options, so the digit lands bottom-right. Now run it the other way: top-right true forces bottom-left. Two scenarios, and they are the two diagonals of the rectangle.

Look at what both scenarios agree on. Either way, the digit lands exactly once in each of the rectangle’s two columns. The columns are spent, no matter which diagonal turns out to be real. So every other copy of that candidate in those two columns is dead, and erasing them is the X-wing’s payoff:

Whichever diagonal is real, each column gets its 6 inside the rectangle. The struck 6s outside it fall.

Those eliminations rarely solve a cell on the spot. What they do is collapse the candidate picture: a cell drops to one option somewhere else, a pair appears, and the puzzle that was stalled starts moving again.

How to scan for one

Work one digit at a time, and let the board do the highlighting. Select any placed copy of a digit and every instance lights up, pencil marks included. If your marks are patchy, run Auto notes first, under the New Game button. The scan only means something when the candidate picture is complete, because a missing mark can make a row look like it holds exactly two homes when it does not.

Then count along each row: you want rows carrying exactly two of the highlighted candidate. Skip anything with three or more. Each time you find a second qualifying row, compare columns. Matching columns means the rectangle is there and you can start erasing; mismatched columns means move on to the next digit.

Digits with five or six placed copies are the best hunting ground. Most of their rows are already resolved, so the two-candidate rows stand out.

Near misses

The false positive that catches most solvers: a row with three candidate cells instead of two.

One placed 6 removed, and the bottom row's spare cell reopens. Three homes, no rectangle, no elimination.

One change separates this board from the first one: the placed 6 that was blocking the bottom row’s spare cell is gone, and the cell reopens for a 6. With three homes in the bottom row, the digit might avoid both rectangle columns entirely, and the whole argument dissolves. The rule has no flexibility: exactly two in each row, and every extra candidate breaks it. Worth knowing, though: three qualifying rows confined to three shared columns is not a failure, it is a swordfish, the X-wing’s bigger sibling one rung up the ladder.

The other classic miss is two clean rows whose columns almost line up: one shared column, one not. No rectangle, no elimination. Close does not count, and training your eye to reject these quickly is half the skill.

Columns work too

Everything above swaps cleanly. Find a candidate with exactly two homes in each of two columns, and if those four cells share their rows, the digit is pinned to the rectangle’s rows instead: erase the candidate from the rest of both rows. Board scans miss column X-wings constantly because rows are how most people read, so when a puzzle stalls, deliberately run the same count down the columns before moving on.

Frequently asked questions

What is an X-wing in sudoku?

An X-wing is one candidate digit restricted to exactly two cells in each of two different rows, with those four cells lining up in two shared columns. The digit must land on opposite corners of the rectangle whichever way it resolves, so you can erase it from every other cell of both columns. Swap rows and columns and the same pattern works the other way.

Why is it called an X-wing?

Draw the two ways the digit can resolve and you get the two diagonals of the rectangle, crossing in the middle as an X. The name stuck, and the wing family that followed it, XY-wing, XYZ-wing, W-wing, kept the theme.

What is the difference between an X-wing and a swordfish?

Size. An X-wing uses two rows and two shared columns. A swordfish stretches the same argument across three rows confined to three shared columns. If you understand why the X-wing forces opposite corners, the swordfish is the identical idea with one more row.

Do I need the X-wing for hard sudoku puzzles?

On this site, hard is where it appears. Every hard puzzle is graded to need hidden pairs, triples or an X-wing at its hardest point, so when a hard board stalls with full pencil marks, this rectangle is one of the first patterns worth hunting.