Sudoku X-Wing: How to find and prove the pattern
Learn the sudoku X-Wing technique with two rows, two columns and one digit. Follow a local proof, avoid false rectangles and try an explained exercise.
What the sudoku X-Wing looks for
The sudoku X-Wing follows one digit through two rows and two columns to eliminate candidates. In the simple rectangular form, two rows allow that digit only in the same two columns. Each row needs one occurrence, and a column cannot repeat the digit. The two occurrences must therefore occupy one diagonal of the rectangle or the other. You do not yet know which diagonal is correct, but both columns will be occupied by the starting rows. Remove the digit from the remaining cells in those columns. The four corner cells do not need identical candidate lists.
Check every position before comparing rows
Choose a digit and inspect its possible places row by row. For a row with exactly two possible locations, note their column numbers. Compare those column pairs across different rows. This lesson’s rectangular example needs two rows with the same pair of columns. The other digits pencilled into each corner may differ. What matters is that the digit under examination has no third location in either starting row. Check your notes carefully: One missing mark can draw an apparent rectangle that does not justify any elimination at all.
Local example: X-Wing in rows
Rows 2 and 6 allow 7 only in columns 3 and 8. Remove 7 from r4c3 and r9c8.
Candidates to keep: r2c3, r2c8, r6c3, r6c8Candidates to remove: r4c3, r9c8
A local deduction model. Only the relevant positions are shown; blank cells do not mean that other candidates are absent.
Local example: X-Wing in columns
Columns 2 and 7 allow 4 only in rows 3 and 8. Remove 4 from r3c5.
Candidates to keep: r3c2, r8c2, r3c7, r8c7Candidates to remove: r3c5
A local deduction model. Only the relevant positions are shown; blank cells do not mean that other candidates are absent.
A local example for digit 7
Suppose rows 2 and 6 are both missing 7. Row 2 allows it only at r2c3 or r2c8, and row 6 allows it only at r6c3 or r6c8. These are the complete sets of possible locations for 7 within those two rows. Their columns match: Columns 3 and 8. Remove 7 from r4c3 and r9c8 if those cells still contain that candidate. You may also remove it from any other cell in those two columns outside rows 2 and 6. None of the four corners is solved by this deduction alone.
Why both diagonals produce the same elimination
If r2c3 is 7, r2c8 cannot be 7 because it shares the row, and r6c3 cannot be 7 because it shares the column. Row 6 must then place 7 at r6c8. If r2c8 is 7 instead, row 6 needs its 7 at r6c3. Either way, column 3 and column 8 each receive a 7 from the two original rows. A third row cannot add another 7 in either column. This proves the elimination without choosing a diagonal or treating one arrangement as more likely than the other.
Starting with columns instead
Exchange rows and columns to turn the pattern around. Suppose columns 2 and 7 allow digit 4 only in rows 3 and 8. Those two rows must receive their two occurrences of 4 from the original columns. Remove 4 from r3c5, which lies in an affected row outside the starting columns. Keep 4 at r8c7: That is one of the corners supporting the pattern. Make eliminations in the units receiving the two occurrences, rather than in the starting units where you proved there were only two possible positions.
Three checks that prevent a false X-Wing
Four marks forming a rectangle are insufficient when either starting row has another possible position for the same digit. Conversely, the affected columns need not have exactly two candidates: Extra candidates there are the very marks the technique can remove. Finally, follow the same digit at every corner. Two 2 marks and two 7 marks do not form this pattern. More complicated variants have different requirements, but this lesson covers the basic rectangular X-Wing. Do not extend its conclusions to a similar-looking shape without checking the conditions that make its eliminations valid.
Exercise with the opposite orientation
Return to digit 4 in columns 2 and 7, with complete possible locations r3c2, r8c2, r3c7 and r8c7. Choose an elimination from r3c5, r8c7 and r4c5. The answer is r3c5: Row 3 must receive its 4 from column 2 or column 7 and cannot accept another in column 5. Cell r8c7 supports the pattern and must keep the candidate. Cell r4c5 belongs to neither affected row. This exercise supplies local conditions for proving a deduction; it is not an 81-cell puzzle and does not supply a complete solution.
Return to simpler moves afterwards
Update only the candidates supported by the proof, then search again for naked singles, hidden singles or pairs. An X-Wing can be useful even when it does not immediately settle a cell. To explain a move, identify the digit, the two starting units and the two affected units, then name a specific cell losing the candidate. When there is no outside candidate to eliminate, recognising the rectangle does not change the current notes. Do not delete extra marks just to produce a result. Change digit, revisit box-line interactions or inspect a different area of the grid.
Which cell can lose candidate 4?
Local example: In columns 2 and 7, 4 is possible only in rows 3 and 8.
Further reading
Now try it on the grid.
Practise at your own pace and look for a chance to explain the next deduction.
Practise with a Sudoku