X-Wing
A rectangle of four candidate cells for one digit that eliminates that digit from two crossing lines.
The X-Wing is your gateway to advanced solving. It works on a single digit at a time, so once you have your pencil marks in place, it is easier to spot than it looks.
Pick a digit and look across two rows. If, in both rows, that digit can only go in the same two columns, those four cells form a rectangle. The digit has to sit on one of the two diagonals of that rectangle — and either way, both columns end up holding the digit. That lets you erase the digit from the rest of those two columns.
The pattern is symmetric: it works just as well if you start with two columns and eliminate along the rows. The X-Wing is the smallest member of the "fish" family — Swordfish and Jellyfish are the same idea on three and four lines.
How to spot an X-Wing
Choose one digit and scan the rows. You are hunting for two rows where that digit has exactly two candidate cells each — no more — and where those candidates land in the same pair of columns in both rows.
When you find them, the four cells make a rectangle. Whichever diagonal the digit takes, both of those columns are spoken for. So the digit cannot appear anywhere else in those two columns: erase it from every other cell in them. Then do the whole scan again with rows and columns swapped.
- One digit at a time — never mix two.
- Two rows, each with exactly two candidate cells for that digit.
- The candidate columns line up across both rows.
- Eliminate the digit from those two columns in every other row.
Why the rectangle works
The four corners give you two ways to place the digit: the top-left and bottom-right pair, or the top-right and bottom-left pair. You do not know which one is correct — but you do not need to.
Either way, the digit ends up in both of those columns, once each. A column can only hold the digit once, so its quota is already filled by the rectangle. Any other candidate for that digit in those two columns is therefore impossible, and you can rub it out with confidence.
Rows or columns — scan both
An X-Wing can be defined on rows (eliminating along columns) or on columns (eliminating along rows). They are the same pattern seen from two angles, and a grid may hide one while showing the other. When a puzzle stalls, run the scan in both directions before reaching for a harder technique.
X-Wing vs Skyscraper vs Swordfish
These three patterns get mixed up because they all work on a single digit across two or three lines. The difference is how the candidate cells line up.
An X-Wing needs a clean rectangle: two rows, two columns, all four corners aligned. A Skyscraper is what you reach for when that rectangle almost forms but does not — the two rows share one column, yet their other two cells (the "roof" tops) sit in different columns. Because the corners do not line up, you cannot clear whole columns; instead you erase the digit only from cells that can see both roof tops. HoDoKu groups the Skyscraper with single-digit chain patterns, not with fish, for exactly this reason.
A Swordfish is simply an X-Wing scaled up by one: the same fish logic, but spread across three rows and three columns instead of two. Jellyfish takes it to four. If you can read an X-Wing, you can read all of them — only the size of the rectangle changes.
- X-Wing — one digit, 2 rows × 2 columns, corners aligned into a rectangle; clears those two columns.
- Skyscraper — one digit, 2 rows sharing one column but with mis-aligned roof cells; clears cells that see both roofs.
- Swordfish — the same fish pattern on 3 rows × 3 columns; Jellyfish on 4 × 4.
Worked example
- Pick the digit 6 and pencil in all its candidates.
- In row 2, the only cells that can hold a 6 are in columns 3 and 7.
- In row 8, the only cells that can hold a 6 are also in columns 3 and 7.
- Those four cells (R2C3, R2C7, R8C3, R8C7) form an X-Wing rectangle.
- The 6 must sit on one diagonal: either R2C3 + R8C7, or R2C7 + R8C3.
- Either way, columns 3 and 7 each get their single 6 from rows 2 and 8.
- So no other cell in column 3 or column 7 can be a 6 — erase 6 from all of them.
- Those eliminations usually leave a hidden single elsewhere, and the puzzle moves again.
Try it yourself
Tap a cell, then a number, to practise.
Frequently asked questions
- Why is it called an X-Wing?
- Because the two valid placements lie on a diagonal across the rectangle, forming an X of mutually exclusive options. The digit takes one diagonal or the other — never both.
- What is the difference between an X-Wing and a Skyscraper?
- An X-Wing needs all four corner cells aligned into a clean rectangle, so it clears two whole columns (or rows). A Skyscraper is for when that rectangle does not quite form: the two lines share one column but their other ends are mis-aligned, so you can only eliminate the digit from cells that see both of those loose ends.
- Is a Swordfish just a bigger X-Wing?
- Yes. A Swordfish uses the same single-digit fish logic spread across three rows and three columns instead of two, and a Jellyfish stretches it to four. The deduction is identical — only the number of lines changes.
- Does the digit have to appear exactly twice in each row?
- For a strict X-Wing, yes — exactly two candidate cells in each of the two base lines. If a row has three or more candidates for the digit, the rectangle is not locked and the elimination does not hold.
Related techniques
Further reading
- X-Wing Strategy — SudokuWiki.org
- Basic Fish (X-Wing, Swordfish, Jellyfish) — HoDoKu
Practice: X-Wing
Put the X-Wing to work on a live board — free puzzles with notes, hints and four difficulty levels.
Try it on a live board