XY Wing Sudoku: The Technique, Explained Properly
The XY wing sudoku technique uses three cells that each have exactly two candidates: a "pivot" holding {X,Y}, and two "pincers" holding {X,Z} and {Y,Z}, where each pincer shares a row, column, or box with the pivot. Because one of the two pincers must end up being Z, any cell that sees both pincers cannot contain Z.
That's the whole thing. Three cells, six candidate digits, one elimination rule. It's usually the first technique a solver learns that isn't a visual shape — you can't spot an XY-Wing by squinting at the grid the way you can spot an X-Wing rectangle. You find it by checking bi-value cells against each other, which is a different habit entirely.
This guide gives you the structure, the proof of why it works, three fully worked examples with real grid coordinates, a search procedure that takes about two minutes per grid, and the near-miss patterns that look like XY-Wings but aren't.
The structure, in precise terms
An XY-Wing has exactly three components. Every one of these conditions must hold.
| Component | Candidates | Requirement |
|---|---|---|
| Pivot | Exactly {X, Y} | Must see both pincers |
| Pincer A | Exactly {X, Z} | Must see the pivot |
| Pincer B | Exactly {Y, Z} | Must see the pivot |
| Target | Any cell containing Z | Must see both pincers |
Two pieces of vocabulary:
- "Sees" means shares a row, a column, or a 3×3 box. Two cells see each other if placing a digit in one would remove it as a candidate from the other.
- Bi-value cell means a cell with exactly two candidates remaining. All three XY-Wing cells must be bi-value — three candidates is disqualifying.
Notice the digit pattern. Across the three cells you have exactly three distinct digits, X, Y and Z, and each digit appears in exactly two of the cells. The pivot is the only cell without Z. The pincers are the only pair that don't see each other (usually — they may, but that's a different situation covered below).
The two pincers do not need to see each other. That's the most common misunderstanding. They only need to see the pivot.
Why it works
Here's the proof, and it's short enough to hold in your head.
The pivot has exactly two candidates, X and Y. One of them is true. There is no third option.
Case 1: the pivot is X. Pincer A holds {X,Z} and sees the pivot, so it loses its X. Pincer A must be Z.
Case 2: the pivot is Y. Pincer B holds {Y,Z} and sees the pivot, so it loses its Y. Pincer B must be Z.
In every possible world, at least one pincer is Z. So any cell that sees both pincers is seeing a Z no matter how the puzzle resolves — and therefore cannot be Z itself.
What makes this elegant is that you never learn which pincer is the Z. You don't need to. The elimination holds under both branches, which is exactly what makes it a legitimate logical deduction rather than a guess.
Worked example 1: the classic rectangle
The most common XY-Wing configuration puts the three cells at three corners of a rectangle, with the target at the fourth corner.
Suppose your candidate grid contains these bi-value cells:
- R2C2 =
{4, 7}— the pivot - R2C8 =
{4, 9}— pincer A, shares row 2 with the pivot - R5C2 =
{7, 9}— pincer B, shares column 2 with the pivot
Map it to the template: X = 4, Y = 7, Z = 9.
``` C1 C2 C3 C4 C5 C6 C7 C8 C9 R1 | | | | | | | | | | R2 | | 47 | | | | | | 49 | | <- pivot ... pincer A R3 | | | | | | | | | |
|------------+-------------+------------|
R4 | | | | | | | | | | R5 | | 79 | | | | | | ?? | | <- pincer B ... TARGET R6 | | | | | | | | | | ```
Run the cases. If R2C2 = 4, then R2C8 loses its 4 (same row) and becomes 9. If R2C2 = 7, then R5C2 loses its 7 (same column) and becomes 9. One of R2C8 and R5C2 is a 9.
Find the targets. Which cells see both pincers? R5C8 sees R5C2 along row 5, and sees R2C8 down column 8. It qualifies.
The elimination: R5C8 cannot be 9. Erase it.
If R5C8 had candidates {2, 6, 9}, it's now {2, 6} — a new bi-value cell that may well feed the next deduction. If it had {6, 9}, it's now a naked single: R5C8 = 6, and the grid starts moving.
Worked example 2: when boxes widen the payoff
The rectangle version is the easiest to see, and it's also the stingiest. Once a pincer's box starts overlapping the other pincer's line, the same wing pays several times over — and this is where most solvers stop counting too early.
- R4C4 =
{2, 6}— the pivot - R4C6 =
{6, 8}— pincer A, shares row 4 with the pivot (and also box 5) - R9C4 =
{2, 8}— pincer B, shares column 4 with the pivot
X = 2, Y = 6, Z = 8.
If R4C4 = 2, then R9C4 loses its 2 and becomes 8. If R4C4 = 6, then R4C6 loses its 6 and becomes 8. One of them is 8.
Now map every cell that sees both R4C6 and R9C4. This is where people stop too early, so work it methodically:
| Target | Sees R4C6 via | Sees R9C4 via |
|---|---|---|
| R5C4 | box 5 | column 4 |
| R6C4 | box 5 | column 4 |
| R7C6 | column 6 | box 8 |
| R8C6 | column 6 | box 8 |
| R9C6 | column 6 | row 9 and box 8 |
Five cells lose their 8, not one. The obvious target is R9C6 at the rectangle's fourth corner — but pincer B sits in box 8, which drags R7C6 and R8C6 in through column 6, and pincer A sits in box 5, which drags R5C4 and R6C4 in through column 4.
This is the single most common way solvers leave value on the table: they spot the wing, take the corner elimination, and move on. Boxes are units too. Check them.
Worked example 3: a pivot that sees a pincer through a box
The pivot doesn't have to share a line with its pincers. A shared box counts, and these are the XY-Wings that hide best, because there's no visual row or column to draw your eye along.
- Pivot: R5C5 =
{1, 5} - Pincer A: R5C2 =
{5, 8}— shares row 5 with the pivot - Pincer B: R4C4 =
{1, 8}— shares only box 5 with the pivot; different row, different column
X = 5, Y = 1, Z = 8. If R5C5 = 5, then R5C2 loses its 5 and becomes 8. If R5C5 = 1, then R4C4 loses its 1 and becomes 8. One of the pincers is an 8.
The full target set:
| Target | Sees R5C2 via | Sees R4C4 via |
|---|---|---|
| R4C1 | box 4 | row 4 |
| R4C2 | column 2 | row 4 |
| R4C3 | box 4 | row 4 |
| R5C4 | row 5 | box 5 and column 4 |
| R5C6 | row 5 | box 5 |
All five lose their 8. Note that the three targets in row 4 have nothing to do with the pivot — they qualify because pincer A's box (box 4) covers R4C1 through R4C3, and pincer B's row covers all of row 4.
That's the takeaway from these three examples: the pivot's geometry determines whether an XY-Wing exists, but the pincers' geometry determines how much it's worth. A wing whose pincers sit in different bands and stacks can be worth five eliminations; the tidy rectangle in example 1 was worth one.
How much is a given wing worth?
| Pincer arrangement | Typical eliminations |
|---|---|
| Both pincers in line with the target corner only | 1 |
| One pincer's box crosses the other pincer's line | 3–5 |
| Both pincers' boxes cross the other's line | 5–6 |
Worth a glance before you commit to tracing the intersection — but trace it anyway when the wing is valid. Even one elimination can be the one that restarts the grid.
How to find an XY wing sudoku pattern without wasting an hour
XY-Wings don't announce themselves. Here's a search that's systematic rather than hopeful.
- Complete your candidate grid first. Every empty cell, checked against row, column, and box. An XY-Wing found in a grid with stale pencil marks is not an XY-Wing, and acting on it will destroy the puzzle.
- Circle every bi-value cell. On a stalled expert grid there are usually somewhere between eight and twenty. This is your entire search space — everything else is irrelevant.
- Take each bi-value cell as a candidate pivot. List the bi-value cells it sees. On a typical grid that's two to five cells.
- Look for a pair among them sharing exactly one digit with the pivot each, and one digit with each other. Pivot
{4,7}wants a partner containing 4-and-something and another containing 7-and-that-same-something. The shared "something" is your Z.
- Confirm the pincers don't have identical candidate lists. If both pincers read
{4,9}, you have a naked pair, not an XY-Wing.
- Find the intersection. Sketch the rows, columns, and boxes of both pincers and note every cell in both. Check each for a Z candidate.
Two shortcuts worth knowing. First, XY-Wings are far more common where bi-value cells cluster, so start in the densest region of the grid. Second, a bi-value cell that sees only one other bi-value cell can't be a pivot — skip it immediately.
When to reach for XY-Wing
XY-Wing belongs late in your sequence, not early. A sensible order on a hard or expert grid:
- Naked and hidden singles
- Naked and hidden pairs, then triples
- Pointing pairs and box/line reduction
- X-Wing
- XY-Wing
- Coloring, unique rectangle, forcing chains
The reason for the ordering is cost, not power. Steps 1 through 3 are cheap to check and pay off constantly. XY-Wing requires a complete candidate grid and a deliberate search, so it's wasted effort while simpler eliminations remain. And critically — after any XY-Wing elimination, go straight back to step 1. One removed candidate frequently cascades into half a dozen placements.
XY-Wing versus the techniques it's confused with
| Technique | Cells involved | Digits | What it eliminates |
|---|---|---|---|
| Naked pair | 2, same unit, identical lists | 2 | Both digits from the rest of that unit |
| X-Wing | 4, rectangle corners | 1 | That digit from two full lines |
| XY-Wing | 3 bi-value cells, any shape | 3 | Z from cells seeing both pincers |
| XYZ-Wing | 3 cells, pivot has 3 candidates | 3 | Z from cells seeing all three |
| W-Wing | 2 identical bi-value cells + a link | 2 | One digit from cells seeing both |
XYZ-Wing
XYZ-Wing is the near relative, and worth ten seconds of explanation because it's easy to trip over.
In an XYZ-Wing the pivot has three candidates {X,Y,Z} rather than two, with pincers {X,Z} and {Y,Z} as before. Since the pivot might itself be Z, the elimination is weaker: a target must see all three cells, not just the two pincers. In practice that means targets almost always sit in the same box as the pivot.
If you find what looks like an XY-Wing but the pivot has three candidates, you haven't found nothing — you've found an XYZ-Wing. Just tighten the target requirement.
W-Wing
A W-Wing uses two cells with the same two candidates {X,Y} that don't see each other, connected by a strong link on Y in some unit between them. It eliminates X from cells seeing both. Different structure, similar flavor — worth learning after XY-Wing is comfortable.
Near-misses that aren't XY-Wings
Four patterns that fool people. If a promised elimination breaks your grid, it was almost certainly one of these.
- A pincer with three candidates. All three cells must be strictly bi-value.
{4,9}works;{4,7,9}does not, because the case analysis collapses — that cell might be a 7, and then neither pincer is guaranteed to be Z. - A pincer that doesn't see the pivot. Both pincers must share a row, column, or box with the pivot. If pincer B is off in a distant box with no shared unit, there's no link and no deduction.
- A target that only sees one pincer. This is the most damaging error, because it looks right. The target must see both. Trace both lines with a finger before erasing anything.
- Four distinct digits across the three cells. An XY-Wing uses exactly three digits total. Pivot
{4,7}, pincers{4,9}and{7,2}gives you four digits and no shared Z — there's nothing to eliminate.
One habit that prevents all four: before erasing, write out the case analysis in one sentence. "If the pivot is 4, pincer A is 9; if the pivot is 7, pincer B is 9; the target sees both, so it isn't 9." If you can't say that sentence cleanly, you don't have an XY-Wing.
Practicing it
The XY wing sudoku technique has an awkward learning curve, because it appears in maybe one grid in three at expert level — which means you can go several puzzles without a chance to use it. Two things help.
Solve with full candidate notation even on hard puzzles that don't need it. Getting fluent at reading a candidate grid is most of the battle — the pattern-matching only becomes fast once the notation is effortless.
When you're stuck, do the bi-value sweep before anything exotic. Circle every bi-value cell, then check each as a pivot. Even when there's no XY-Wing present, the sweep frequently surfaces a naked pair or a hidden pair you'd walked past.
For grid volume, our free puzzle maker produces unlimited classic 9×9 sudoku at easy, medium, and hard, printable one to six per page with an answer key, and every puzzle is verified to have exactly one solution. That last part matters more than it sounds for this technique: XY-Wing's case analysis assumes the puzzle is logically consistent, and a grid with two valid answers can produce deductions that contradict each other.
Frequently asked questions
What is an XY-Wing in sudoku?
An XY-Wing is a solving technique using three cells that each have exactly two candidates. A pivot cell holds candidates X and Y; two pincer cells hold {X,Z} and {Y,Z}, and each pincer shares a row, column, or box with the pivot. Since the pivot must be either X or Y, one of the two pincers is forced to be Z. Therefore any cell that sees both pincers cannot contain Z, and that candidate can be erased.
Do the two pincers in an XY-Wing need to see each other?
No. This is the most common misconception about the technique. Each pincer must see the pivot, but the pincers themselves can sit in completely separate regions of the grid. In fact when the pincers do see each other you often have a simpler pattern — a naked triple or a hidden pair — that would have found the same eliminations with less work.
What's the difference between XY-Wing and XYZ-Wing?
The pivot. In an XY-Wing the pivot has exactly two candidates, {X,Y}, and the elimination applies to any cell seeing both pincers. In an XYZ-Wing the pivot has three candidates, {X,Y,Z}, meaning the pivot itself might be Z — so a target must see all three cells, not just the two pincers. XYZ-Wing is therefore more common but yields fewer eliminations, and its targets are usually confined to the pivot's box.
How often does the XY wing sudoku pattern appear in puzzles?
Roughly one expert or "evil" grid in three contains a usable XY-Wing, and it's rare below that difficulty because easier puzzles resolve through singles, subsets, and locked candidates before the necessary bi-value cells ever appear. It shows up most often in the middle-to-late stage of a hard solve, once a complete candidate grid has narrowed many cells to two options.
Can an XY-Wing eliminate more than one candidate?
Yes. The technique eliminates Z from every cell that sees both pincers, which can be one cell or several depending on geometry. When a pincer shares a box with the other pincer's row or column, the intersection widens and you may clear five or six cells at once. It's always worth mapping the full intersection rather than stopping at the first target you spot.
Is XY-Wing considered guessing?
No. It's a complete case analysis, not a trial. Because the pivot has only two possible values and the conclusion holds under both, the elimination is proved rather than tested — you never need to place a digit and check whether it works. That's precisely what distinguishes techniques like XY-Wing from brute-force trial and error, and why puzzles requiring it are still solvable by pure logic.
