Skip to content
poozee

Strategy Guides

XY-Wing Sudoku Explained: How to Find One, With Real Examples

How the Sudoku XY-Wing (also called Y-Wing) works, how to find one in your two-candidate cells, and how often it helps, measured on 10,000 Expert puzzles.

By Poozee EditorsUpdated 9 min read

An XY-Wing (also called a Y-Wing) is three cells with exactly two pencil marks each: a pivot {x,y} and two pincers it can see, one {x,z} and one {y,z}. Whichever digit the pivot takes, one of the pincers must be z, so you can erase z from every cell that sees both pincers. You find one by scanning the cells that have only two pencil marks, and of the four advanced techniques we measured on Expert puzzles, it's the one that most often gets a stuck grid moving again.

Below are two XY-Wings from real puzzles made by Poozee's Sudoku generator, one with a pincer in the pivot's box and one spread over three boxes, a step list for finding them, and what we measured on 10,000 Expert puzzles: how many two-mark cells you have to work with, which ones make good pivots, where the erased marks land, and how far XY-Wings get you. Every diagram and number on this page is checked by code against the game's engine. This is the follow-up to our Sudoku X-Wing guide; if pairs, pointing and claiming are new to you, start with our Sudoku strategies guide.

Why an XY-Wing works

Take the first example below. The pivot r1c6 has only {5,6}. It sees r2c4 {5,8} (same box) and r4c6 {6,8} (same column).

  • If r1c6 is 5, then r2c4 can't be 5, so r2c4 is 8.
  • If r1c6 is 6, then r4c6 can't be 6, so r4c6 is 8.

The pivot has to be 5 or 6, so at least one of the two pincers is an 8. You don't know which, and you don't need to: a cell that sees both pincers would clash with whichever one is the 8, so it can't be an 8 itself.

In general the pivot's two digits are x and y (here 5 and 6), each pincer shares one of them with the pivot, and the two pincers share a third digit, z (here 8). An XY-Wing only ever erases z, and only from cells that see both pincers. Seeing the pivot doesn't matter.

How to read the diagrams

Rows are numbered 1 to 9 from the top and columns 1 to 9 from the left, so r1c6 is row 1, column 6. Black digits (white in dark mode) are clues and blue digits were placed earlier with singles, pairs, pointing and claiming. Each diagram is the exact spot where those techniques got stuck.

The small digits are pencil marks, the ones left after pairs, pointing and claiming erased everything they could. To keep the grid readable, they're shown only where an XY-Wing hunt looks: every cell with exactly two pencil marks, and every cell that sees both pincers. The yellow cell is the pivot, the green cells are the pincers (with z ringed), and the red cells are where z gets erased (crossed out).

Example 1: a pincer in the pivot's box

This Expert puzzle starts with 26 clues. Singles, pairs, pointing and claiming fill 27 cells and then stall, with 28 empty cells left, 20 of them with exactly two pencil marks. Here's the XY-Wing:

  • The pivot is r1c6 {5,6}.
  • One pincer is r2c4 {5,8}, in the pivot's box (box 2). It shares the 5.
  • The other is r4c6 {6,8}, in the pivot's column. It shares the 6.

So z is 8. Two cells see both pincers and still have an 8: r2c6 (in box 2 with r2c4, and in column 6 with r4c6) and r4c4 (in column 4 with r2c4, and in box 5 with r4c6). The 8 comes out of r2c6 and r4c4.

112233445566778899798216563534364581958921571524378696954677826893123194898671342825679137346793421854135785967269
An XY-Wing with its pivot in r1c6: r2c4 or r4c6 must be the 8, so 8 leaves r2c6 and r4c4.

r4c4 had only {7,8}, so it's now a 7: a naked single. The other 27 empty cells then fall to singles, pairs, pointing and claiming, with no other advanced step.

Look at where the two erased cells are. One is in the pivot's box, the other in the far pincer's box. That holds for every XY-Wing of this shape: the cells that can lose z are the ones in the pivot's box along the far pincer's line (here r2c6, in column 6), and the ones in the far pincer's box lined up with the near pincer (here r4c4, in column 4). Check both spots.

