An X-Wing is a digit that, in two rows, can go only in the same two columns, so it can be removed from every other cell in those two columns. The mirror image works too: if a digit, in two columns, can go only in the same two rows, it can be removed from every other cell in those two rows.
The four candidate cells form the corners of a rectangle. Instead of reading one row, column or box, an X-Wing follows one digit across two whole lines at once, and it is the smallest member of the family of patterns called fish.
- Row-based X-Wing: two rows hold the digit only in the same two columns. Remove it from the other cells of those columns.
- Column-based X-Wing: two columns hold the digit only in the same two rows. Remove it from the other cells of those rows.
Example 1: a row-based X-Wing on 7
Look at the 7 in rows 6 and 7. Row 6 can take a 7 only in columns 2 and 9, and so can row 7. Those four cells, marked in blue, are the corners of the X-Wing. Each row needs a 7, and row 6's 7 and row 7's 7 cannot share a column, so one of them lands in column 2 and the other in column 9.
That settles the 7 of both columns, so no other cell in column 2 or column 9 can hold a 7. The red marks are the five 7s that go: rows 2, 4, 8 and 9 of column 2, and row 9 of column 9. The payoff is immediate. Row 2, column 2 had only 1 and 7 left, so it becomes a Naked Single 1, and singles carry the rest of the puzzle.
At this point the site's solver finds no single, pair, triple, quad or Omission anywhere on the board. The X-Wing is the only way forward.
Example 2: a column-based X-Wing on 5
This time scan down the columns. Column 6 can take a 5 only in rows 4 and 7, and column 8 can too. Read along the rows instead and you would miss it: row 4 has four cells that could hold a 5 and row 7 has six, so neither row looks special. The pattern only shows up when you count by column.
The roles swap, and so does the direction of the elimination. The two columns between them claim the 5 of row 4 and the 5 of row 7, so the 5 comes out of every other cell in those two rows. The red marks show the six that go: columns 1 and 5 of row 4, and columns 1, 2, 3 and 5 of row 7.
Now look at column 1. Before the X-Wing it could take a 5 in rows 4, 7 and 8; afterwards only row 8 is left, so row 8, column 1 is a Hidden Single 5. This position comes from a real puzzle in the site's library, and a solver that checked only rows would have stalled here, because there is no row-based X-Wing for any digit.
How to find an X-Wing, step by step
Search one digit at a time, and only once your pencil marks are complete. An X-Wing hunt on half-filled notes finds patterns that are not there.
- Pick one digit. Start with a digit that is already placed five or six times; few candidates are left, so rows with two homes stand out.
- List the rows where it has exactly two homes. Note the columns, such as "row 6: columns 2 and 9". Rows with three or more homes cannot be part of an X-Wing.
- Find two rows with the same pair of columns. Row 6 with columns 2 and 9 matches row 7 with columns 2 and 9. Row 6 with columns 2 and 9 does not match a row with columns 2 and 8.
- Check the rectangle. The four cells should sit at the corners of a rectangle, two in each row and two in each column.
- Eliminate down the columns. Remove the digit from every other cell of those two columns. Leave the two base rows alone.
- Repeat by columns. List the columns where the digit has exactly two homes, look for two that share the same pair of rows, and remove the digit from the rest of those rows, as in Example 2.
Why it works
Take Example 1. Row 6's 7 is in column 2 or column 9. Suppose it is in column 2. Then row 7 cannot use column 2 as well, so row 7's 7 is in column 9. Suppose instead row 6's 7 is in column 9; then row 7's is in column 2. Either way the two 7s sit on opposite corners of the rectangle, one on each diagonal. That crossing is the X in the name.
In both cases column 2 gets its 7 from row 6 or row 7, and so does column 9. Neither column has room for a 7 anywhere else, so every other 7 candidate in those columns is false. You do not need to know which diagonal is right to make the eliminations. The guide X-Wing, Swordfish, Jellyfish: the fish family explained shows how this same counting argument scales to three and four lines.
X-Wing vs Swordfish vs Skyscraper
A Swordfish is the X-Wing with one more line: three rows whose candidates for a digit fit inside three columns. The logic is identical, and it is worth checking for an X-Wing first because two lines are much quicker to compare than three.
A Skyscraper is the near miss. Two rows each hold the digit in exactly two cells, one pair lines up in a column and the other pair does not. It still eliminates, but only from cells that see both unaligned ends; the guide to the Skyscraper, Two-String Kite and Turbot Fish works through it. A finned X-Wing has an extra candidate or two in one base row, the fin, sitting in the same box as one of the corners. Only the eliminations the fin can also see survive, as explained in finned and sashimi fish.
How to spot it
Find a digit that, in two different rows, is a candidate in only the same two columns. The four cells form a rectangle. The same works with rows and columns swapped.
When to use it
It is the gateway advanced technique; reach for it when singles, subsets, and Omission stall and you have good pencil marks.
Common mistakes
- Eliminating in the wrong direction. A row-based X-Wing removes the digit from the two columns, not the two rows.
- Accepting a near-miss where one of the rows has the digit in a third column; the candidate must be confined to exactly two columns in both rows.
- Scanning only rows. A column-based X-Wing can sit in rows that hold the digit four or more times, so it is invisible until you count down the columns.
Frequently asked questions
- What is an X-Wing in Sudoku?
- An X-Wing is a digit that, in two rows, can go only in the same two columns. Those four cells form a rectangle, and the digit can be removed from every other cell in the two columns. The column-based version swaps the roles: two columns that hold the digit only in the same two rows clear it from the rest of those rows.
- How do you find an X-Wing?
- Choose one digit and list the rows where it has exactly two candidate cells. Look for two of those rows whose cells are in the same two columns, then remove the digit from the rest of those columns. If rows give nothing, repeat the count with columns.
- Does an X-Wing have to use rows?
- No. A column-based X-Wing is just as valid: two columns hold the digit only in the same two rows, and it comes out of the other cells of those rows. It is easy to overlook because the rows involved can still look crowded with candidates.
- Do the four cells have to be in different boxes?
- No. The two rows can sit in the same band of boxes, so the four corners fall in two boxes rather than four, and the X-Wing still works. All four corners can never share one box in a valid puzzle, because both rows would then need the digit inside that single box.
- Why is it called an X-Wing?
- The digit must end up on one of the rectangle's two diagonals: top-left with bottom-right, or top-right with bottom-left. Drawn together, the two possible diagonals cross in an X.
- What is the difference between an X-Wing and a Swordfish?
- An X-Wing uses two rows and two columns. A Swordfish extends the same logic to three rows and three columns, where the digit is confined to the same three columns across three rows.
- What comes after the X-Wing?
- The Swordfish is the next size up. Alongside it sit the near misses: the Skyscraper and Two-String Kite, which eliminate when only one pair of cells lines up, and the finned X-Wing, which tolerates a stray candidate in one box.