What are X-Wing and Swordfish in sudoku?

X-Wing and Swordfish are advanced elimination techniques — they don't place a digit, they remove candidates. An X-Wing works on one digit whose candidates form a rectangle across two rows and two columns; a Swordfish is the same logic stretched over three rows and three columns. Both belong to the "fish" family, and both are the price of admission to expert-level puzzles: from a certain difficulty up, nothing simpler will break the grid open.

This guide walks through each pattern with a concrete example, pins down the exact difference between them, adds the XY-Wing (which people often meet at the same stage), and ends with a systematic way to hunt for X-Wings so you stop finding them by luck.

Man concentrating on an advanced sudoku puzzle on his phone in a reading chair
Advanced patterns take staring time — that's the fun part.

The X-Wing, worked through

An X-Wing concerns a single digit — say 7. The pattern: two rows in which the candidate 7 appears in exactly two cells each, and those cells sit in the same two columns. Picture row 2 with its only possible 7s in columns 3 and 8, and row 6 also with its only 7s in columns 3 and 8. The four cells form the corners of a rectangle.

Now the logic. Row 2 must contain a 7, and it has only those two spots — column 3 or column 8. Same for row 6. They can't both put their 7 in the same column (a column can't hold two 7s), so one row takes column 3 and the other takes column 8. Which is which, we don't know — and we don't need to know. Either way, both columns receive their 7 inside the rectangle.

That's the payoff: every other candidate 7 in columns 3 and 8 — in rows 1, 3, 4, 5, 7, 8, 9 — can be erased. Those columns' 7s are spoken for. One of those eliminations usually cascades: a cell drops to a single candidate, and the puzzle moves again.

The pattern also works transposed: two columns whose only 7s share the same two rows let you eliminate 7s from the rest of those rows. The base units (where the candidates are confined to two cells) and the cover units (where you erase) simply swap roles. The name, by the way, comes from the X you can draw connecting the four corners diagonally — not from Star Wars, though it stuck for a reason.

The Swordfish: the same idea, one size up

A Swordfish is an X-Wing generalized to three rows and three columns. The condition: three rows in which a candidate digit appears in at most three cells each, with all of those cells confined to the same three columns. Say rows 1, 4 and 9 have their candidate 2s only in columns 2, 5 and 7 — some rows using all three columns, some only two. That's fine: "at most three cells, within the three columns" is the requirement, and Swordfish with two candidates in some rows are actually the common case.

The logic scales directly from the X-Wing. Each of the three rows must place its 2 in one of the three columns, and no column can serve two rows. Three rows, three columns, each column used exactly once — however the details shake out, the 2s of columns 2, 5 and 7 all land inside the pattern. So every candidate 2 elsewhere in those three columns is eliminated.

Swordfish are markedly harder to spot than X-Wings — nine cells of a 3×3 arrangement versus four corners of a rectangle — which is exactly why they sit a tier higher on the difficulty ladder. The family continues upward, too: four rows and four columns make a Jellyfish, though in ordinary play you'll need one about as often as the name suggests.

X-Wing vs Swordfish: the difference

The two techniques are the same argument at different sizes. The differences, precisely:

  • Size: an X-Wing spans 2 rows × 2 columns (4 cells); a Swordfish spans 3 rows × 3 columns (up to 9 cells).
  • Condition: X-Wing needs the candidate in exactly two cells of each base row; Swordfish allows two or three cells per base row, confined to the three shared columns.
  • Elimination: identical in kind — the candidate is removed from the covering columns (or rows) everywhere outside the pattern.
  • Difficulty: X-Wings mark the entry to advanced solving and appear regularly from "hard" upward; Swordfish are an expert-tier tool — rarer, harder to see, usually reserved for the levels apps call expert, evil or diabolic.

A useful way to hold it: every X-Wing is a fish of size two, every Swordfish a fish of size three. Master the X-Wing first — the Swordfish is the same muscle, trained further. Neither ever places a digit directly; like all eliminations, they earn their keep by what the removed candidates unlock next.

And the XY-Wing, briefly

Despite the name, the XY-Wing is not a fish — it's a three-cell logic pattern you'll typically meet at the same stage. It needs three cells that each hold exactly two candidates, linked like this: a pivot cell with candidates X and Y, which "sees" (shares a row, column or box with) two pincer cells — one holding X and Z, the other Y and Z.

Follow the pivot: if it's X, the first pincer becomes Z. If it's Y, the second pincer becomes Z. There is no third option — so one of the pincers is Z, guaranteed. Any cell that sees both pincers can therefore never be Z, and that candidate is eliminated. Concrete flavor: pivot holds 2/7, one pincer 2/9, the other 7/9 — every cell seeing both pincers loses its 9.

XY-Wings reward the same pencil-mark discipline as fish: they're built entirely from two-candidate cells, which only stand out if your notes are complete.

How to spot an X-Wing systematically

  1. Pick one digit and hunt only that

    Fish patterns are single-digit patterns. Scanning "for X-Wings" in general finds nothing; scanning for 7s finds the 7 X-Wing. Start with digits that have 5–6 placements already — few candidates left means patterns stand out.

  2. Find rows where the digit has exactly two candidate cells

    Sweep the grid row by row, counting that digit's candidates. Note every row with exactly two. These are your potential base rows — fewer than two is impossible, more than two disqualifies the row (for an X-Wing).

  3. Check any two such rows for column alignment

    If two of your noted rows have their candidate pairs in the same two columns, the rectangle is complete — you have an X-Wing.

  4. Eliminate, then repeat with columns as the base

    Erase the digit from all other cells of the two columns. No alignment found? Run the same sweep column-wise — column-based X-Wings eliminate along rows, and solvers who only ever scan rows miss half of all fish.

Other options worth knowing

For going deeper: SudokuWiki.org documents the entire fish family (through Jellyfish and finned variants) and its solver will point out every X-Wing and Swordfish in any grid you paste in. Sudoku.coach has dedicated drill sets where every puzzle contains the technique you're practicing — the fastest way to make a pattern stick. Good Sudoku (iOS) teaches these through its hint engine. In Sudoku by Joseph, the natural habitat of fish patterns is the upper end of the Easy–Diabolic ladder, where you can hunt them across all twelve variants, with unlimited pencil marks and no mistake counter punishing you while you learn.

Frequently asked questions

Do I need X-Wing and Swordfish to solve hard sudokus?

For genuinely hard puzzles, yes — difficulty ratings are defined by required techniques, and from roughly the "hard" tier upward, graders certify puzzles that singles and pairs cannot finish. If you keep hitting a wall where no basic move exists, an X-Wing (or something above it) is usually the intended key.

Which should I learn first, X-Wing or Swordfish?

X-Wing, without question. It's the size-2 version of the identical logic, far easier to spot, and much more common in real puzzles. Once finding X-Wings is routine, the Swordfish is the same scan widened to three rows — learning them in the other order just makes both harder.

Is the XY-Wing related to the X-Wing?

Only by name. The X-Wing is a single-digit fish pattern built on rows and columns; the XY-Wing is a three-cell pattern built on cells that each hold exactly two candidates. They tend to get taught together because both appear at the expert tier, but the underlying logic is different.

What comes after Swordfish?

The fish family continues to the Jellyfish (four rows × four columns) and to "finned" versions of each pattern that tolerate one stray candidate. Beyond fish, expert solving moves into coloring and forcing chains. In practice, X-Wing plus Swordfish plus XY-Wing covers the great majority of what even diabolic-tier puzzles demand.

Hunt fish patterns all the way to Diabolic

12 variants, a Daily Challenge with streaks — and never any lives, coins or energy bars. The download is free.