Example 2: three different boxes

Another Expert puzzle, with 23 clues. The same techniques fill 28 cells and stall, with 30 empty cells left, 14 of them with two pencil marks.

  • The pivot is r2c2 {2,6}, in box 1.
  • One pincer is r2c4 {1,2}, in the pivot's row (box 2). It shares the 2.
  • The other is r5c2 {1,6}, in the pivot's column (box 4). It shares the 6.

So z is 1. These pincers share no row, column or box, so only one cell sees both: r5c4, the fourth corner of the rectangle the three cells make. It had {1,5}, so once the 1 goes it's a 5.

1122334455667788997932612957159374891235473863516715943828426726351965193782428965437173481212965
An XY-Wing over three boxes with its pivot in r2c2: r2c4 or r5c2 must be the 1, so 1 leaves r5c4.

The other 29 empty cells then fall to the basic techniques alone.

When one pincer is in the pivot's row and the other in its column, both outside the pivot's box, the three cells are in three different boxes, and the fourth corner is the only cell that can lose z. Every one of the 540 XY-Wings of this shape we found erased exactly one pencil mark. That makes it the quickest kind to check: one cell.

This grid also shows a trap. r4c2 {1,2} sees the pivot too (column 2), so pivot r2c2 with pincers r4c2 {1,2} and r5c2 {1,6} is also an XY-Wing on 1. But the cells that see both of those pincers are the rest of column 2 and box 4, and none of them has a 1, so it erases nothing. Most patterns you find will be like that.

How to find an XY-Wing, step by step

  1. Get the pencil marks right first. Every step below reads them, so fill in every empty cell and apply your pairs, pointing and claiming. One stale mark can hide a real XY-Wing or invent a fake one.
  2. Find the cells with exactly two pencil marks. These are your only candidates for the pivot and the pincers. On the stuck Expert grids we measured there were 16.2 on average, out of 37.4 empty cells.
  3. Count each one's partners. A partner is a two-mark cell it can see (same row, column or box) that shares exactly one digit with it. A pivot needs two partners that share different digits with it, so a cell with fewer than two partners can't be a pivot. That rules out 46.9% of two-mark cells straight away.
  4. Match the third digits. For a pivot {x,y} with partners {x,z} and {y,w}, it's an XY-Wing only if z and w are the same digit.
  5. Look at the cells that see both pincers. If one of them still has z, erase it. If none does, the pattern is real but useless, so move on.
  6. Go back to singles. An erased mark often leaves a naked or hidden single.

Which two-mark cells should you try as the pivot first? The ones with the most partners. Here is how often a two-mark cell was a useful pivot (the pivot of an XY-Wing that erased something), by its number of partners:

Partners Two-mark cells Useful pivots
0 or 1 76,026 0 (0.0%)
2 45,988 462 (1.0%)
3 25,231 1,119 (4.4%)
4 or more 15,016 1,554 (10.3%)

A two-mark cell with four or more partners was about ten times as likely to be a useful pivot as one with exactly two.

Pro tip: Do step 5 before you celebrate. The stuck grids had 4.0 XY-Wing patterns each on average, but only 8.0% of those patterns had a cell to erase from. The trap in Example 2 is the usual case, not the exception.

When an XY-Wing helps: what we measured

We generated 10,000 Expert puzzles with Poozee's generator (seeds 1 to 10,000, the same puzzles as in our X-Wing guide), solved each with the techniques the game uses to grade it (singles, then naked and hidden pairs, pointing and claiming), and looked for XY-Wings at the exact spot where those techniques got stuck. Every Expert puzzle got stuck somewhere, which is what makes it Expert.

At the stuck spot of 10,000 Expert puzzles Puzzles Share
An XY-Wing that erases at least one pencil mark 2,126 21.3%
An XY-Wing that leads straight to a new digit 1,493 14.9%
XY-Wings are the only advanced step needed to finish 1,024 10.2%

