The X-wing is the first fish pattern in sudoku, and usually the first technique people learn after pairs, pointing and box/line reduction. This page explains the X-wing sudoku technique in rows and in columns, with several real positions where our solver finds one, how to spot it in your own grid, and its bigger relatives, the swordfish and the jellyfish. Every grid is live: press Show the step to see the solver's own highlight and explanation, and Apply it to keep solving.
What an X-wing is
Pick one digit. Suppose that in two different rows this digit has exactly two possible cells, and in both rows those cells sit in the same two columns. The four cells form the corners of a rectangle. In the first row the digit goes in one of the two columns; the second row cannot use the same column, so it takes the other one. Either way, the digit ends up on two opposite corners, and each of the two columns gets its copy from these two rows. So no other cell in those two columns can hold the digit, and you can erase it there. The name comes from the diagonal pair of answers, which form an X.
X-wing in rows
In the grids below, the lilac cells are the four corners (or the corners that still have the digit), the cream lines are the two rows and the two columns, and the red candidates are the ones the X-wing removes. Use the numbered buttons to switch between real examples.
X-wing in columns
The same logic works with rows and columns swapped. If a digit has exactly two places in each of two columns, and they fall in the same two rows, the digit takes opposite corners and leaves the rest of both rows.
In 12,000 puzzles we generated and rated with the solver, 759 needed an X-wing at least once: 485 the row version and 296 the column version, with a few needing both. That is about one puzzle in sixteen, so X-wings are worth knowing but rarely the first thing to look for.
How to spot an X-wing
- Fill in pencil marks for the whole grid first. An X-wing is invisible without them.
- Clear every single, pointing pair, box/line reduction, pair and triple you can. The solver does the same: it only looks for an X-wing when those find nothing.
- Take one digit. Go down the rows and note each row where that digit has exactly two candidates, and in which columns.
- If two rows share the same pair of columns, you have an X-wing. Check those two columns for other candidates of the digit: they are the eliminations. If there are none, the pattern is real but does not help.
- Repeat with columns, noting the rows, then move on to the next digit.
A quick filter: a row where the digit appears exactly twice is a conjugate pair. Writing the pairs down for one digit takes a minute and shows every X-wing for that digit at once.
Finned X-wing
A finned X-wing is an almost X-wing where one row has one or two extra candidates, the fin, in the box of one corner. If no fin cell holds the digit, the X-wing works; if one does, it sees every cell of that box. So the digit leaves only the cells that the X-wing would clear and that also sit in the fin's box. When the fin takes the place of a missing corner, the pattern is called a sashimi X-wing. Our solver tries finned X-wings after the plain fish, and 485 of the 12,000 puzzles needed one. You can follow it in the sudoku solver too.
Bigger fish: swordfish and jellyfish
The X-wing is a fish of size two. A swordfish uses three rows whose candidates for a digit all fall within the same three columns, with two or three candidates per row. Each of the three columns then gets its copy from these rows, so the digit leaves the rest of those columns. It is harder to spot because a row may hold only two of the three columns. In our 12,000 puzzles, 143 needed a swordfish.
A jellyfish does the same with four rows and four columns. It is rare: only 2 of the 12,000 puzzles needed one, because simpler techniques almost always make progress first.
All three fish, and every other technique the solver uses, are explained with examples on the sudoku techniques page. If you are new to sudoku, start with how to solve sudoku. The sudoku X and jigsaw sudoku solvers use X-wings too, on the rows and columns of those grids.
Solver tested . Found a problem? Tell us.
Questions
What is an X-wing in sudoku?
A pattern for one digit: in two rows the digit has exactly two possible cells, in the same two columns. The digit must take opposite corners of that rectangle, so it can be removed from every other cell of those two columns.
Does an X-wing work with columns?
Yes. If a digit has exactly two places in each of two columns, in the same two rows, it can be removed from the rest of those two rows. Our solver checks both versions.
What is a finned X-wing?
An X-wing where one row has an extra candidate or two, the fin, inside the box of one corner. Only cells in the X-wing's columns that also see the fin can lose the digit. Our solver uses finned and sashimi X-wings after the plain fish.
How often do you need an X-wing?
Not often. In 12,000 puzzles we generated and rated, 759 needed an X-wing at least once, about one in sixteen. Singles, pairs and box/line reduction come up far more.
What is the difference between an X-wing and a swordfish?
Size. An X-wing uses two rows and two columns; a swordfish uses three of each, and a jellyfish four. The logic is the same: the digit's places in the base lines cover exactly as many cross lines.