Skip to content
An illustration of four highlighted cells at the corners of a rectangle on a sudoku grid

Sudoku X-Wing Explained: How to Spot It, With Real Examples

When a number has two places in each of two rows, and they line up in two columns, it clears both columns. Here is how to spot it on real boards.

Today’s puzzle is ready

Classic · Medium · Tue, Dec 1

Play today's puzzle free

Free, no sign-up, a new puzzle every day

By The Grid and Pencil team · · 17 min read

In this guide (12 sections)
  1. Quick Answer
  2. What a sudoku X-wing is
  3. Before the X-wing: pairs and locked candidates
  4. How to spot an X-wing in rows
  5. A worked X-wing example from a Hard puzzle
  6. Why the X-wing works
  7. The column version of the X-wing
  8. Common X-wing mistakes
  9. The swordfish: an X-wing with three rows
  10. The XY-wing: three cells with two notes each
  11. Where these techniques appear on Grid and Pencil
  12. The short version

A sudoku X-wing is a pattern of four cells that lets you clear one number from two whole columns at once. When a number can go in only two places in each of two rows, and those places line up in the same two columns, that number cannot be anywhere else in those two columns. This guide shows you how to spot a sudoku x wing in rows and in columns, works through real boards from our own Hard puzzles cell by cell, explains why it works, and lists the mistakes that trip people up. Then it meets the two techniques that come after it on our site, the swordfish and the XY-wing, and shows where to practice all three.

Quick Answer

If you searched for sudoku x wing, an X-wing is one number, two rows and two columns. When a number has exactly two places in each of two rows, and those places line up in the same two columns, take that number out of every other cell in those two columns. It never places a number by itself, but it often opens a single straight away.

If you searched for how to spot an X-wing, go one number at a time, look for two rows where it has exactly two notes, and check whether those notes sit in the same two columns. The same idea works turned on its side, and with three rows it becomes a swordfish:

PatternLines with only two or three placesLines you clearLevel that needs it
X-wing in rowsTwo rows, two places eachThe two columnsHard
X-wing in columnsTwo columns, two places eachThe two rowsHard
SwordfishThree rows, inside the same three columnsThe three columnsExpert

What a sudoku X-wing is

Our X-wing lesson puts it in one breath. When a number can go in only two places in each of two rows, and those places line up in the same two columns, it must take one corner of each column. So it cannot be anywhere else in those two columns.

The four places make a rectangle. Two corners sit in the top row of the rectangle and two in the bottom row. The number will end up in two opposite corners, so you can picture the two answers as an X drawn across the rectangle. You do not know yet which X it is. You do not need to.

An X-wing never places a number by itself. It takes pencil notes away. Our hints say it like this, with the real rows, columns and number filled in:

"The 7s in row 5 and row 9 can only go in column 3 and column 7. So no other cell of column 3 and column 7 can be 7: take it out of 5 other cells."

Very often a single appears straight after, because a row or box has just lost one of its last places for that number.

Before the X-wing: pairs and locked candidates

Our solver works through a puzzle the way a careful person would. It always reaches for the easiest technique that works. So an X-wing only comes up when none of these easier ones does:

  • Singles. A cell with one number left, or a number with one place left.
  • Pointing and claiming. When a number's notes in a box all sit in one row or column, it cannot be anywhere else in that row or column. Claiming is the same idea the other way round, from a row or column into a box. Our solver groups the two under one name in its code: locked candidates.
  • Pairs. A naked pair is two cells in a row, column or box that can only hold the same two numbers between them. A hidden pair is two numbers that can only go in the same two cells.

Here is a real hidden pair from one of our Medium puzzles, in our hint's words: "In box 2, 2 and 9 can only go in row 1, column 5 and row 2, column 6. So those cells hold nothing else: take the other numbers out of them." In that box, row 3 already has a 2 and a 9, and column 4 has both too. That leaves the two cells.

  • Triples. The same idea with three cells and three numbers.

If any of these works, the hint gives you that first. Our beginner's guide to playing sudoku walks through singles and pointing pairs on real boards, and the Pointing pairs lesson shows one in pictures.

How to spot an X-wing in rows

The X-wing lesson gives three steps:

  1. Pick a number and find two rows where it has exactly two notes.
  2. Check whether the notes line up in the same two columns.
  3. If they do, take the number out of every other cell in those two columns.

A few habits make this faster.

Go one number at a time. Choose a number, say 7, and look along each row for where a 7 can still go. Write down the rows that have exactly two places.

Look at rows that are nearly full. A row with only two or three empty cells is the quickest to check. Often the number you need has only two places there already.

Check the columns, then look for something to clear. Two rows with two places each are not enough. The places must sit in the same two columns. And the X-wing is only worth anything if at least one other cell in those columns still has the number in its notes.

A worked X-wing example from a Hard puzzle

This board comes from one of the Hard puzzles in our store. It is the same position our X-wing lesson shows. A dot is an empty cell, and the bars split each row into its three boxes.