So about 1 in 5 stuck Expert grids had an XY-Wing that erased something. We found 3,254 of them at those stuck spots (some grids had more than one), and 2,234 (68.7%) led to a new digit on their own. Most erase just one or two pencil marks, 1.5 on average:

Pencil marks erased XY-Wings Share
1 1,882 57.8%
2 1,069 32.9%
3 247 7.6%
4 or more 56 1.7%

How the three cells sat made a big difference:

Shape Found Share Leads straight to a new digit
One pincer in the pivot's box (Example 1) 2,363 72.6% 79.1%
Three different boxes (Example 2) 540 16.6% 61.1%
All three cells in one row, column or box 351 10.8% 9.7%

The last shape is rarely worth your time. Three two-mark cells in one row, column or box that hold only three digits between them are also a naked triple, which erases those digits from the rest of that row, column or box.

Don't hunt for the erased cells only around the pivot, either. Of the 5,002 pencil marks the XY-Wings erased, only 29.2% were in the pivot's box. The erasing happens where the pincers' rows, columns and boxes cross.

XY-Wing vs X-Wing

Both are the next step after pairs, pointing and claiming, but you look for them differently. An X-Wing follows one digit through rows and columns; an XY-Wing follows the cells with two pencil marks. Measured at the same stuck spots of the same 10,000 Expert puzzles:

X-Wing XY-Wing
What you scan One digit's spots in each row and column Cells with two pencil marks
Available at the stuck spot 8.1% 21.3%
Leads straight to a new digit 1.6% 14.9%
Share of those found that lead to a new digit 20.7% 68.7%
Pencil marks erased, on average 3.1 1.5
Only advanced step needed to finish 0.4% 10.2%

An X-Wing erases more marks, but an XY-Wing far more often erases the one that matters. Adding X-Wings to XY-Wings raises the share of Expert puzzles finished from 10.2% to 11.4%, and adding Swordfish and triples as well takes it to 12.6%. Most of what these four techniques can do, the XY-Wing does alone. The rest of the Expert puzzles need techniques beyond these four.

Common XY-Wing mistakes

  • Two pincers sharing the same digit with the pivot. In Example 2, r2c4 {1,2} and r4c2 {1,2} both see the pivot r2c2 {2,6}, but both share its 2. One pincer must share x and the other y.
  • A pincer with three pencil marks. All three cells need exactly two. {1,2,6} in the pincer's place proves nothing.
  • Erasing from a cell that sees only one pincer. A cell that sees the pivot and only one pincer can still be z. It has to see both pincers.
  • Erasing x or y. An XY-Wing erases only z, the digit the two pincers share.

Keep playing

Start an Expert Sudoku, switch on Notes (or press N) once singles run dry, and run the step list above on your two-mark cells, busiest first. If you haven't tried X-Wings yet, our Sudoku X-Wing guide has the step list for those, and our Swordfish guide takes the same idea to three rows. If Expert stalls you before you even get to pencil marks, how to solve Sudoku for beginners covers the singles that come first, and the patterns in our Minesweeper patterns guide reward the same habit of reading a few cells together.

Frequently asked questions

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

Yes. XY-Wing and Y-Wing are two names for the same three-cell pattern: a pivot with two pencil marks and two pincers that each share one of them, with the pincers' common digit erased from every cell that sees both.

Can a pincer be in the same box as the pivot?

Yes, and that is the most common kind. Of the 3,254 XY-Wings we found on stuck Expert grids, 2,363 (72.6%) had one pincer in the pivot's box and the other in its row or column.

Why doesn't my XY-Wing erase anything?

Most XY-Wing patterns don't. Only 8.0% of the patterns we found on stuck Expert grids had a cell that sees both pincers and still has their shared digit. Check that cell before you get excited, and check your pencil marks too.

Should I look for an X-Wing or an XY-Wing first?

A quick X-Wing check on the digits with the fewest marks is fine, but if you only learn one, learn the XY-Wing. On Poozee's Expert puzzles it got a stuck grid moving in 14.9% of cases, against 1.6% for the X-Wing.