X-Wing Sudoku Technique

X-Wing is an intermediate Sudoku elimination technique. When one digit appears as a candidate in exactly two cells per row across two rows, and those cells share the same two columns, the four candidates form a rectangle. You can then eliminate that digit from every other cell in those two columns.

Those four candidate cells form a rectangle, and the digit must occupy one diagonal pair or the other. That is why the pattern is called an X-Wing. If you are asking "what is an X-Wing in Sudoku?", the short answer is: it is a rectangle-based pattern that removes impossible pencil marks from the rest of the grid.

Prerequisites

Before tackling X-Wing, be comfortable with: Naked Single and Locked Candidates.

How to recognize an X-Wing in Sudoku

  1. Choose a digit to scan for (e.g., 5).
  2. Find all rows where 5 appears as a candidate in exactly two cells (two cells per row).
  3. Check whether any two of those rows share the same pair of columns.
  4. If yes — you have an X-Wing. The four corner cells form your rectangle.

Worked example

In the grid below, the digit 5 is a candidate in exactly two cells in row 2 (columns 3 and 8) and exactly two cells in row 7 (also columns 3 and 8). These four cells form the X-Wing rectangle.

· · · · · · ·
· · 5 · · · · 5 ·
· · · · · · ·
· · · · · · ·
· · · · · · ·
· · · · · · ·
· · 5 · · · · 5 ·
· · · · · · ·
· · · · · · ·

X-Wing corner (5 must go here)   5 eliminated from these cells

Because 5 must occupy exactly one cell per row within columns 3 and 8, the digit 5 cannot appear anywhere else in column 3 or column 8. Remove 5 from the candidate list of every gray ✕ cell.

Why it works

Consider the two rows of the X-Wing. In each row, digit 5 has only two possible homes — both in the same pair of columns. One of the two column positions will be used in row 2, and the other in row 7 (or vice versa). Either way, both columns are consumed. No other row can place 5 in those columns, because the two X-Wing rows already account for all occurrences of 5 in those columns across the entire grid.

Column-based X-Wing

X-Wing is symmetric. It also works across columns: if digit 5 appears in exactly two cells in each of two columns, and those cells share the same two rows, you can eliminate 5 from every other cell in those two rows. The logic is identical — just swap "row" and "column".

When should you use X-Wing?

Use X-Wing after basic scans stop producing placements. It usually appears in harder Sudoku puzzles once Naked Singles, hidden singles, and Locked Candidates have already been exhausted. If several rows each show only two pencil marks for the same digit, that is a good moment to check for an X-Wing.

Common mistakes

  • Three candidates instead of two. The pattern only fires when a digit appears in exactly two cells per row (or column). Three or more candidates in a row breaks the logic.
  • Columns don't match. Both rows must share the same pair of columns. If row 2 has 5 in columns 3 and 8 but row 7 has 5 in columns 3 and 5, there is no X-Wing.
  • Eliminating the wrong dimension. If you found the X-Wing by scanning rows (two rows, same two columns), eliminate from the columns — not from the rows themselves. Beginners sometimes get this backwards.

Frequently asked questions

What is the X-Wing technique in Sudoku?

X-Wing is a candidate elimination technique. It applies when a single digit appears in exactly two cells per row in two rows, and both rows share the same two columns. The four cells form a rectangle. Because the digit must land in two of those four corners, it can be eliminated from every other cell in those two columns.

How do you find an X-Wing?

Pick a digit and scan each row. Note every row where that digit appears in exactly two columns. If two rows share the same pair of columns, you've found an X-Wing. The technique works identically if you scan columns instead of rows.

Which cells can you eliminate candidates from?

Eliminate the digit from all cells in the two X-Wing columns except the four corner cells. For example, if the X-Wing sits in rows 2 and 7, columns 3 and 8: remove the digit from every cell in column 3 and column 8 that is not in row 2 or row 7.

Is X-Wing the same as Swordfish?

No. Swordfish extends X-Wing from two rows (or columns) to three. In a Swordfish, the digit appears in exactly two or three cells in each of three rows, and all those cells land in the same three columns. The elimination logic is the same — just larger. X-Wing is 2×2; Swordfish is 3×3.

Is X-Wing a beginner or advanced technique?

X-Wing is intermediate. Learn Naked Singles and Locked Candidates first. Most solvers find X-Wing intuitive once they've seen it demonstrated — the rectangle visualization is the key. It becomes second nature after two or three puzzles that require it.

What puzzles require X-Wing?

X-Wing is typically needed in Hard and Expert Sudoku puzzles. Easy and Medium puzzles are usually solvable with simpler techniques like Hidden Singles and Locked Candidates. If you're stuck on a hard puzzle and basic techniques are exhausted, X-Wing is the first intermediate pattern to look for.

Related techniques: Naked Single · Locked Candidates · All Techniques