4 3 . | 2 . 9 | . . 8
. . . | 8 7 . | . . .
. . 8 | . . . | . 2 .
------+-------+------
3 . 9 | . 2 7 | 8 . 5
8 1 . | . 9 5 | . 3 2
. . 5 | 3 8 . | 6 . 9
------+-------+------
. 5 . | 7 1 8 | 2 . .
. . . | 5 3 6 | . 8 .
1 8 . | 9 4 2 | . 5 6

Step 1: Follow the 7s in two rows

Row 5. Its empty cells are column 3, column 4 and column 7. Column 4 already has a 7, in row 7. So the 7 for row 5 can only go in column 3 or column 7.

Row 9. It has only two empty cells, column 3 and column 7, and it still needs a 3 and a 7. Neither column has a 7 yet, and neither box does. So the 7 for row 9 can only go in column 3 or column 7.

Two rows, two places each, and the same two columns. That is an X-wing. The four corners are row 5, column 3; row 5, column 7; row 9, column 3; and row 9, column 7.

Step 2: Clear the two columns

ColumnCells that could still be 7Take the 7 out of
Column 3Row 1, row 5, row 8 and row 9Row 1 and row 8
Column 7Row 1, row 3, row 5, row 8 and row 9Row 1, row 3 and row 8

That is five cells, just as the hint says.

Step 3: Find the single it opens

Here is the payoff. Look at row 1 again. Its empty cells are column 3, column 5, column 7 and column 8. Column 5 already has a 7, in row 2. The X-wing has just taken the 7 out of column 3 and column 7. Only column 8 is left. Our hint says: "Look at row 1. It needs a 7, and row 1, column 8 is the only place left for it."

If you reach this board in a game and ask for a hint, the hint card is titled X-wing. It first takes out a 6 and a 1 in two other places, then explains the X-wing, then gives you that 7 in row 1.

Why the X-wing works

Row 5 must hold a 7 somewhere, and it has only two places: column 3 or column 7. Row 9 is the same. Now try both ways.

  • If the 7 in row 5 is in column 3, then row 9 cannot use column 3 as well, because a column holds each number once. So the 7 in row 9 goes in column 7.
  • If the 7 in row 5 is in column 7, then the 7 in row 9 must go in column 3.

Either way, column 3 gets its 7 from row 5 or row 9, and so does column 7. Each column holds only one 7. So no other cell in those two columns can be a 7.

Notice which lines do the work. The rows are the ones that are limited to two places. The columns are the ones you clear. If you mix those up, you will take out notes you should keep.

An illustration of two columns of nine cells side by side, each with exactly two highlighted cells, the highlights sitting in the same two rows in both columns

The column version of the X-wing

The same pattern works turned on its side. If a number can go in only two places in each of two columns, and those places sit in the same two rows, it cannot be anywhere else in those two rows. Our hints check both ways.

Here is a column X-wing from another of our Hard puzzles, part way through the solve:

. . . | 4 7 3 | 1 5 6
3 6 4 | 1 5 9 | 2 7 8
5 7 1 | 6 8 2 | . . 3
------+-------+------
4 . . | . 6 . | 7 . 5
. 8 . | . . . | . 6 .
6 . 3 | . 9 . | 8 . 2
------+-------+------
1 3 . | 9 . . | 6 8 .
. . 6 | . 3 . | . . 9
. 4 . | . . 6 | . . .

Follow the 1s.

Column 5. Its empty cells are in row 5, row 7 and row 9. Row 7 already has a 1, in column 1. So the 1 for column 5 can only go in row 5 or row 9.

Column 9. Its empty cells are also in row 5, row 7 and row 9. Again row 7 is out. So the 1 for column 9 can only go in row 5 or row 9.

Clear the two rows

Two columns, two places each, the same two rows. This time you clear the rows. In row 5, row 5, column 6 could still be 1, so take it out. In row 9, row 9, column 8 could still be 1, so take it out there too. Every other empty cell in those rows already sees a 1 in its column. Our hint says: "The 1s in column 5 and column 9 can only go in row 5 and row 9. So no other cell of row 5 and row 9 can be 1: take it out of 2 other cells."

On our solver, the very next step on this board is a second X-wing in the same two columns, this time on the 4s. After that, row 5, column 6 has only a 5 left.

Common X-wing mistakes

Most wrong X-wings come from one of these.

  1. A row with three places. Each of the two rows must have exactly two places for the number. If one row has three, it is not an X-wing. It might be part of a swordfish, which comes next in this guide.
  2. Columns that nearly line up. Row 5 in columns 3 and 7 with row 9 in columns 3 and 8 is not an X-wing. All four corners must make a true rectangle.
  3. Clearing the wrong lines. In a row X-wing you clear the two columns, never the two rows. In a column X-wing you clear the two rows.
  4. Different numbers in the corners. An X-wing is about one number. A cell with notes 3 and 7 and another with 7 and 9 can both be corners of a 7 X-wing, but only the 7 counts.
  5. Notes that are out of date. An X-wing built on a missing note is wrong, and so is one built on a note that should have gone. Our hints never read your notes: they work from the numbers on the board, so they will not be fooled, but you can be. One more thing to know: Auto notes fills every empty cell with what the numbers on the board allow. If you press it after an X-wing, the notes you took out come back.
  6. Waiting for a number to appear. An X-wing only clears notes. The reward is usually a single somewhere in the rows, columns or boxes it touched. After every X-wing, look along those lines for a number with one place left.

