# Build a word jumble generator in JavaScript, then play a daily one

> A fair shuffle, three checks that reject bad scrambles, and clue tips, with TechTwitter IO's daily buzzword Jumble as the finished example.

URL: https://claudegpt.si/news/word-jumble-generator-javascript  
Published: 2026-11-03T16:22:07.130Z  
Author: ClaudeGPT Si Newsroom  
Section: Guides  
Topics: Word jumble generator, JavaScript, Puzzles  
Publisher: ClaudeGPT Si

## Key takeaways

- A word jumble generator should use a fair shuffle such as Fisher-Yates, then reject scrambles that match the answer, spell another word or leave too many letters in place.
- Clues matter more than the shuffle; TechTwitter IO writes each Jumble clue off that morning's headlines.
- Build your own jumble for private word lists, and play TechTwitter IO's free daily Jumble when you want a finished puzzle.

A word jumble generator takes a list of answers, shuffles the letters of each one, and throws away the shuffles that make a bad puzzle. The version below is about thirty lines of JavaScript that run with Node and print rows ready to share. If you would rather play a finished one than build it, TechTwitter IO puts a new buzzword jumble in its paper every morning.

## What the output should look like

Start from a working puzzle. The [TechTwitter IO Jumble](https://techtwitter.io/#K1) for 2 November 2026 had three rows: ELMOD, with the clue Opus, for one; SNTOKE, with What you spent; and KWAAERRTM, with Invisible, on by default. Each row is scrambled letters, a short clue and an answer box sized to the word. That is the shape to aim for: letters, clue, length.

## Step 1: shuffle fairly

Use the Fisher-Yates shuffle. It walks the letters from the end and swaps each one with a random letter at or before it, which gives every ordering the same chance. The popular one-liner that sorts with a random comparator is shorter, but it does not spread the orderings evenly.

## Step 2: throw out the bad shuffles

A random shuffle on its own will now and then produce something useless, and short words make it happen more often. Check three things before you keep a scramble:

1. **It is not the answer.** A five-letter word with no repeated letters comes back unchanged once in every 120 shuffles on average, and a three-letter one once in six.
2. **It is not another word on your list.** If TENSOR comes out as STONER, a player can type a real word and be marked wrong.
3. **Most letters moved.** A scramble that leaves half the letters where they started gives too much away. The script below rejects any shuffle that keeps more than a third of them in place.

If no shuffle passes after a few hundred tries, the word is a poor fit. A word made of one repeated letter can never pass, so the function returns null and you pick another answer.

## Step 3: the script

```js
// jumble.mjs: node jumble.mjs
const shuffle = (word) => {
  const letters = [...word];
  for (let i = letters.length - 1; i > 0; i--) {
    const j = Math.floor(Math.random() * (i + 1));
    [letters[i], letters[j]] = [letters[j], letters[i]];
  }
  return letters.join("");
};

const fixed = (a, b) => [...a].filter((ch, i) => ch === b[i]).length;

function scramble(answer, dictionary) {
  for (let attempt = 0; attempt < 500; attempt++) {
    const s = shuffle(answer);
    if (s === answer) continue;                         // unchanged
    if (dictionary.has(s)) continue;                    // spells another word
    if (fixed(s, answer) > answer.length / 3) continue; // too many letters stayed put
    return s;
  }
  return null; // no scramble passed, pick another word
}

const dictionary = new Set(["MODEL", "TOKENS", "WATERMARK", "STONER", "TENSOR", "TONERS"]);
const rows = [
  { answer: "MODEL", clue: "Opus, for one" },
  { answer: "TOKENS", clue: "What you spent" },
  { answer: "WATERMARK", clue: "Invisible, on by default" },
];

for (const { answer, clue } of rows) {
  console.log(`${scramble(answer, dictionary)}  ${clue} (${answer.length})`);
}
```

Each run prints three new rows, one per answer, with the clue and the letter count after the scramble. Point the dictionary at a real word list for the second check; the six words here only keep the example short.

## Step 4: write clues people can solve

The generator is the easy half. Clues decide whether the puzzle is any good. Write them for a context your players share: this week's release, a running team joke, the day's tech news. TechTwitter IO writes every clue off that morning's headlines, so a reader who skimmed the front page gets a head start. Keep each clue to a few words and avoid using the answer's own root.

Keep answers between four and nine letters, the range in the TechTwitter IO puzzles we checked, and mix lengths so the rows do not all feel the same.

## Ideas to take it further

- Seed the random number generator with the date, so everyone who runs it on the same day gets the same scramble.
- Print the answers to a separate file, or flip them upside down the way TechTwitter IO's Yesterday's Answers panel does until you tick No peeking.
- Show one row on your new-tab page as a warm-up before the first build of the day.

## When building is worth it, and when it is not

Build your own when the words are yours: a team's in-jokes, an onboarding glossary, a class vocabulary list. No public puzzle will have those. For everything else, the TechTwitter IO version already does the work, with three to five rows a day, Check and Reveal buttons, and every back issue playable from [the Morgue](https://techtwitter.io/morgue). Just remember the paper around it is satire: its footer says the people, posts and quotes are parody or invented unless a post links to its source.

## Frequently asked questions

### How do I make a word jumble?

Pick answers, shuffle each word's letters with a fair shuffle, reject scrambles that are unchanged, spell another word or keep too many letters in place, then add a short clue and the letter count.

### Why does my word jumble generator sometimes return the original word?

A random shuffle can land on the starting order, and short words do it often: a three-letter word with no repeated letters comes back unchanged once in six shuffles on average. Check for it and shuffle again.

### Where can I play a ready-made word jumble every day?

TechTwitter IO prints a free buzzword Jumble in its Fun & Games section each morning, with three to five words and a clue for each.

## Sources

- [TechTwitter IO, Fun & Games](https://techtwitter.io/#K1), TechTwitter IO
- [TechTwitter IO, 2 November 2026 edition](https://techtwitter.io/?date=2026-11-02), TechTwitter IO
- [The Morgue: every back issue](https://techtwitter.io/morgue), TechTwitter IO
