Sudoku technique · Hard
X-Wing, Swordfish and XY-Wing in Sudoku
X-Wing, Swordfish and XY-Wing are the three Sudoku techniques that make a PencilGrid grid Hard. An X-Wing is one digit confined to the same two columns in two rows. A Swordfish is the same pattern over three lines, and an XY-Wing is a chain of three two-candidate cells; every Hard grid needs at least one of them.
Published · Updated
X-Wing: a rectangle of candidates
Choose a digit. Find two rows in which that digit has exactly two candidate cells, and check whether those cells fall in the same two columns. If they do, the four cells form a rectangle. The digit must occupy two opposite corners, one per row, which means it also takes one cell in each of the two columns, so every other candidate for the digit in those two columns can be erased. Read with columns as the base, the same rectangle clears the two rows instead.
Worked Example: an X-Wing on the 9s
The daily from 16 August 2026 is puzzle 15, a Hard grid with 22 givens. After thirty-seven steps of singles the solver stalls with 59 cells filled. In row 6 the digit 9 fits only columns 4 and 8; in row 7 it also fits only columns 4 and 8. Whichever diagonal the two 9s take, columns 4 and 8 each receive one of them from these rows.
So 9 is erased from the rest of both columns: row 5, column 4 drops from 4, 6, 9 to 4 and 6, and row 8, column 8 drops from 1, 4, 9 to 1 and 4. Neither cell is solved yet, but the first of them has just become a two-candidate cell, which is exactly what the next technique needs.
XY-Wing: a chain of three two-candidate cells
An XY-Wing uses three cells that each have exactly two candidates. The pivot holds X and Y. One pincer, which shares a unit with the pivot, holds X and Z; the other pincer, also sharing a unit with the pivot, holds Y and Z. Whatever the pivot turns out to be, one of the pincers must be Z, so any cell that sees both pincers cannot be Z. To find one, list every two-candidate cell, pick a pivot, and look for two others in its row, column or box that overlap it on different digits and share a third digit with each other.
Worked Example: the XY-Wing one step later
On the same grid the X-Wing left row 5, column 4 with 4 and 6, and that cell is the pivot. Row 5, column 5 holds 6 and 9 and shares the pivot's row and box; row 7, column 4 holds 4 and 9 and shares its column. If the pivot is 4, the row pincer is 9; if the pivot is 6, the column pincer is 9. One of the two pincers is a 9 either way.
Two cells see both pincers and still carry a 9: row 6, column 4, which shares the column with one pincer and the centre box with the other, and row 8, column 5, which shares a column with one and the bottom-centre box with the other. Both lose their 9; row 8, column 5 had only 3 and 9, so it becomes 3, and singles finish the puzzle from there.
Swordfish: the three-line X-Wing
A Swordfish uses three lines instead of two. In each of the three lines the digit's candidates must fall within the same three crossing lines, and a line may use only two of them. The digit then occupies exactly one cell in each of those three crossing lines, so it can be removed from every other cell of theirs.
The daily from 2 August 2026, puzzle 1, needs one. With 62 cells filled, the digit 8 appears in column 2 only at rows 1 and 6, in column 4 only at rows 1 and 2, and in column 9 only at rows 1, 2 and 6. Three columns, three rows, so the 8s of rows 1, 2 and 6 are all inside those columns, and the 8 in row 1, column 1 is erased. That cell drops to 4 and 7 and becomes the pivot of an XY-Wing on the very next step, the pattern that makes puzzle 1 Hard.
How often Hard dailies need each one
The grader puts all three in the Hard band, so a Sunday daily may need any of them. X-Wings and XY-Wings are the common ones: the daily of 30 August 2026, puzzle 29, is Hard because of an X-Wing on the digit 6 and needs nothing harder, while puzzle 15 above needs an X-Wing and an XY-Wing in succession. Swordfish are rarer and tend to appear, as on puzzle 1, as a short bridge to an XY-Wing. When the singles and pairs run dry on a Hard grid, press Hint: it names the technique and marks the pattern cells and the cells that lose a candidate, and seeing a few drawn on real grids teaches the shapes faster than any description.
Common Mistakes
Building an X-Wing from rows that have three candidate cells for the digit. Each base line must have exactly two, or the rectangle is not forced.
Eliminating from the base lines instead of the cover lines. A row-based X-Wing clears the two columns; the rows keep their candidates.
Choosing XY-Wing pincers that overlap the pivot on the same digit. The pincers must take different digits from the pivot and share a third digit, Z, with each other.
Frequently Asked Questions
What makes a Sudoku Hard on PencilGrid?
Needing an X-Wing, a Swordfish or an XY-Wing at least once. The solver grades every grid by the hardest technique it uses, so a puzzle that singles, pairs and box-line eliminations can finish is Medium at most.
Is a Swordfish just a bigger X-Wing?
Yes. An X-Wing uses two base lines and two cover lines; a Swordfish uses three of each, and a base line may hold the digit in only two of the three cover lines. The elimination is the same: the digit leaves the cover lines outside the pattern.
Do XY-Wings need pencil marks?
Yes. The pattern is built from cells with exactly two candidates, which only notes make visible. On the 16 August 2026 daily the pivot itself was created by the X-Wing one step earlier.
Sources
- Nikoli: Sudoku: the rules every elimination here rests on: each row, column and 3×3 block holds 1 to 9
- How PencilGrid puzzles are made: X-Wing, Swordfish and XY-Wing are the whole Hard band of the ladder
- Daily Sudoku archive: the dated dailies the worked examples come from
Sources last checked on 2026-11-10.
Written and checked by the maker of PencilGrid, a puzzle enthusiast and software engineer who also builds the generator and solver behind every grid on the site.
Every technique on this page is one the site's solver actually uses: puzzles are generated offline, checked for a single solution, and graded by the hardest step they need. How PencilGrid puzzles are made →
More Sudoku Pages
Related puzzles: Sudoku X · Killer Sudoku · Futoshiki
Keep Learning
Pointing Pairs and Box-Line Reduction
Exhaust these intersections before hunting for fish.
Naked Pairs and Hidden Pairs
Two-candidate cells are the raw material for XY-Wings.
How to Play Sudoku
Rules, notation and the full technique ladder.
X-Wing in Futoshiki
The same rectangle in a grid with inequality signs.