Techniques in Depth · 14 min read

X-Wing, Swordfish, Jellyfish: The Fish Family Explained

The fish technique in Sudoku is a single-digit elimination. When a digit's candidates in n rows all fall within the same n columns, that digit can be removed from every other cell of those columns, and the same holds with rows and columns swapped. The number n names the fish: two is an X-Wing, three a Swordfish, four a Jellyfish and five the magnificently named Squirmbag. The names are whimsical, but they describe one counting argument that works at every size. This guide explains that logic once, properly, then the taxonomy, then the curious history of the names.

What is the fish technique in Sudoku?

Most early techniques look inside one row, column or box. A fish looks at one digit across several lines at once: the base rows hold the digit only inside the cover columns, so those rows use up the cover columns' copies of it. The four sizes, and how often each earns its keep:

Size (n)NameHow often you need it
2X-WingThe fish you will meet most; worth checking in any hard puzzle
3SwordfishLess often, mostly in hard and expert puzzles
4JellyfishRarely: only when the digit has been placed once or not at all
5SquirmbagNever: a Jellyfish or smaller always does the same job

The core argument, using the X-Wing

Fish are single-digit techniques: you reason about one digit at a time, ignoring all others. Suppose the digit 7 has exactly two candidate cells in row 2, and exactly two candidate cells in row 6 — and these fall in the same two columns, say columns 3 and 8. The four cells form a rectangle.

Row 2 must contain a 7 somewhere, and its only options are columns 3 and 8. Likewise row 6. The two rows cannot use the same column (that would put two 7s in one column), so between them, rows 2 and 6 will place their 7s in columns 3 and 8 — one each, in some order. We do not know which order, and we never need to. Either way, column 3 gets its 7 from row 2 or row 6, and so does column 8. Both columns' 7s are accounted for — so every other candidate 7 in columns 3 and 8 can be eliminated. That is the X-Wing.

The general statement: if a digit's candidates in n rows are confined to the same n columns, then those n columns' copies of the digit must come from those n rows — and the digit is eliminated from those columns everywhere else. Solvers call the n rows the base sets and the n columns the cover sets. Everything works with rows and columns swapped, and if the pigeonhole flavor feels familiar, it should: this is the same k-things-in-k-places counting as the subset techniques, lifted from one unit to the whole grid.

Rows need not be full at size three and up

One important relaxation at sizes three and up: the rows need not each contain the digit in all of the cover columns. A Swordfish needs each of its three rows to have candidates in only (a subset of) the three columns — two per row is fine, and the classic “2-2-2” Swordfish is actually the easiest to spot. What is forbidden is a base row having a candidate outside the cover columns.

The Jellyfish, worked

The Jellyfish is the size-four fish: four base rows whose candidates for one digit all fall inside the same four cover columns. Here is one in a real puzzle. The givens below were generated for this guide, and the puzzle has exactly one solution (blank cells are empty).

The puzzle's givens
c1c2c3c4c5c6c7c8c9
r183
r238475
r3918
r495
r51297
r625
r7239
r8812
r94

Work it with singles, naked and hidden subsets (pairs, triples and quads) and box/line reductions until they run dry. At that point the site's solver finds nothing else, X-Wings and Swordfish included. Now look at the digit 6 alone. It has been placed only once, at row 2, column 1. In the map below, ● is a cell that can still hold a 6 and a red ✕ is a candidate that is about to go. The four base rows are shaded blue, the four cover columns amber, and the cells where a base row crosses a cover column green.

Where the digit 6 can go
c1c2c3c4c5c6c7c8c9
r1●✕●
r26
r3●●
r4●●
r5●●
r6●✕●
r7●●
r8●●●
r9●●

Read off the four shaded rows:

  • Row 3: 6 only in columns 5 and 8
  • Row 5: 6 only in columns 3 and 9
  • Row 8: 6 only in columns 3, 8 and 9
  • Row 9: 6 only in columns 5 and 9

