How Word Unscramblers Work
The algorithm, the dictionary, and every trick in between.
Type ‘RETINAS’ into a word unscrambler and, in the blink of an eye, you get 60+ valid English words back. That feels like magic — but under the hood it's a small, elegant set of tricks that any programmer can understand. This guide walks through exactly how a modern unscrambler works: the data structures, the dictionaries, the wildcards, and the filters that make the whole thing fast enough to feel instant.
Along the way we'll look at trade-offs (why a naïve approach falls over on 10+ letters), what a ‘real word’ actually means (spoiler: it depends on the game), and how tools like WordUnscramble.uk return every valid answer in milliseconds, in your browser, without ever sending your letters to a server.
The problem, stated precisely
A word unscrambler answers a single question: given a multiset of letters L (with optional wildcards), return every word W in a dictionary D such that W can be spelled using a subset of L. Two details matter. First, it's a multiset — the letters ‘SEE’ contain two E's, not one, so ‘EEL’ needs an extra E to be valid. Second, we usually want subsets, not exact matches, so ‘RETINAS’ should return ‘SIT’, ‘RATE’, and ‘STAINER’ alike.
Stated that way, the problem is easy to describe but expensive to solve by brute force. There are 2^n subsets of n letters, and for each subset we'd need to check every permutation against the dictionary. For 15 letters that's 32,768 subsets × up to 1.3 trillion permutations. No good.
The trick: sort the letters
The insight that makes unscramblers fast is that two words are anagrams of each other if and only if their sorted letters are identical. ‘LISTEN’ and ‘SILENT’ both sort to ‘EILNST’. So do all their anagrams. If we pre-sort every word in the dictionary once, we can group anagrams together with the sorted string as the key.
Dictionary Anagram map
-------------- ---------------------------
LISTEN EILNST -> [LISTEN, SILENT,
SILENT TINSEL, ENLIST]
TINSEL ADEHR -> [HEARD, HADER]
ENLIST ...
HEARD
HADERThe dictionary side is now O(n log k) — n words, each sorted in k characters. It's done once, at load time. From then on, every lookup is a hash-map probe.
From anagrams to sub-anagrams
Anagram lookup is powerful, but users want sub-anagrams too — every word that can be built using some of their letters. The naive approach — enumerate every subset of the input, sort it, look it up — actually works for small inputs. For 15 letters that's 2^15 = 32,768 subsets. Each lookup is O(1). Total: about 33,000 hash probes, or a few milliseconds in JavaScript. Fast enough.
Bigger inputs need smarter algorithms — a common one is to walk the anagram map's keys and, for each key, check whether every letter it uses is available in the input's letter-count vector. That runs in O(m) where m is the number of unique sorted-keys in the dictionary (~130,000 for ENABLE), and each check is 26 integer comparisons. Also fast.
Wildcards: the blank tile
Scrabble and Words With Friends both include blank tiles — a tile that can stand for any letter. Word unscramblers express this as ‘?’ or ‘*’. Handling wildcards is straightforward: for each wildcard, expand it into every possible letter (a..z) and union the results.
The naive expansion is exponential in the number of wildcards — with 3 wildcards you'd search 26³ = 17,576 combinations. In practice, most tools cap wildcards at 2–3 for this reason, and use a smarter approach: for each candidate word in the dictionary, count how many letters are missing from the input; if that number is ≤ the wildcard count, it's a match.
Dictionaries: what counts as a ‘real’ word
‘Real’ is game-specific. Here are the main English word lists in use:
| Word list | Size | Where it's used |
|---|---|---|
| TWL06 (Tournament Word List) | ~178,000 | Official Scrabble in North America |
| SOWPODS / Collins Scrabble Words | ~279,000 | International Scrabble tournaments |
| ENABLE | ~172,000 | Open-source games, most word unscramblers |
| YAWL | ~264,000 | Older open list, superset of ENABLE |
| Zynga list | ~180,000 (proprietary) | Words With Friends |
Most public unscramblers, including WordUnscramble.uk, use ENABLE. It's open, well-tested, and overlaps heavily with TWL and Words With Friends. If a rare word is missing, it's almost always because ENABLE excludes it — not because the algorithm failed.
Filters and why they're really cheap
Every filter — starts-with, ends-with, contains, required letter, exact length — is just an additional predicate applied to the candidate list before or after the sub-anagram check. Because the candidate list is already small (usually <200 words), even a naive scan is instant. Filters that can be pushed earlier (like exact length) are pushed earlier.
- starts-with / ends-with — string prefix / suffix check
- contains — substring check anywhere in the word
- required letter(s) — every listed letter must appear
- length — length equal to N
Multi-word solutions
Games like Wordscapes and Boggle sometimes need two shorter words that together use every tile. The standard trick is to enumerate one word W1 from the unscrambler, subtract its letter counts from the input, and run the unscrambler again on the remainder. That's O(k²) in the number of candidate words, so the tool typically caps results and requires a minimum word length (3+) to stay fast.
Performance in the browser
A well-built unscrambler runs entirely in the browser. Advantages: your letters never leave your device (privacy), and there's no network round-trip (speed). The dictionary — about 1.5 MB compressed — is loaded once and cached. From then on, every search is a few milliseconds of pure JavaScript.
Common pitfalls
- Forgetting that letters are a multiset (allowing ‘EEL’ from ‘SEE’ is a bug).
- Case sensitivity — normalise to lower case before sorting.
- Non-Latin characters — strip everything that isn't a-z (or handle diacritics if you support them).
- Wildcards outside the alphabet — treat ‘?’ and ‘*’ as the only accepted wildcards.
- Returning fabricated words — never generate a word not present in the source dictionary.
Summary
- ✓Unscramblers sort letters to reduce anagram lookup to a hash-map probe.
- ✓Sub-anagram search runs in a few milliseconds even for 15 letters.
- ✓Wildcards are handled by comparing missing letters against the wildcard count.
- ✓Every returned word comes from a real, traceable dictionary — nothing is invented.
Frequently asked questions
Is the algorithm the same in every unscrambler?
The core ideas are shared — sort letters, use a hash map, count letter multiplicities — but each tool differs in wildcard handling, filter richness, and which dictionary it ships.
Can it run offline?
Yes. Once the dictionary is downloaded, no network is needed. WordUnscramble.uk works with the tab open even if your Wi-Fi drops.
Why do some tools show ‘ZA’ and others don't?
‘ZA’ is valid in TWL and SOWPODS Scrabble but is not in every English dictionary. It depends on the list the tool ships.
Is longer input slower?
Slightly — the number of subsets grows exponentially — but modern JS engines can still handle 15 letters in a few milliseconds.
References & further reading
- Merriam-Webster Dictionary — general English word validity and definitions.
- Collins English Dictionary — source lexicon for SOWPODS / Collins Scrabble Words.
- Wiktionary — collaborative dictionary with usage notes and etymologies.
- Moby Project (Wikipedia) — background on the ENABLE word list used by our tool.
- See Content Standards for the full list of dictionary sources and how content is reviewed.
Related articles
How to Improve Vocabulary
Twelve evidence-based techniques for building a bigger, sharper vocabulary — spaced repetition, reading tiers, word roots, active retrieval and more.
Understanding Anagrams
Everything about anagrams: the definition, the history, the techniques to solve them fast, and the famous anagrams that reveal hidden meaning in ordinary words.
British vs American Word Lists
The differences between British and American word lists for Scrabble, Words With Friends and other games — TWL vs SOWPODS, spelling variants and which is used where.
Word Game Tips for Beginners
A friendly, universal guide for beginners in word games: shared skills across Scrabble, Words With Friends, Wordle, Wordscapes and Boggle — with 25 concrete tips.