X-Wing Strategy in Sudoku: A Visual Guide with Examples
An X-Wing is a Sudoku solving pattern where a single candidate digit appears exactly twice in two rows and exactly twice in two columns, forming a rectangle on the grid. When this pattern is found, you can eliminate that candidate from all other cells in the two columns or rows involved, which is a powerful step for solving harder puzzles. This technique is a cornerstone intermediate strategy that moves beyond basic scanning and [How to Solve Hard Sudoku](/blog/how-to-solve-hard-sudoku) often requires patterns like this.
Defining the X-Wing Pattern
The X-Wing pattern is named for the 'X' shape its four key cells create when you mentally connect them with diagonal lines. At its core, it's a rectangle formed by four cells. These four cells are special: they all contain the same candidate digit, and they are arranged so that two are in one row, two are in another row, and these pairs also align perfectly into two columns. The pattern's power comes from the logical constraint it creates. The candidate must occupy two of these four cells in a diagonal pairing, which locks its possible locations in the involved columns or rows.
The Two Orientations: Row-Based and Column-Based
An X-Wing has two primary orientations, depending on whether you discover it by scanning rows or columns. A row-based X-Wing is the most common way to find it. You spot a candidate that appears exactly twice in one row and then find another row where the same candidate also appears exactly twice, and these appearances line up in the same two columns. This creates the rectangle. A column-based X-Wing is the same logic but flipped. You find a candidate appearing exactly twice in one column, find a second column where it also appears exactly twice, and these pairs align in the same two rows. Both orientations lead to the same powerful elimination, just applied to the opposite unit.
How to Spot an X-Wing: A Step-by-Step Scan
To find an X-Wing, systematically scan for a single candidate number, typically one that is already placed in several boxes. First, pick a candidate, like '7'. Look at each row on the grid. Does the candidate '7' appear as a possibility in exactly two cells in any row? If you find one such row, note the two columns those cells are in. Now, search for a different row where '7' is also a candidate in exactly two cells. Crucially, those two cells must be in the same two columns you noted from the first row. If you find this second row, you have identified a row-based X-Wing. The same process works for columns by scanning vertically.
- Start your scan with candidates that are already solved in several boxes, as they have fewer remaining placements.
- Use pencil marks! Accurate candidate notation is essential for seeing these patterns clearly.
- If you suspect an X-Wing, trace the rectangle with your finger to confirm the four corner cells align perfectly in two rows and two columns.
The Elimination Rule: How the X-Wing Clears Candidates
Once you confirm the four-cell rectangle, you can make eliminations. For a row-based X-Wing (found in two rows), look at the two columns that form the sides of the rectangle. You can eliminate the candidate from all other cells in those two columns. The logic is solid: the candidate must go in one of the two X-Wing cells in each column, so it cannot be placed anywhere else in that column. For a column-based X-Wing, you eliminate the candidate from all other cells in the two rows that form the top and bottom of the rectangle. This elimination often directly reveals a Naked Single or simplifies other Intersection Removal techniques.
Avoiding the Common Trap: The 'Exactly Two' Rule
The most common mistake with the X-Wing is misapplying it when the candidate appears more than twice in a row or column. The pattern requires that the candidate appears in exactly two cells in each of the two rows (or columns). If it appears in three cells in one of the rows, the logical 'either-or' chain breaks, and you cannot make the elimination. This strict requirement is what makes the pattern reliable. If you see a candidate three times in a row, you might be looking at a more advanced pattern like a Swordfish, which is essentially an X-Wing extended over three rows and columns. Mastering the X-Wing is a key step before tackling strategies like the Y-Wing.
Key Facts
- ▪An X-Wing is a Sudoku pattern involving four cells that form a rectangle, all containing the same candidate digit.
- ▪The candidate must appear exactly twice in two different rows and exactly twice in two different columns among these four cells.
- ▪There are two orientations: a row-based X-Wing (found by scanning rows) and a column-based X-Wing (found by scanning columns).
- ▪For a row-based X-Wing, you eliminate the candidate from all other cells in the two columns that form the rectangle.
- ▪For a column-based X-Wing, you eliminate the candidate from all other cells in the two rows that form the rectangle.
- ▪The pattern's logic relies on the candidate being forced into a diagonal pairing within the four corner cells.
- ▪Accurate pencil marking is essential for spotting X-Wing patterns, especially in hard and expert-level puzzles.
- ▪A common error is applying X-Wing logic when a candidate appears three times in a row; the pattern requires exactly two.
- ▪The X-Wing technique is considered a foundational 'fish' pattern, with the Swordfish being a more complex three-row variant.
Frequently Asked Questions
Can an X-Wing exist within a single 3x3 box?
No. By definition, the four cells must span two different rows and two different columns, which inherently places them in at least two, and often four, different 3x3 boxes.
What's the difference between an X-Wing and a Skyscraper?
Both are strong intermediate techniques. An X-Wing is a perfect rectangle of four cells. A Skyscraper uses a strong link chain across six cells in a bent shape, often leading to similar eliminations but with a different spotting logic.
How often do X-Wings appear in puzzles?
X-Wings are common in hard and expert-level Sudoku puzzles. Our hint engine finds them in over 60% of puzzles rated 'hard' or higher, making them a crucial technique to learn.
Do I need pencil marks to find an X-Wing?
Yes. Seeing that a candidate appears exactly twice in a row or column is nearly impossible without noting all possible candidates (pencil marks) in the empty cells first.