Skip to content
SudokuPart 16 of 49
SudokuPuzzlesLogic Games

The XY-Wing, Explained Slowly

Three cells, two candidates each, and a digit that has to leave everything both wings can see. Two stalled hard grids worked from the bivalue list to the placement.

By Bimal Khatri·16 min read·Sep 9, 2026·Updated Sep 10, 2026
The XY-Wing, Explained Slowly

An XY-Wing is three cells that hold two candidates each. Their lists are {x,y}, {x,z} and {y,z}, three digits and no more. The {x,y} cell is the pivot, and it has to see the other two, which are the wings. Then any cell that sees both wings cannot be z.

That last sentence is the payoff. One digit leaves a small set of cells, and one of those cells usually collapses to a placement straight afterwards.

The pattern is worth learning because the search is small. You are not scanning the grid for a digit. You are reading a list of the cells that already carry exactly two pencil marks, and a stalled grid rarely offers more than twenty of those. Both grids below are worked from that list down to the placement.

Listing bivalue cells on a phone? Sudoku Master throws away the notes a placement kills, so the two-mark cells you are reading are two marks because the board says so. Free, offline, and no ads while you solve.

The pattern, in one table

Part of itWhat has to be true
The pivotExactly two candidates, {x,y}
Wing oneExactly two candidates, {x,z}, and the pivot sees it
Wing twoExactly two candidates, {y,z}, and the pivot sees it
The digitsThree distinct digits across the three cells. Never two, never four
The wingsThey need not see each other. Usually they do not
What you winz leaves every cell that sees both wings
What you never learnWhich of the two wings actually holds the z

"Sees" means the ordinary Sudoku relationship. Two cells see each other when they share a row, a column or a box. Every cell has twenty of those peers, and the wing lives or dies on them, so check the box as carefully as the lines.

Y-Wing is the same pattern under a different name. Some books drop the X because the pivot is the only cell that carries both outer digits. Nothing changes.

Why it works: two branches, one answer

Take the pivot. It holds {x,y}, so it is one or the other. There is no third case, and that is the entire argument.

Branch one: the pivot is x. Then the wing holding {x,z} cannot be x, because the pivot sees it. So that wing is z.

Branch two: the pivot is y. Then the wing holding {y,z} cannot be y. So that wing is z.

Either way, one of the two wings is z. You do not know which one, and it does not matter. Any cell that sees both wings is looking at a z it cannot also hold, so z comes out of it.

Notice what the pattern does not tell you. It never places the pivot. It never places either wing. It removes one digit from cells that are not part of the pattern at all, which is why people learn the shape, apply it correctly, and then wonder what they gained. What you gained is one candidate gone from somewhere the rest of the grid was leaning on.

A worked XY-Wing

This grid starts with 26 givens.

75.4...2.
..2......
.1...8..9
.3...2...
9.4....7.
.67..5...
....2.3..
.8.3...4.
..5719..8

Thirty cells go in on singles alone, and then nothing.

75.491.2.
.925.7...
41.2.8759
53..72...
924.8357.
.67.45.32
.7.8243.5
28.356.47
345719268

Twenty-five cells still empty. I checked this position against everything below the wings: no naked or hidden single, no naked or hidden subset that removes anything, no pointing pair, no box-line reduction, no X-Wing on any digit. The grid has genuinely stopped.

List the bivalue cells

Pencil-mark the whole grid, then throw away every cell with three or more marks. Sixteen cells survive, and grouping them by their pair is the search.

PairCells
{1,6}r5c4, r5c9, r7c1
{1,8}r2c8, r4c3, r6c1
{1,9}r6c4, r7c8, r8c3, r8c7
{3,6}r1c9, r2c5, r3c3, r3c5
{6,8}r1c7, r2c1

Now look at the pairs, not the cells. An XY-Wing needs three pairs that close a triangle over three digits: {1,6}, {1,8} and {6,8} do that on the digits 1, 6 and 8. Nothing else here does. {1,9} would need a {6,9} or an {8,9} to close, and there is neither. {3,6} would need a {3,8} or a {1,3}.

One triangle in the whole grid. The search is now three short lists.

Find the sight lines

Any of the three pairs can be the pivot. The pivot is whichever cell sees the other two, so try them.

r1c7 holds {6,8} and looks promising until you check it. It sees r2c8 in box 3, and it sees nothing at all in the {1,6} list. Not a pivot.

r2c1 holds {6,8} and does better. It sees r7c1 down column 1, and it sees r2c8 along row 2. Both wings, one pivot.

RoleCellCandidatesShares with the pivot
Pivotr2c1{6,8}
Wingr7c1{1,6}Column 1
Wingr2c8{1,8}Row 2

Read it as the two branches. If r2c1 is 6, then r7c1 cannot be 6 and is therefore 1. If r2c1 is 8, then r2c8 cannot be 8 and is therefore 1. One of r7c1 and r2c8 is a 1.

Cash it in

Which cells see both wings? r7c1 rules row 7, column 1 and box 7. r2c8 rules row 2, column 8 and box 3. The overlap is row 7 crossing column 8, which is the single cell r7c8.

