Words & word games

Word ladders: Lewis Carroll's Doublets, how to solve them, and how a computer finds the shortest one

Words & word games · · Published 2026-11-10

A sepia studio photograph of a young man with wavy hair, a dark jacket and a white bow tie, looking down to one side
Charles Lutwidge Dodgson, better known as Lewis Carroll, photographed by Oscar Gustav Rejlander in 1863. The Metropolitan Museum of Art, Gilman Collection, CC0.

Turn HEAD into TAIL by changing one letter at a time, and make a real word at every step. That is the whole game, and it has kept puzzle setters, teachers and programmers busy for almost a century and a half. This note covers where the word ladder came from, the rules its inventor actually wrote, how to solve one without a computer, and what happens when you let a computer loose on Carroll's own puzzles with the word list behind our spell checker.

From Word-links to Doublets

Lewis Carroll said he invented the game at Christmas 1877. His diary first mentions it in March 1878 under the name Word-links, and it reached the public a year later as Doublets, a series of puzzles in the magazine Vanity Fair that began with the issue of 29 March 1879. The first three were set that day: "Drive PIG into STY", "Raise FOUR to FIVE" and "Make WHEAT into BREAD". The puzzles were collected into a small book, Doublets: A Word-Puzzle, published by Macmillan the same year.

The game has since picked up other names: word ladder, laddergram, change-the-word and word golf. Vladimir Nabokov used the last one in Pale Fire (1962), where the narrator boasts of his records: "hate—love in three, lass—male in four, and live—dead in five (with 'lend' in the middle)". A short entry on word ladders also appears in our field guide to word play; this page goes further.

Carroll's rules, word for word

The 1879 book sets the rules out precisely, and they are stricter than most modern versions:

  1. The object is to complete the chain with the fewest possible links.
  2. Each word is formed from the one before by changing one letter, and one only. The new letter stays in the same position, and every other letter keeps its place. No rearranging.
  3. No word may appear twice in a chain.
  4. Only words in the glossary printed with the puzzles count. Carroll's published rules also rule out proper names, local and foreign words, and abbreviations.

His worked example is the one everyone still quotes:

HEAD → HEAL → TEAL → TELL → TALL → TAIL

The four words in the middle are the "links". In Vanity Fair the puzzles were a competition, and Carroll scored them: a doublet was worth one mark for each letter in its two words, so HEAD–TAIL was worth eight, and a solver lost a mark for every link beyond the shortest known solution. Four links scored the full eight; twelve or more scored nothing.

Why HEAD to TAIL takes five steps, not four

Count the positions where HEAD and TAIL differ: all four (H/T, E/A, A/I, D/L). Each step changes exactly one letter, so no ladder can be shorter than the number of differing positions. Computer scientists call that count the Hamming distance; it is the substitution-only cousin of the edit distance explained in our walkthrough of Levenshtein distance in JavaScript.

Carroll's chain takes five steps because the third letter changes twice: A becomes L in TELL, then L becomes I in TAIL. A detour like that is often unavoidable. English simply does not have a word at every point of the direct route, so a good ladder sometimes changes a letter to something temporary, purely to open a path.

Solving by hand

A few habits make ladders much easier:

Carroll's puzzles against a real word list

To see how hard the classic puzzles really are, we ran a shortest-path search, the code for which is below, over the American English list used by the Letterbench spell checker, a list of about 72,400 entries drawn from SCOWL. We kept only lower-case words, which leaves out names as Carroll required, and searched each pair. One shortest ladder per pair is shown; there are often several of the same length.

PuzzleStepsOne shortest ladder
HEAD → TAIL5head, held, hell, tell, tall, tail
COLD → WARM4cold, cord, word, ward, warm
PIG → STY5pig, big, bag, sag, say, sty
FOUR → FIVE7four, pour, pout, port, fort, fore, fire, five
WHEAT → BREAD6wheat, cheat, cleat, bleat, bleak, break, bread
PEN → INK5pen, ten, ton, ion, inn, ink
WET → DRY5wet, bet, bat, bay, day, dry
EYE → LID3eye, lye, lie, lid
HATE → LOVE3hate, have, hove, love