Between them the four rows use exactly four columns, 3, 5, 8 and 9. That is a 2-2-3-2 Jellyfish, and no row has all four. Each of the four rows needs a 6, no two of them can share a column, and they have only four columns to choose from. So they take columns 3, 5, 8 and 9 one each, in some order you never have to work out. All four of those columns get their 6 from rows 3, 5, 8 and 9, and every other 6 candidate in those columns is false. There are two:

  • Row 1, column 5 loses its 6 (column 5's 6 is in row 3 or row 9).
  • Row 6, column 3 loses its 6 (column 3's 6 is in row 5 or row 8).

Why is this not a Swordfish or X-Wing in disguise? Check the smaller sizes. No two rows share a pair of columns for the 6, and no three rows fit inside three columns. Turn the grid on its side and the same is true with columns as the base. The duality from the next section explains what you do find instead. Columns 2, 4, 6 and 7 are the four open columns outside the cover set, and their 6s all sit in rows 1, 4, 6 and 7, so they form a second Jellyfish, a 2-2-2-2 one in columns. It removes the same two candidates. With the 6 missing from eight rows, the complementary fish has size 8 − 4 = 4, so you cannot swap down to a smaller pattern. Here the Jellyfish really is the smallest fish that does the job.

To be clear about what it buys you: these two eliminations don't crack the puzzle by themselves, and the solver still needs harder tools afterwards. Here the Jellyfish is one step in a long solve, not the key that opens it.

How to spot a Jellyfish (and why you rarely need to)

The search is the same single-digit scan as the general fish search further down, run one size up:

  1. Pick a digit and count its candidates in each row. Skip rows where it is already placed.
  2. Drop every row with more than four candidates. It cannot be a Jellyfish base row.
  3. Among the rest, look for four rows whose columns add up to only four. Write each row as its set of columns, as in the list above, and merge them four at a time.
  4. Check the cover columns for victims. A Jellyfish only does something if one of the four columns has a candidate outside the base rows.
  5. Repeat with columns as the base.

Now for the reason you rarely need to do any of that. Count the rows where the digit is still unplaced, and call that m. The duality below says a Jellyfish in rows always comes with a fish of size m − 4 in columns, making the same eliminations. If the digit has been placed twice or more, m is at most 7, and the partner fish has at most three lines: a Swordfish, an X-Wing or something simpler still. A Jellyfish is only the smallest option when the digit has been placed at most once, as the 6 was above. That gives you a practical rule. For a digit placed two or more times, don't hunt Jellyfish. Look for the smaller fish running the other way, which is easier to see and gives the same eliminations.

Why you never need a fish bigger than a Jellyfish

Here is the family's most satisfying theorem. For any digit, consider the rows: some contain the digit already; suppose k of the remaining rows form a fish with k cover columns. A complementary-counting argument — the same one that pairs naked subsets with hidden ones — shows that a size-k fish in rows always coexists with a size-(m − k) fish in columns, where m is the number of rows/columns still missing the digit, and the two produce identical eliminations. With at most nine units in play, whenever a Squirmbag (5) or larger exists, a Jellyfish (4) or smaller exists pointing the other way. Squirmbags are hunted for sport, not necessity.

Where the names came from

The vocabulary was coined in the early 2000s on online solving communities — principally the Sudoku Players' Forum and its predecessors — where enthusiasts were naming patterns as fast as they discovered them, and whimsy was a feature, not a bug.

  • X-Wing is generally understood as a Star Wars reference: connect the four corner cells and the crossing diagonals draw an X, like the fighter's wings. (It is a rectangle pattern, but “Rectangle” was destined for the uniqueness family instead.)
  • Swordfish is the name that started the fish theme, and its exact origin is genuinely murky — early forum posters themselves debated it. Once “Swordfish” stuck for size three, the community ran with the joke: size four became Jellyfish, and the family as a whole became fish. The retronym then swallowed the X-Wing, which is nowadays classified as the size-two fish despite its aeronautical name.
  • Squirmbag — the size-five fish — is fisherman's slang for a bag of live bait, a wink at the fact that the pattern is more wriggle than substance, since a smaller complementary fish always exists.

Later refinements extended the taxonomy with finned fish (a fish spoiled by one or two extra candidates — the “fin” — which still eliminates in the cells that see the fin) and sashimi fish (a finned fish that is missing part of its body), plus franken and mutant fish that use boxes as base or cover sets. These are the natural next rung, and the finned-fish guide works one through in full; they are all the same cover-set argument with looser geometry — once the X-Wing proof above feels obvious, none of them will frighten you.

One name sounds like it belongs here and does not. The Turbot Fish is not a cover-set fish at all but a four-cell chain of strong and weak links on one digit, and the Skyscraper and Two-String Kite are its best-known shapes. They sit right beside the X-Wing on the ladder, and the Skyscraper, Kite and Turbot Fish guide works one of each on a real puzzle.

How to actually find fish

Fish live or die on single-digit vision — scanning the grid for one digit and seeing only its placements and candidates. The efficient search:

  1. Pick a digit placed five or six times. Few rows remain, so qualifying base rows are easy to enumerate.
  2. List rows where the digit has exactly two or three candidate cells. Rows with two candidates are X-Wing material; note their column pairs.
  3. Look for repeats. Two rows sharing the same column pair is an X-Wing. Three rows whose candidate columns union to three columns is a Swordfish. Four rows in four columns is a Jellyfish, and the Jellyfish checklist above covers that size.
  4. Repeat with columns as the base. Fish hide in both orientations, and by the complement theorem, a hard-to-see row fish is often an easy column fish.

Pencil-mark hygiene matters doubly here, since a single stale candidate can fake or hide a base row — the maintenance habits are a prerequisite. When you are ready to train the vision, the walkthroughs show real X-Wings and Swordfish with the eliminations drawn on the board, and the technique picker will generate puzzles guaranteed to require one. Ten fish in a row will do more for your eye than any amount of theory — including this article.

Frequently asked questions

What is a fish in Sudoku?

It is a pattern on one digit spread over several lines. Pick n rows whose only places for that digit lie in n columns. Each of those rows needs the digit, no two can share a column, so together they fill all n columns, and any other candidate for the digit in those columns is false. Turning the grid sideways gives the column version. The X-Wing (n = 2), Swordfish (3), Jellyfish (4) and Squirmbag (5) are the same reasoning at four sizes.

What is a Jellyfish in Sudoku?

The size-four fish: four rows in which a digit can only go in the same four columns, or four columns limited to the same four rows. The digit is then removed from those four columns (or rows) everywhere outside the pattern. A row does not need candidates in all four columns. It only needs to have none outside them. The worked Jellyfish above goes through a real one.

Is a Jellyfish harder than a Swordfish?

The logic is the same. It is just harder to see, because you have to hold four rows and four columns in your head instead of three. You also need it less often than you might think. When the digit has been placed at least twice, any Jellyfish has a Swordfish or smaller partner in the other direction that makes the same eliminations. You only need the Jellyfish itself when the digit has been placed once or not at all.

Do I ever need a Squirmbag?

No. A digit can be missing from at most nine rows, so the partner of a Squirmbag has at most 9 − 5 = 4 lines. That makes it a Jellyfish or something smaller, running the other way, with identical eliminations. Squirmbags are real and valid, but a smaller fish always does the same job.