The pivot sits in that overlap too. It always does, and it is never a target, because it holds x and y rather than z.

r7c8 is {1,9}. Strike the 1 and it is a 9.

Place the 9 and box 9 has one home left for its 1, at r8c7. Two placements out of a pattern that placed nothing itself, and the grid moves again. It is not finished from there: a naked pair on {1,8} in row 4 is the next thing it wants. But it is moving, and a minute ago it was not.

The three wings in the same grid that pay nothing

That triangle of pairs produced four valid XY-Wings, not one. The other three all live inside column 1.

Look at r2c1, r6c1 and r7c1. Their candidates are {6,8}, {1,8} and {1,6}. Take any one as the pivot and the other two are legal wings. The logic is sound every time and the eliminations are always empty, because the cells that see both wings are the rest of column 1 and there are none left.

There is a shorter name for three cells in one unit holding three digits between them. It is a naked triple, and it removes 1, 6 and 8 from everything else in that unit. Same three cells, plainer reading. If your wing has all three cells in one row, column or box, you found a triple and took the scenic route.

The working wing was the one whose cells sat in three different boxes.

The same pattern, with a box doing the work

People hunt XY-Wings as rectangles because the first one they meet is drawn like one. Sight lines through a box count just as much, and those are the wings that get walked past. Here is a grid, again worked to a stall by singles, and again carrying nothing below the wings.

49.71..68
128546793
6.798....
879251634
36.8749..
2.4369.87
986427315
7..1958.6
5..638.79

Nineteen empty cells, seventeen of them bivalue.

PairCells
{1,2}r3c9, r5c9, r9c3
{1,5}r5c3, r6c2, r6c7
{2,3}r1c6, r3c6, r8c3
{2,5}r1c7, r5c8
{3,5}r1c3, r3c2
{2,4}r8c8, r9c7
{3,4}r8c2
{1,4}r9c2

Triangles first. There are four of them here.

DigitsThe three pairs that close it
1, 2, 5{1,2}, {1,5}, {2,5}
1, 2, 4{1,2}, {1,4}, {2,4}
2, 3, 5{2,3}, {2,5}, {3,5}
2, 3, 4{2,3}, {2,4}, {3,4}

Four is more than most grids offer, and it is still a short job. Nearly all of the combinations die on sight lines in a second or two. Work down the list.

The first row pays. Pivot r1c7, holding {2,5}.

RoleCellCandidatesShares with the pivot
Pivotr1c7{2,5}
Wingr3c9{1,2}Box 3
Wingr6c7{1,5}Column 7

No rectangle anywhere. The pivot reaches its first wing diagonally, through box 3, and its second straight down column 7. If r1c7 is 2 then r3c9 is 1; if r1c7 is 5 then r6c7 is 1. One of them is a 1.

Now the cells that see both wings. r3c9 covers row 3, column 9 and box 3. r6c7 covers row 6, column 7 and box 6. Two cells sit in both nets:

CellSees r3c9 bySees r6c7 byBeforeAfter
r3c7Row 3Column 7{1,2,4,5}{2,4,5}
r5c9Column 9Box 6{1,2}{2}

r5c9 is a 2. From that placement the puzzle finishes on singles alone, every remaining cell, no further technique of any kind.

The second row of that table is the one to study. r5c9 sees one wing along a column and the other through a box, and neither relationship draws a straight line on the page. Sight lines are a rule about peers. They are not a shape.

How to hunt one

Do the cheap work first. Every digit you place rewrites the bivalue list, so a list built before the grid has genuinely stopped is a list you get to build twice.

  1. Get to a real stall: singles, naked and hidden subsets, pointing pairs and box-line reduction.
  2. Fill the candidates properly. This technique reads two-mark cells, so a cell you never marked is a cell you cannot use, and a stale mark invents wings that are not there.
  3. Write down every cell with exactly two candidates, grouped by its pair, as in the tables above.
  4. Look for three pairs that close a triangle over three digits. This is the step that does the work, and plenty of grids offer none, at which point you are finished in under a minute.
  5. For each triangle, ask whether one of the three cells sees the other two. That cell is the pivot, if it exists.
  6. Take the digit the two wings share. Cross it out of every cell that sees both wings.

Step 4 is worth doing on paper the first few times. Written in a column, the pairs sort themselves and the triangles jump out. It becomes a look rather than a search after about five puzzles.

I built Sudoku Master, and the part of this it touches is the list, not the pattern. Place a digit and the app strips that candidate out of the peers, which is the difference between a bivalue list you can trust and one that quietly lies to you, and tapping a cell lights its row, column and box, which is the sight-line test done by eye. Ask its solver for help and you get a finished grid off a backtracking search. No pivot, no wing, no explanation.

Four things that look like an XY-Wing and are not

A pivot that only sees one wing. r1c7 in the first grid held exactly the right digits, {6,8}, with a {1,6} cell and a {1,8} cell available. It saw one of them. The pattern needs both, and there is no partial credit.

