X-Wing Sudoku Explained Simply: A Step-by-Step Walkthrough
The X-Wing is a powerful Sudoku solving technique that uses a rectangle formed by four cells to eliminate candidate digits from entire rows and columns. This pattern occurs when a single candidate appears exactly twice in two rows and those four cells line up perfectly in two columns, or vice versa. Learning to spot an [X-Wing](/techniques/x-wing) is a major step up from basic strategies and is the foundation for more complex 'fish' patterns like the [Swordfish](/blog/swordfish-sudoku). While it looks complex, it can be broken down into simple, logical steps.
Step 1: Focus on a Single Candidate Digit
Begin by selecting one number, from 1 to 9, that you want to analyze. Scan the entire puzzle and lightly mark (often called 'pencil marking') every empty cell where this digit is a possible candidate. This visual map of all the potential placements for your chosen number is essential for spotting the X-Wing pattern. Without clear pencil marks, the pattern is nearly impossible to see.
Step 2: Find Two Rows with Exactly Two Candidates
With your candidate map complete, examine each row. You are looking for two different rows where your chosen digit appears as a candidate in exactly two cells, and only two cells, within that row. These are called the 'base rows'. If a row has the digit placed already, or has only one or more than two candidate cells, it cannot be part of this specific X-Wing. This step is similar to the logic used in simpler strategies like Naked Pairs, but you are applying it across the entire grid.
- Tip: Start with rows that look 'clean' with fewer pencil marks, as they are easier to scan quickly.
Step 3: Check for Alignment in Two Columns
Now, look at the column positions of the two candidate cells in your first base row. Let's say they are in columns A and B. Check your second base row. For an X-Wing to form, its two candidate cells must also be in columns A and B. The four cells must create a perfect rectangle: Row1/ColA, Row1/ColB, Row2/ColA, and Row2/ColB. If the columns do not match, those two rows do not form an X-Wing.
Step 4: Confirm and Eliminate
You have confirmed a rectangle. Here is the powerful elimination logic: Because the digit must go in one of the two cells in each row, it will ultimately occupy one cell in column A and one cell in column B. Therefore, the digit cannot appear anywhere else in those two columns. You can safely erase this candidate from all other cells in columns A and B, outside of your four X-Wing cells. This elimination often reveals new placements or simplifies other areas of the puzzle.
Step 5: The Mirrored Version (Columns First)
The X-Wing pattern works identically if you start with columns instead of rows. Look for two columns where your digit is a candidate in exactly two cells each. Then, verify that those four cells align perfectly in two rows. If they do, you can eliminate the candidate from the rest of those two rows. Always remember to check both orientations; the pattern might be hiding in the columns. Our detailed blog post, X-Wing Sudoku, covers examples of both row-based and column-based X-Wings.
Step 6: A Crucial Verification Check
Before making eliminations, double-check your base rows (or base columns). Each must have exactly two candidates for the digit. A common point of confusion is seeing a third candidate for the same digit in one of the aligned columns, but outside the base rows. This does not break the X-Wing. In fact, that third candidate is one of the ones you will eliminate. The rule applies strictly to the cells within the two base rows you are analyzing.
Practice Drill and Next Steps
To practice, find a medium or hard puzzle and pick a common candidate like 5 or 7. Pencil mark it fully and systematically search for the 2x2 rectangle. Don't get discouraged if you don't find one immediately; it's a pattern that appears in more challenging puzzles. The X-Wing is the simplest member of the 'fish' family of techniques. Mastering it is the gateway to understanding more advanced patterns like Swordfish and Jellyfish. Once comfortable with X-Wings, you can explore other intermediate tactics like the Y-Wing, which uses three cells and three candidates to create a different type of elimination.
- Drill: On your next puzzle, commit to finding just one X-Wing. Ignore other techniques and focus solely on scanning each candidate digit for this specific rectangle pattern.
Key Facts
- ▪An X-Wing is a Sudoku solving pattern involving four cells that form the corners of a rectangle in the grid.
- ▪The pattern exists for a single candidate digit that appears exactly twice in two rows and aligns perfectly in two columns, or vice versa.
- ▪The logic states the digit must occupy one of the two diagonals of the rectangle in the solved puzzle.
- ▪This allows you to eliminate that candidate digit from all other cells in the two affected columns (or rows).
- ▪X-Wing is considered an intermediate technique and is the most basic form of a 'fish' pattern in Sudoku.
- ▪You must check both orientations: the base can be two rows aligned in columns, or two columns aligned in rows.
- ▪For the pattern to be valid, each base row (or column) must contain exactly two candidate cells for the digit; a third candidate elsewhere in the aligned column is a target for elimination.
- ▪Mastering X-Wing is a prerequisite for learning more complex fish patterns like Swordfish (3 rows/columns) and Jellyfish (4 rows/columns).
Frequently Asked Questions
How is an X-Wing different from a Naked Pair?
A Naked Pair acts within a single house (row, column, or box). An X-Wing uses two parallel houses (two rows or two columns) and their intersection columns/rows to create eliminations across the entire grid, making it a more powerful, grid-wide technique.
Do the four X-Wing cells have to be in different 3x3 boxes?
No. The four cells can be spread across two, three, or even four different 3x3 boxes. The pattern is defined solely by the alignment across rows and columns, not by box boundaries.
What if I find two rows with the candidate in three cells each?
That is not an X-Wing. Each base row must have exactly two candidate cells for the digit. A row with three candidates may be part of a larger fish pattern like a Swordfish, but it breaks the conditions for the basic X-Wing.
Can an X-Wing eliminate candidates within its own 3x3 boxes?
Yes. The elimination power applies to the entire column (or row). If other cells in those columns share a 3x3 box with an X-Wing cell, the candidate can be removed from them, which is a very common and useful result.
How often does an X-Wing appear in puzzles?
X-Wings are common in medium-difficulty puzzles and are almost always required to solve hard or expert-level Sudoku. Our hint engine finds them frequently in puzzles rated 4/5 difficulty and above.