9 Sudoku Get Sudoku

What does X-Wing mean in sudoku?

The pattern, why the elimination is forced rather than likely, how to spot it without hunting, and how Swordfish is the same idea one size larger.

An X-Wing is the first technique most players meet that does not place a digit anywhere. It only removes candidates. That is why it feels like a step backwards the first time you use one, and why it is the point where a lot of people quietly start guessing instead.

It is worth pushing through, because the elimination an X-Wing gives you is not a good bet. It is forced. Once you have seen why, the pattern stops looking like trivia and starts looking obvious.

The pattern

Pick one digit and think about only that digit — say 7. Now look for two rows in which 7 has exactly two possible cells. Not three, not four: exactly two. If the two candidate cells in the first row sit in the same two columns as the two candidate cells in the second row, you have an X-Wing.

Draw the four cells and they form the corners of a rectangle. The name comes from the two diagonals you can draw across it.

Why the elimination is forced

Each of those two rows has to contain a 7 somewhere, and in each row the only places left are the two corners. So one corner in the top row gets the 7, and one corner in the bottom row gets the 7.

There are only two ways that can happen. Either the top-left and bottom-right corners take the 7s, or the top-right and bottom-left corners do. They cannot both be in the left column, because then the other column would need a 7 in one of these two rows and there would be nowhere to put it.

Look at what both cases have in common: in either one, the left column gets a 7 from these two rows, and so does the right column. You do not know which row supplies it, and you do not need to. Both columns are already served.

That is the whole deduction. Since each of the two columns already has its 7 accounted for inside those two rows, no other cell in either column can be a 7. Cross the 7 out of every remaining cell in both columns. You have not placed anything, but the grid is now materially simpler, and very often a hidden single falls out immediately afterwards.

It works sideways too

Everything above holds if you swap the words row and column. Find two columns in which the digit has exactly two candidate cells, and those cells share the same two rows, and you can eliminate that digit from the rest of those two rows. Half of all X-Wings people miss are the transposed ones, simply because they only ever scan in one direction.

How to actually find one

Hunting for rectangles by eye does not work. Go digit by digit instead, and use the rarity of the digit as your filter.

  1. Pick a digit that is already well placed — one with six or seven of its nine copies on the board. Those are the digits whose candidates are squeezed into few cells, which is exactly the condition the pattern needs.
  2. For that digit, mark the rows where it has exactly two candidate cells. Ignore every other row completely.
  3. Compare those rows in pairs. You are only asking one question: do these two rows use the same two columns?
  4. If they do, eliminate the digit from the rest of both columns.
  5. Repeat with rows and columns swapped.

Done this way an X-Wing takes under a minute to rule in or out, because you are never looking at more than a handful of rows per digit. Trying to see it as a shape on a full grid of pencil marks is what makes it feel impossible.

Where Swordfish comes in

Swordfish is the same argument with three rows instead of two. Find three rows in which a digit’s candidates all fall inside the same three columns — importantly, a row may have two or three candidates, not necessarily all three — and those three rows must supply a copy of the digit to each of the three columns. So the digit can be eliminated from the rest of those three columns.

This is why solvers usually implement the two together: they are one routine with a size parameter. Sudoku - Calm Number Puzzle runs its X-Wing and Swordfish checks through a single generic fish routine with n = 2 and n = 3, and both sit in the Expert band, because a puzzle that requires one is a puzzle nothing cheaper could crack.

When you have found one and nothing happens

It is entirely possible to find a real X-Wing that eliminates nothing useful — the candidates it would remove were not there in the first place. That is not a mistake, it is just a pattern that happened not to pay. Move to the next digit. The technique is worth running because it costs little, not because every instance is decisive.

Frequently asked questions

Does an X-Wing ever place a digit?

No, never directly. It only removes candidates from other cells. What normally happens is that one of those removals leaves some cell or unit with a single possibility, and that is what gets placed. If you are looking for an immediate placement you will conclude the technique did nothing.

Do the four cells have to be in different boxes?

They do not have to be, but in practice they usually are. If the two columns fall inside the same box, the cheaper pointing and claiming techniques would normally have handled the elimination already, so the X-Wing would be redundant rather than wrong.

What is the difference between an X-Wing and an XY-Wing?

They are unrelated despite the names. An X-Wing is about one digit across four cells forming a rectangle. An XY-Wing is about three cells with two candidates each — a pivot seeing two pincers — and eliminates a digit from cells that both pincers can see. Both are Expert-band techniques here, but you find them by looking for completely different things.

Do I need an X-Wing to finish a normal puzzle?

Only at the hardest end. Beginner through Hard puzzles in this app are verified to be solvable without one — their difficulty grade is the hardest technique the solver needed, and X-Wing only appears in the Expert band.

Try it on a real puzzle

Sudoku - Calm Number Puzzle grades every puzzle by the hardest technique it actually needs, verifies a single solution before you ever see the grid, and its hints name the technique instead of just filling in a digit. Free, offline, no ads and no account.

Download on the App Store

Related guides

All guides