Why unscrambling is harder than it looks
Hand someone six letters and ask for every real word hiding in them, and the honest brute-force method is to write out every possible ordering and check each one against a dictionary. The count of orderings is a factorial — multiply every whole number from 1 up to the letter count — and it grows far faster than the letter count itself. Six letters give 720 orderings. Add two more and the total jumps past forty thousand: eight letters produce 40,320 distinct arrangements. Almost none of those strings are words — "nitlse" and "iltsen" mean nothing — so brute force spends nearly all of its effort generating gibberish and testing it, one string at a time, against a dictionary of hundreds of thousands of entries.
That's tolerable for a person doodling on paper. It's not tolerable for a tool that has to answer while a page is still loading.
The sorted-letters trick
The shortcut predates computers by a long way: two words are anagrams of each other exactly when their letters, put into alphabetical order, come out identical. "Listen" and "silent" don't look alike side by side, but sort every letter in each and both produce the same six-character string. That sorted string is a fingerprint — a key — and it collapses every anagram of a word onto one identical value, regardless of how the letters were shuffled.
That single fact reframes the whole problem. Instead of "generate every ordering of these letters and check each one," it becomes "sort the letters once, then look up every dictionary word that shares this key." A lookup, not a search.
Worked example
Take listen. Strip the letters out, sort them alphabetically, and the result is eilnst. Every dictionary word that shares that exact key is a full six-letter anagram of it — here that surfaces listen, silent, tinsel, enlist. All are built from the identical six letters; only the order changes, and the sorted key never looks at order in the first place.
Why this beats brute force
Checking 720 orderings one at a time and doing one sort-and-lookup are not different sizes of the same job — they're different jobs. Sorting six letters takes a handful of comparisons. Looking up a key in an indexed database column takes roughly the same handful of steps no matter how big the dictionary behind it gets, because an index turns "find every row with this value" into a direct jump rather than a page-by-page scan. The saving isn't a faster way to generate 720 candidate strings; it's never generating them at all.
Indexing ~280,000 words, once
This site's word tools — the unscrambler, the anagram solver, the crossword solver — share one dictionary: the public-domain SCOWL word list, roughly 280,000 entries, held server-side in SQLite. Every row carries its sorted-letters key alongside the word itself, computed once when the dictionary is built and never recalculated per query. That key column is indexed, exactly like a phone book is sorted by surname rather than left in the order people signed up.
The practical effect: preparing the dictionary is a one-off cost paid offline, and every visitor's query afterwards is a cheap indexed lookup rather than a fresh read through a quarter of a million rows. The word unscrambler goes one step further than a single lookup — it matches your sorted letters against every dictionary key that is a sub-multiset of them, which is what surfaces shorter words like line and lens alongside the full six-letter anagrams. The anagram solver, by contrast, only returns exact key matches — it's stricter by design, because it answers "what uses all these letters," not "what can I make."
Wildcards and blanks reopen the search space
A Scrabble blank tile stands for any letter, and the moment one enters the rack the tidy one-key-per-word trick breaks down. A blank doesn't have a fixed sorted-letters key — it could resolve to any of 26 letters, so a rack with one blank has up to 26 different possible keys depending what that tile becomes, and a rack with two blanks multiplies that branching again. Handled naively, that's back to combinatorial growth: instead of one clean lookup, you need one lookup per plausible resolution of every blank, or a widened match against every dictionary key that's "one substitution away" from yours. That is real extra work, which is precisely why blank-aware solving is a harder engineering problem than plain unscrambling, even though both start from the same sorted-key idea.
Two shapes of the same problem
Unscrambling and crossword solving both start from a jumble of information about a word, but they ask opposite questions. Unscrambling cares which letters you have and doesn't care where they sit — any order is fine, which is exactly what a sorted key is built to ignore. A crossword clue is the mirror image: you know some letters and their exact positions, and everything else is a total unknown — order is the entire point. Give the crossword solver the pattern b??l against a small word list and it returns ball, bell, bill, bull — every four-letter word starting with b and ending in l. A pattern of all wildcards, ???, matches every word of that length, because a wildcard in every position constrains nothing but the word's length.
Under the surface these are different algorithms, not the same one run twice. The crossword solver turns each ? into a SQL LIKE wildcard and filters by length — positional pattern matching. The unscramble and anagram tools never look at position at all; they compare sorted keys. A tool that tried to answer both questions with one method would either be needlessly slow at one of them or wrong.
Frequently asked
Why not just compare every pair of dictionary words directly, instead of building keys?
Because that's quadratic: comparing roughly 280,000 words against each other pairwise is on the order of 78,400,000,000 comparisons — far worse than sorting each word once and grouping matching keys, which is proportional to the size of the dictionary, not its square.
Does the sorted-letters key ever produce a false match?
No — sorting is exact and reversible in the sense that matters here. Two words share a key if and only if they contain exactly the same letters the same number of times each. There's no approximation involved.
Why does the unscrambler show shorter words but the anagram solver doesn't?
Different questions, covered above: the unscrambler matches any sub-combination of your letters, the anagram solver only matches the full set. Use the unscrambler when you want everything your letters can build; use the anagram solver when you specifically want words that use every letter you typed.
Could this same trick solve a crossword pattern too?
Not directly — a sorted key throws away position information on purpose, and a crossword pattern is entirely about position. That's why the crossword solver runs pattern matching instead, filtering by length and matching literal characters position-for-position, with wildcards standing in for the unknowns.