SudokuHint

X-Wing Sudoku Strategy Explained: How to Spot It and Use It

The X-Wing strategy is a crucial intermediate Sudoku technique that eliminates candidates based on a specific rectangular pattern. It is used when a single candidate digit is confined to exactly two cells in two different rows, and those cells line up perfectly in the same two columns, or vice-versa. When you spot this pattern, you can safely eliminate that candidate from all other cells in the affected columns or rows. This guide will define the [X-Wing](/techniques/x-wing), show you how to find it, and explain its practical use for solving tougher puzzles.

By SudokuHint TeamLast updated

What is the X-Wing Pattern?

The X-Wing is a 'fish' pattern, a category of Sudoku strategies that look for alignments of a single candidate across rows and columns. It gets its name from the 'X' shape you can visualize between the four key cells. The core logic is simple: if a digit is only possible in two places in two different rows and those places line up in the same two columns, then the digit must be placed in two opposite corners of the rectangle. This locks the digit into those two columns, meaning it cannot appear anywhere else in them.

Think of it as establishing a strong link. You don't know which two of the four cells will contain the digit, but you know they will occupy opposite corners. This certainty gives you the power to perform a sweeping candidate elimination outside the pattern itself.

How to Find and Use an X-Wing: A Step-by-Step Guide

1. **Work with Candidates**: The X-Wing is invisible unless you mark all possible numbers (pencil marks) in empty cells. You cannot find it by looking at placed numbers alone.

2. **Look for Alignment**: Scan the grid for a specific candidate (e.g., the number 7). Look for two rows where this candidate appears in exactly two cells. The positions of these cells must be identical, forming the corners of a rectangle. For example, if in row 2 the candidate 7 is in columns 4 and 8, and in row 5 the candidate 7 is also only in columns 4 and 8, you have found the alignment.

3. **Apply the Elimination**: Once you confirm the rectangle, you can eliminate the candidate (7 in our example) from all other cells in the two affected columns (4 and 8). The pattern can also work in reverse: two columns each with the candidate in two aligned rows allow elimination from the other cells in those rows.

Key insight: Remember: The pattern requires EXACTLY two instances of the candidate in each of the two rows (or columns), and they must align perfectly.

X-Wing in Action: A Practical Example

Look at the candidate 6 in the grid snippet. In Row 3, the digit 6 is a candidate only in cells C3 and C9. In Row 7, the digit 6 is also a candidate only in cells C3 and C9. This forms a perfect rectangle with corners at (R3,C3), (R3,C9), (R7,C3), and (R7,C9).

Because the 6 must go in one of the two spots in Row 3 and one of the two in Row 7, and the columns are shared, the final placements will be diagonally opposite (e.g., R3C3 and R7C9, or R3C9 and R7C3). This means the 6 is locked into columns 3 and 9. Therefore, you can eliminate 6 as a candidate from every other cell in columns 3 and 9 that is not part of the X-Wing. This might instantly reveal a Naked Single elsewhere.

  • Turn the board: Mentally swap rows and columns. The X-Wing works vertically (two columns aligned in two rows) just as it does horizontally.
  • Systematic scan: When stuck, pick one candidate (like 5) and go through all rows, noting which have it in exactly two cells. Look for a matching row.

How X-Wing Compares to Other Techniques

The X-Wing is a natural progression from simpler intersection techniques like Pointing Pairs. While a Pointing Pair locks a candidate into a single row or column within a block, the X-Wing operates across the entire grid, connecting two rows to two columns.

It is also a simpler, more specific form of the broader 'Fish' family, which includes more complex patterns like Swordfish and Jellyfish. Mastering the X-Wing builds the foundational logic needed to understand these advanced strategies. It is distinct from a Naked Pair, which works within a single unit (row, column, or block) by occupying two cells with the same two candidates.

Common Pitfalls and How to Avoid Them

The most common mistake is misidentifying the alignment. The candidate must be in exactly two cells in each of the two rows (or columns). If a row has the candidate in three cells, it cannot be part of an X-Wing for that digit.

Another error is applying eliminations to the wrong unit. If you find the pattern in rows, you eliminate from the corresponding columns, and vice-versa. Always double-check: 'This locks the digit into these two columns, so I remove it from other cells in those columns.' For a complete visual walkthrough, see our detailed X-Wing guide.

Key Facts

  • The X-Wing is a Sudoku solving technique that eliminates candidate numbers based on a rectangular alignment in the grid.
  • It occurs when one candidate digit appears in exactly two cells in two different rows, and these cells line up in the same two columns (or the reverse with columns and rows).
  • The final digit will be placed in two diagonally opposite corners of the rectangle formed by the four candidate cells.
  • Once identified, you can eliminate that candidate from all other cells in the two affected columns (if found in rows) or rows (if found in columns).
  • X-Wing is considered an intermediate strategy and is a foundational pattern in the 'Fish' family of Sudoku techniques.
  • You must use pencil marks (candidate notes) to see an X-Wing; it cannot be spotted by looking only at given and solved numbers.
  • The pattern requires precision: each row must have exactly two instances of the candidate, not 'at least two'.
  • Mastering X-Wing is a key step before learning more complex patterns like Swordfish, which uses three rows and three columns.

Frequently Asked Questions

What is the X-Wing strategy in Sudoku?

It's a pattern where one candidate is in exactly two cells of two rows, aligned in the same two columns. This locks the candidate into those columns, allowing you to remove it from other cells in them.

How do I know if I've found a valid X-Wing?

Check two things: 1) Your chosen candidate appears in only two cells in each of two rows. 2) Those cells are in the same two columns. If both are true, you have an X-Wing.

Can an X-Wing be found using columns instead of rows?

Yes. The pattern works both ways. Find two columns where the candidate is in exactly two cells, aligned in the same two rows. Then eliminate the candidate from other cells in those rows.

What's the difference between X-Wing and a Naked Pair?

A Naked Pair involves two cells in one unit sharing the same two candidates. An X-Wing involves four cells across two rows and two columns, all sharing just one candidate.

Why can I eliminate candidates with an X-Wing?

The digit must go in opposite corners of the rectangle. This forces it into two specific columns (or rows), so it cannot exist elsewhere in those units.

Is X-Wing only for very hard puzzles?

It's common in intermediate to hard puzzles. Many daily puzzles in the 'Hard' category from major publishers require techniques like X-Wing to be solved logically.