SudokuHint

X-Wing vs Swordfish in Sudoku: What's the Difference?

The main difference between an X-Wing and a Swordfish is their size and scope. An [X-Wing](/techniques/x-wing) is a basic fish pattern that uses exactly two rows and two columns. A [Swordfish](/blog/swordfish-sudoku) is a more advanced pattern that expands this logic to three rows and three columns. Both are powerful [Fish Patterns](/blog/sudoku-fish-patterns) that allow you to eliminate a candidate digit from large sections of the grid, but they operate on different scales and are found at different difficulty levels.

By SudokuHint TeamLast updated

Core Definitions: What Are They?

An X-Wing is a foundational Sudoku solving technique. It occurs when a single candidate digit is confined to exactly two cells in each of two rows, and those four cells align to form the corners of a rectangle across two columns. Conversely, those two columns must also contain the digit in only those two rows. This symmetrical relationship allows you to eliminate that candidate from all other cells in the two involved columns (if you found the pattern in rows) or rows (if you found it in columns).

A Swordfish is the logical extension of the X-Wing. It involves three rows and three columns, where the candidate digit appears in two or three cells in each of the three rows, and all these cells are contained within just three columns. Like the X-Wing, the pattern is symmetrical: the three columns will also contain the digit in only those three rows. This setup lets you remove the candidate from all other cells in the three involved columns or rows. The pattern's name comes from its shape on the grid, which is said to resemble the long, slender profile of a swordfish.

Side-by-Side Comparison

Understanding the structural differences is essential to advancing from intermediate to advanced puzzles. The table below contrasts the two patterns directly.

| Feature | X-Wing | Swordfish | | :--- | :--- | :--- | | **Pattern Size** | 2 rows × 2 columns | 3 rows × 3 columns | | **Total Cells** | Exactly 4 cells | 6, 7, 8, or 9 cells | | **Cell Requirement** | 2 cells per row/column | 2 or 3 cells per row/column | | **Primary Use** | Eliminates candidates from rows/columns | Eliminates candidates from rows/columns | | **Difficulty Level** | Intermediate | Advanced | | **Relationship** | Basic fish pattern | Extended fish pattern |

The key takeaway is scalability. An X-Wing is a 2x2 pattern, while a Swordfish is a 3x3 pattern. You can think of a Swordfish as an 'X-Wing times three.' Some solvers even learn a 4x4 pattern called a Jellyfish, but the Swordfish is the most common advanced fish you'll encounter.

Key insight: Remember: For both patterns, the candidate digit must appear exactly two or three times in the involved rows (or columns), and all appearances must be confined to the same set of columns (or rows).

How to Identify and Choose Which to Look For

Start your search by scanning for a candidate digit that appears frequently but is not yet placed. For an X-Wing, look for a digit that appears in only two possible cells in two different rows. Then, check if those cells line up in exactly two columns. If they do, you've found an X-Wing and can eliminate that digit from the rest of those two columns.

Move to a Swordfish search when puzzles get harder and X-Wings are not present. Look for a digit that is limited to two or three cells in three different rows. The crucial step is to see if all these cells fall within the same three columns. If the alignment holds, you have a Swordfish and can make eliminations in those three columns. The process is identical if you start by scanning columns first.

Our hint engine finds that most players get stuck looking for the perfect rectangle of an X-Wing. A Swordfish is more flexible; the cells do not need to form a perfect 3x3 grid. They can be scattered, as long as all are contained within the three defining rows and columns. This makes visual identification trickier.

  • **Scan by Digit:** Always search for these patterns one candidate number (1-9) at a time.
  • **Row vs. Column:** The pattern works identically whether you find it in rows or columns. If you don't find it in rows, try scanning columns.
  • **Start Simple:** If you're new to fish patterns, master the X-Wing completely before attempting to find Swordfish patterns.

Example Scenarios

**X-Wing Example:** Imagine the candidate '7' appears only in cells R1C2 and R1C8 in Row 1, and only in cells R7C2 and R7C8 in Row 7. This forms a rectangle with corners in columns 2 and 8. Since '7' is confined to columns 2 and 8 in these two rows, you can eliminate '7' from all other cells in columns 2 and 8.

**Swordfish Example:** Consider candidate '5'. It is found in Row 2 (cells C4, C6), Row 5 (cells C4, C9), and Row 8 (cells C6, C9). All cells are within Columns 4, 6, and 9. This is a valid Swordfish on rows 2, 5, and 8. You can eliminate '5' from all other cells in columns 4, 6, and 9.

These examples highlight the logical chain: the candidate must choose its final positions from a limited set of intersections. By defining that set (2x2 or 3x3), you can remove its possibility elsewhere. If an X-Wing seems to be present but has one extra candidate breaking the pattern, you might be looking at a Finned X-Wing, a useful variant.

Key Facts

  • An X-Wing pattern involves exactly 2 rows, 2 columns, and 4 cells forming a rectangle on the Sudoku grid.
  • A Swordfish pattern is larger, involving 3 rows, 3 columns, and between 6 to 9 cells contained within them.
  • Both patterns work by eliminating a specific candidate number from all other cells in the involved columns or rows.
  • The X-Wing is considered an intermediate technique, while the Swordfish is an advanced solving strategy.
  • You search for both patterns by focusing on a single candidate number (1-9) and analyzing its possible positions.
  • For a pattern to be valid, the candidate must appear in only 2 or 3 cells in each of the defining rows (or columns).
  • The Swordfish is named for its elongated shape on the puzzle grid, not a fish skeleton.
  • Mastering the X-Wing is a prerequisite for reliably finding the more complex Swordfish pattern.

Frequently Asked Questions

Is a Swordfish just three X-Wings put together?

Not exactly. A Swordfish is one coherent 3x3 pattern. While it extends X-Wing logic, it is a distinct pattern where three rows and three columns are interlinked. You cannot break it into separate, smaller X-Wings that produce the same eliminations.

Which should I look for first, X-Wing or Swordfish?

Always look for an X-Wing first. It is simpler and more common. If you cannot find an X-Wing for a stubborn candidate, then scan for a Swordfish pattern, especially in harder puzzles.

Can a Swordfish use more than 3 rows and columns?

Yes. The family of Fish Patterns includes a 4x4 Jellyfish and beyond. However, these are extremely rare in published puzzles. The Swordfish is the most complex fish pattern you will regularly need.

What if the pattern is almost an X-Wing but has one extra candidate?

You may have found a Finned X-Wing. This common variant has one extra candidate (the 'fin') that slightly changes how eliminations work, but it is still a powerful technique.