Look at candidate 4 in rows 5 and 7 of the board below. In both rows, it fits only in columns 3 and 7. Those two rows will put a 4 in each of those columns, so you can cross out the other 4s in the columns: r4c7, r9c3 and r9c7. You don't have to choose which corner gets which 4.

That is a row-based X-Wing in Sudoku. The restriction concerns one digit's positions across two rows. The four corner cells can still have other candidates.

Find the four corners without losing the rest of the board

Original Sudoku practice board. Candidate 4 is highlighted in r5c3, r5c7, r7c3 and r7c7. Other possible 4s remain visible.
Figure 1. Large digits are filled cells. Small 4s show every currently legal position for 4, not all the other pencil marks. The teal corners belong to rows 5 and 7.

Coordinates start at the top left: r5c3 means row 5, column 3. This is an original practice position, not today's daily puzzle. You can inspect the whole board, but the useful evidence is confined to two rows:

RowAll positions that still allow 4
5c3, c7
7c3, c7

Check the entire row before drawing the rectangle. A third possible 4 elsewhere in either row would break this particular argument. Other digits in the four cells are fine: r5c3, for example, still allows 2, 4, 6 and 9. An X-Wing does not require a pair of identical two-number cells.

For the basic rules behind the pencil marks, use the Sudoku rules and technique guide. Here the small 4s follow directly from the filled rows, columns and boxes. No earlier candidate removals are hidden from the example.

Why both possible diagonals remove the same candidates

Suppose the 4 in row 5 goes in column 3. The 4 in row 7 cannot share that column, so it must go in column 7. Both columns have received their 4.

Now take the other possibility. If row 5 uses column 7, row 7 must use column 3. The exact placements change, but the two columns are occupied again.

Two possible diagonals of the same four corners. One uses r5c3 and r7c7, the other r5c7 and r7c3. Both occupy columns 3 and 7.
Figure 2. These are two branches of the local proof, not two completed solutions to the practice puzzle. Either branch rules out the outside 4s.

So the 4 at row 4, column 7 cannot survive. Nor can the 4s in row 9, columns 3 and 7. Remove those three pencil marks, leaving the other candidates in each cell alone.

CellBefore the X-WingAfter removing 4
r4c72, 4, 6, 92, 6, 9
r9c31, 2, 4, 8, 91, 2, 8, 9
r9c72, 4, 6, 92, 6, 9

None becomes a single immediately. That does not make the move unhelpful. It removes possibilities safely, which can expose a pair, a different pattern or a later single. It does not, by itself, tell you the final values of those three cells.

The same original board after the X-Wing. The 4s in r4c7, r9c3 and r9c7 are crossed out, while all four corner candidates remain.
Figure 3. Cross out only the marked outside 4s. Keep all four corner candidates until another deduction decides their values.

A rectangle can look right and still fail

Consider a separate candidate map. Row 2 allows 6 in c2 or c8. Row 8 allows 6 in c2, c8 or c5. The four cells in columns 2 and 8 make a rectangle, but row 8 is not confined to those columns.

It could use c5 while row 2 uses c8. Column 2 would then still need its 6 elsewhere. You have no X-Wing reason to remove a 6 from another cell in column 2. This is a schematic counterexample, not an extra pencil mark to add to the practice board above.

A diagonal alone does not create a Sudoku relationship. The crossed lines in an X-Wing picture stand for the two possible placements. They do not add a rule that digits on a long diagonal must differ.

Turn the search around when the rows do not help

You can start from columns instead. Find two columns where a digit has only two possible rows, with the same pair of rows in each column. Those columns supply the digit to both rows, so remove it from the rest of those rows.

Keep track of which direction supplied the evidence. In the worked example, the two rows were restricted, and the eliminations ran down the columns. Do not delete an unrelated 4 elsewhere in row 5 just because row 5 is highlighted. In fact, a valid row-based X-Wing already has no other 4 candidate in either base row.

A short check before you move on

In a separate puzzle, the only 7s in columns 2 and 8 lie in rows 3 and 9. Which outside 7s can the pattern remove?

Show the answer

Remove 7 from other cells in rows 3 and 9, outside columns 2 and 8. Leave the four corners. This is the column-based version, so deleting down the rest of columns 2 and 8 would reverse the argument.

Watch the row-and-column argument

SudokuVideoTutorials' X-Wing lesson shows worked rectangles on other boards. Use it to compare the two directions after checking the three removals in this article.

Watch SudokuVideoTutorials on YouTube

When you want another position, open expert Sudoku. A puzzle may need an X-Wing or an XY-Wing, so don't assume every expert grid contains this exact pattern. On your next Sudoku board, finish the obvious singles before scanning one digit's candidate positions across whole rows.

References

HoDoKu's basic fish reference states the row/column restriction. SudokuCoach's X-Wing explanation follows both possible diagonals. The board, three figures and candidate-removal table here are original GridPuzzles practice material.