Three cells holding four digits. {2,5}, {1,2} and {1,7} looks like a wing until you count. The digits have to be three: the pivot's two, plus one shared by both wings. Four digits means the second branch of the proof has nothing to land on.

A cell with three candidates. All three cells must be bivalue. A pivot with three marks is a different pattern, the XYZ-Wing, and the eliminations are narrower. See below.

A wing built on stale marks. This pattern reads your notes rather than the board, which makes it the least forgiving one on the ladder. A cell holding three real candidates looks bivalue the moment you forget to rub one out, and it will sit in your list looking exactly like a wing. Clean pencil marks matter more here than anywhere below this rung.

XY-Wing against X-Wing

The names are one letter apart and the techniques share nothing but the ladder rung. The two get mixed up constantly, so it is worth pinning down.

X-WingXY-Wing
What you look atOne digit, grid-wideThree digits, in three cells
Cells involvedFour, at the corners of a rectangleThree, in no fixed shape
What each cell needsNothing. Other candidates are ignoredExactly two candidates each
The marks you needOne digit mapped across nine rowsFull candidates, at least for the bivalue hunt
What it removesThe digit, from two whole linesOne digit, from cells seeing both wings
Typical yieldTwo to four candidatesOne or two candidates

Different searches, so run them at different moments. The X-Wing scan is cheap when a digit is already placed six or seven times, because the map is short. The XY-Wing scan is cheap when the grid is covered in two-mark cells, which is what a stalled hard puzzle tends to look like. Read the grid and pick the one it is offering you.

The relatives worth knowing

XYZ-Wing. The pivot carries three candidates, {x,y,z}, and the wings carry {x,z} and {y,z} as before. Now z can sit in the pivot as well, so the eliminations shrink: a target has to see all three cells, not just the two wings. In the usual layout that leaves a handful of cells where the pivot's box crosses the line running out to the far wing.

W-Wing. Two cells with the identical pair {x,y}, not seeing each other, joined by a unit where x has only two homes and those homes see one cell each. Then y comes out of everything seeing both. Different plumbing, same flavour of argument.

Both are steps toward chains, which is where this style of reasoning ends up. An XY-Wing is a three-link chain with the loop closed by hand, and once you have seen the branch argument twice it generalises without much ceremony. The advanced techniques that sit above this rung are mostly longer versions of the same two sentences.

One last honest note on how often you need it. Plenty of puzzles graded hard never present a usable wing, because the cheaper patterns keep reaching the target cell first. And the number of givens will not warn you either way. A generously clued grid can still be the one that has you writing out pairs, because the grade tracks the hardest move, not the emptiest board.

Questions people ask

Is a Y-Wing the same as an XY-Wing?

Yes. They are two names for one pattern and you will meet both, sometimes on the same site. The short name comes from the shape of the three cells joined by their sight lines, the long name from the pivot's two candidates. Nothing about the logic or the eliminations differs.

Why did my XY-Wing not remove anything?

Because no cell sees both wings, which is common and is not a mistake. The usual cause is all three cells sitting in one row, column or box, and that configuration is a naked triple wearing a hat. Check the overlap before you go looking for the pattern: if the wings share a unit with the pivot, there is nowhere for the elimination to land.

Do I need to fill in every candidate first?

For this technique, close to it. You are hunting cells with exactly two marks, and you cannot know a cell has two unless you worked out all of them. You can narrow the job by marking only the cells with few obvious candidates, but a half marked grid produces confident wings that are not real.

Can an XY-Wing eliminate more than one candidate?

Yes, and the second grid above does exactly that: two cells lose their 1. The count is however many cells see both wings and still hold z. One is normal, two is a good day, and more than that means the wings were unusually well placed.

What is an XYZ-Wing?

The same shape with a three-candidate pivot, {x,y,z} instead of {x,y}. Since the pivot can also be z, a target now has to see the pivot as well as both wings, so there are fewer of them and they cluster where the pivot's box meets the line to the far wing. Learn the plain version until it is automatic and this one costs you an evening.

Where does the XY-Wing sit against Swordfish?

On the same rung, roughly, and above X-Wing. Which of the two you find first depends on the grid rather than on difficulty: Swordfish wants one digit with tidy homes across three lines, an XY-Wing wants a crowd of two-mark cells. Try whichever the grid is showing you.

Can the pivot see the wings through a box rather than a line?

Yes, and half the wings on a real grid work that way. The second worked example above reaches one wing through box 3 and the other down column 7. A cell's peers are its row, its column and its box, and the pattern never distinguishes between them. Hunting only for rectangles is how solvers miss most of them.

Does an XY-Wing ever place a digit by itself?

No. It only crosses candidates out. What happens next is that one of those cells drops to a single candidate and becomes a placement, which is what happened in both grids here. If you want the pattern to feel worth the effort, check whether a target cell is already down to two marks before you work the sight lines.

Keep reading

Get it: Sudoku Master, free on iPhone and Android. The link sends you to whichever store your phone uses.

More writing

Keep reading