X-Wing: the first fish pattern in sudoku

X-Wing lets you remove a candidate from two columns by looking at two rows at the same time. It is one of the techniques Hard puzzles need, and the first step into the family of fish patterns.

Updated · In Hush from Hard · 7 min read

X-Wing is the first technique in this series that links two rows and two columns at once. When one digit can go in only two places in each of two rows, and those places line up in the same columns, the digit can be cleared from the rest of those columns. You will need it when singles, pairs and locked candidates no longer move the puzzle forward.

What is an X-Wing?

An X-Wing is a pattern made by one candidate digit in four cells. In two different rows, the digit can go only in the same two columns, so the four cells form a rectangle. Each of those two columns must contain the digit exactly once, and the pattern already places it inside the two rows. So the digit can be removed from every other cell in those two columns.

How it works

Cells are written as r#c#, row first and then column, as in the previous guides. So r2c3 is row 2, column 3.

Here is the logic with the digit 7. In row 2, the 7 can go only in r2c3 or r2c8. In row 6, it can go only in r6c3 or r6c8. If the 7 in row 2 is in column 3, then column 3 is used up in row 2, so the 7 in row 6 must be in column 8. If the 7 in row 2 is in column 8, the 7 in row 6 must be in column 3. Either way, columns 3 and 8 each hold the 7 in row 2 or row 6, and nowhere else.

The method has three steps:

  1. Find a digit with two candidate cells in a row. Do this for every row and for the digit you are checking.
  2. Find a second row with the same two columns. Two rows form an X-Wing only if their two cells sit in exactly the same two columns.
  3. Remove the digit from the rest of those columns. Every other cell in the two columns, outside the two rows, loses that digit.

The diagram below shows candidate 7 in rows 2 and 6, limited to columns 3 and 8. The cells marked x are the four corners of the pattern. The cells marked - are r4c3, r8c3 and r5c8, where 7 is removed.

Candidate 7 in rows 2 and 6 is limited to columns 3 and 8 – an X-Wing. Remove 7 from r4c3, r8c3 and r5c8.x the digit can go here · – the digit is removed here

The column-based version

The same logic works with rows and columns swapped. If candidate 4 appears in only two cells of column 2 and only two cells of column 7, and those four cells sit in rows 3 and 8, then the 4 can be removed from the other cells in rows 3 and 8. The next diagram shows this case. The cells marked x are r3c2, r8c2, r3c7 and r8c7, and the cells marked - are r3c5, r3c9 and r8c4.

Candidate 4 in columns 2 and 7 is limited to rows 3 and 8 – a column-based X-Wing. Remove 4 from r3c5, r3c9 and r8c4.x the digit can go here · – the digit is removed here

How to spot it

A worked example

Take the column-based diagram above and follow the reasoning for candidate 4.

Column 2 has 4 only in r3c2 and r8c2. Column 7 has 4 only in r3c7 and r8c7. Suppose the candidate lists in these rows are r3c2 {4,6}, r8c2 {2,4}, r3c7 {4,9} and r8c7 {4,5}. The 4 in column 2 is in row 3 or row 8, and so is the 4 in column 7. Therefore rows 3 and 8 each hold their 4 inside columns 2 and 7. No other cell in row 3 or row 8 can be 4.

That removes 4 from three other cells:

The four corners keep their candidates, and nothing changes in the rest of columns 2 and 7 outside rows 3 and 8, because the pattern does not reach those cells. The X-Wing has done its job when the 4 is gone from the rows that it controls.

Common mistakes

Practice X-Wing in Hush

Hush rates X-Wing as a Hard technique. The first 10 solved Hard or Expert puzzles are free, and Hush Plus, a one-time purchase at $4.99 with no subscription, unlocks unlimited Hard and Expert puzzles. Highlights for the row, column, box and matching numbers make it easier to see where a digit still appears, which is exactly what an X-Wing search needs. Notes also clean themselves up after you place a number, so the candidate lists stay accurate while you look.

Start by reviewing locked candidates and naked triples and quads, which often clear the candidates that make an X-Wing possible. After you are comfortable with two rows and two columns, move on to Swordfish, which extends the same idea to three rows. You can see the whole Hard and Expert picture in the technique guides or read more about Expert sudoku.

Frequently asked questions

What is an X-Wing in sudoku?

An X-Wing is a pattern in which one digit can go in only two cells in each of two rows, and those four cells sit in the same two columns. The digit can then be removed from the other cells in those two columns.

Does X-Wing also work with columns?

Yes. The column-based version works the same way with rows and columns swapped. The digit is confined to two rows in two columns, and it is removed from the other cells in those two rows.

How is X-Wing related to Swordfish?

Swordfish is the three-row version of the same idea. Three rows hold one digit in three columns, and each row uses two or three of those columns.

Which Hush level includes X-Wing?

Hard. Hush rates difficulty by the techniques a puzzle needs, and X-Wing is one of them. The first 10 solved Hard or Expert puzzles are free, and Hush Plus unlocks unlimited Hard and Expert puzzles.