The swordfish: an X-wing with three rows

The swordfish is the X-wing's bigger cousin. Three rows, three columns, one number. When a number's places in three rows all fall inside the same three columns, it cannot be anywhere else in those three columns. Each row only needs two or three places, and the three rows do not each need all three columns.

Here is one from our Expert puzzles:

4 . 5 | 2 . 6 | 1 7 .
. 7 6 | . 1 5 | . . 4
. 2 . | 4 7 3 | 5 6 .
------+-------+------
2 . . | 5 6 7 | . 9 1
. . . | . 2 4 | 6 5 7
5 6 7 | . . 1 | . . 2
------+-------+------
7 8 3 | 1 5 9 | . . 6
9 . . | 6 3 2 | 7 8 5
6 5 2 | 7 4 8 | . 1 .

Follow the 3s.

  • Row 1 has empty cells in column 2, column 5 and column 9. Column 5 has a 3, in row 8. So the 3 goes in column 2 or column 9.
  • Row 4 has empty cells in column 2, column 3 and column 7. Column 3 has a 3, in row 7. So the 3 goes in column 2 or column 7.
  • Row 9 has empty cells in column 7 and column 9 only. So the 3 goes in column 7 or column 9.

Each row uses two of the same three columns: 2, 7 and 9. The three rows need three 3s, and they can only find them in those three columns, so each of those columns gets its 3 from one of these rows. Our hint says: "The 3s in row 1, row 4 and row 9 can only go in column 2, column 9 and column 7. So no other cell of column 2, column 9 and column 7 can be 3: take it out of 3 other cells." The three cells are row 5, column 2; row 2, column 7; and row 6, column 7.

Swordfish are rare. When we counted for this guide, 9 of the 160 Expert classic puzzles in our store needed one.

The XY-wing: three cells with two notes each

The XY-wing works differently. It is not about one number in rows and columns. It uses three cells that each have exactly two notes.

On the same Expert board, the next step is an XY-wing. Look at three cells:

  • Row 1, column 2 can only be 3 or 9.
  • Row 2, column 1 can only be 3 or 8. It sees row 1, column 2, because they share box 1.
  • Row 1, column 5 can only be 8 or 9. It sees row 1, column 2, because they share row 1.

Our hint puts it like this: "Row 1, column 2 is 3 or 9. If it is 3, row 2, column 1 is 8; if it is 9, row 1, column 5 is 8. Either way one of them is 8, so a cell that sees both cannot be 8: take it out of row 2, column 4."

Row 2, column 4 sees row 2, column 1 along row 2, and it sees row 1, column 5 inside box 2. Its numbers alone leave it 8 or 9. With the 8 gone, our next hint says: "Look at row 2, column 4. Its row, column and box already hold every number except 9, so it must be 9."

XY-wings are common at Expert. When we counted, 159 of the 160 Expert classic puzzles in our store needed at least one.

Where these techniques appear on Grid and Pencil

Every puzzle here is graded by the hardest technique it needs, and a puzzle is kept at a level only when its hardest technique belongs to exactly that level. For classic sudoku:

  • Easy needs only singles.
  • Medium adds pointing and claiming, and naked and hidden pairs.
  • Hard adds naked and hidden triples and the X-wing.
  • Expert adds the swordfish, the XY-wing and quads.

So the X-wing is a Hard technique, and when we counted, 102 of the 160 Hard classic puzzles in our store needed at least one. Every level is open from your first visit, and you do not need an account to play.

Here is where to practice:

  • The X-wing lesson shows the 7s board from this guide, with the notes it takes away marked in red.
  • A Hard puzzle is where X-wings turn up. Ask for a hint when you are stuck, and it will name the technique and light up the cells it talks about.
  • An Expert puzzle is the place for the swordfish and the XY-wing.
  • Our solver lets you type in a puzzle from a book or newspaper. It checks the puzzle has exactly one solution, then shows the next step and explains it, X-wings included.

If you like working X-wings on paper, you can print a puzzle at any level, one or four to a page, with the answers on a second page. Our printable sudoku guide covers the printer settings.

An illustration of a solved hard sudoku

The short version

A sudoku X-wing is one number, two rows and two columns. If a number has exactly two places in each of two rows, and those places line up in the same two columns, take that number out of the rest of those two columns. Turned on its side, it works with two columns and two rows. It never places a number, but it often opens a single straight away. After it come the swordfish, the same idea with three rows, and the XY-wing, three cells with two notes each.

Every puzzle at every level is free on Grid and Pencil, with notes, hints, checking and printing. Your next step: open the X-wing lesson, then try a Hard puzzle and find one X-wing on your own before you ask for a hint.