Three things stand out. Carroll's HEAD–TAIL chain is already optimal: the search finds five steps too, just through different words. COLD–WARM, EYE–LID and HATE–LOVE need no detour at all, so their ladders are exactly as long as the number of letters that differ. And FOUR–FIVE is the long one: three letters differ, but the ladder takes seven steps, because the direct routes run out of words almost at once.

The results depend on the list. Nabokov's narrator claims LIVE–DEAD in five; with this list the best our search finds is six (live, hive, hire, here, herd, head, dead), so his chain must use a word our list does not contain. Lists also hide traps: in another test, HARE → SOUP came out in five steps only by passing through corp, an abbreviation Carroll would have refused. Any ladder program needs a list that matches the rules of the game.

Aloof words

Some words have no neighbours at all: change any single letter and you never get another word. Donald Knuth, who studied five-letter ladders in The Stanford GraphBase (1993), called them aloof. In his list of 5,757 common five-letter words he found 671 of them, and noted that aloof is itself one.

Our list behaves the same way. Of its 4,449 lower-case five-letter words, 621 have no neighbour, and aloof is still among them, along with ordinary words such as angry, comma, earth, music, queue and sugar. Four-letter words are much better connected: only 78 of 2,335 are aloof, among them envy, epic, hymn, lynx, onyx and tofu. That is the practical reason four letters is the classic length for a puzzle. No ladder can start or end on an aloof word, so if a puzzle refuses to budge, check that first.

How a computer finds the shortest ladder

Treat every word as a point and join two points when they differ by one letter in the same position. A word ladder is then a path, and the shortest ladder is the shortest path, which a breadth-first search finds: look at every word one step from the start, then every word two steps away, and so on, until the target turns up. The first time it does, the path is guaranteed to be as short as possible.

Comparing every pair of words would be slow, so the code first files each word under patterns with one letter blanked out. head goes under _ead, h_ad, he_d and hea_; any two words sharing a pattern are neighbours.

function buildBuckets(words) {
  const buckets = new Map();
  for (const w of words) {
    for (let i = 0; i < w.length; i++) {
      const key = w.slice(0, i) + '_' + w.slice(i + 1);
      if (!buckets.has(key)) buckets.set(key, []);
      buckets.get(key).push(w);
    }
  }
  return buckets;
}

function shortestLadder(start, goal, words) {
  if (start.length !== goal.length) return null;
  const buckets = buildBuckets(words.filter(w => w.length === start.length));
  const previous = new Map([[start, null]]);
  const queue = [start];
  for (let head = 0; head < queue.length; head++) {
    const word = queue[head];
    if (word === goal) {
      const path = [];
      for (let w = goal; w !== null; w = previous.get(w)) path.unshift(w);
      return path;
    }
    for (let i = 0; i < word.length; i++) {
      const key = word.slice(0, i) + '_' + word.slice(i + 1);
      for (const next of buckets.get(key) || []) {
        if (!previous.has(next)) {
          previous.set(next, word);
          queue.push(next);
        }
      }
    }
  }
  return null; // no ladder exists in this list
}

shortestLadder('head', 'tail', myWordList);
// e.g. ['head', 'held', 'hell', 'tell', 'tall', 'tail']

The previous map does two jobs: it records which word led to each new one, so the path can be read back from the goal, and it marks words as visited, which enforces Carroll's rule that no word appears twice. The queue is read with a moving index rather than shift(), which keeps the search fast on long lists.

To build puzzles rather than solve them, run the same search outward from one word without a goal and keep the words that end up farthest away: those pairs make the hardest ladders the list allows. A null result means an aloof word or an island of words cut off from the rest.

Sources