TECHNICAL GUIDE

How Anagram Solvers Work — Algorithm Explained

An anagram solver takes a set of letters and returns every valid word those letters can form — in milliseconds. This guide explains exactly how that works: the algorithms, the data structures, the edge cases, and the differences between solver types. No programming experience required.

What Is an Anagram Solver?

An anagram solver is a tool that accepts a set of letters as input and returns all valid English words that can be formed from those letters. The letters can be used in any order — but each letter can only be used as many times as it appears in the input. Enter LISTEN and a solver returns SILENT, ENLIST, TINSEL, INLETS, LITE, LINE, SINE, and dozens more.

The key insight that makes this computationally tractable: anagram detection is a comparison problem, not a generation problem. Rather than trying to construct words by rearranging letters (which would be computationally expensive), modern solvers check each word in a pre-built database against the available letters. This turns an exponentially complex generation task into a linear scan.

For the foundational definition of anagrams themselves, see our guide: What Is an Anagram?

InputModeResults IncludeUse Case
LISTENExactSILENT, ENLIST, TINSEL, INLETSAnagram finding
LISTENSubsetAll exact results plus TILE, LINE, LITE, LENS, SINE...Scrabble, word games
SILEN?Subset + wildcardSILKEN, LINERS, LINSEY (? = any letter)Blank tile solving
5-letter filterSubsetOnly 5-letter resultsWordle solving

How Humans Find Anagrams Manually

Before digital solvers, anagram enthusiasts used a combination of pattern recognition and systematic trial and error. A skilled human anagrammatist working manually with TRIANGLE might:

  1. Group vowels (I, A, E) and consonants (T, R, N, G, L)
  2. Look for common word endings: -ING (TRIANGLE has I, N, G), -ATE, -ALE, -ATE
  3. Try TRIANGL-E: does INTEGRAL work? I, N, T, E, G, R, A, L — yes, all letters present
  4. Systematically attempt combinations until all valid words are found

This process is effective for short words but becomes impractical for longer ones. TRIANGLE has over 40,000 possible letter permutations. Checking each manually against a dictionary is not feasible. This is the problem digital solvers solve — they check all possibilities systematically and instantly.

The Alphabetical Sorting Method

The simplest algorithm for detecting anagrams is alphabetical sorting. The principle: if two words are anagrams of each other, sorting their letters alphabetically produces identical strings.

How It Works — Step by Step

WordIndividual LettersSorted AlphabeticallyAnagram Match?
LISTENL, I, S, T, E, NE, I, L, N, S, TAll four produce EILNST → All anagrams of each other ✅
SILENTS, I, L, E, N, TE, I, L, N, S, T
ENLISTE, N, L, I, S, TE, I, L, N, S, T
TINSELT, I, N, S, E, LE, I, L, N, S, T
CASTLEC, A, S, T, L, EA, C, E, L, S, TACELST ≠ EILNST → Not an anagram ❌

This method works reliably and is easy to understand. However, it has a practical limitation for database scanning: sorting a candidate word's letters on every check adds processing overhead. For a database of 270,000 words, this overhead accumulates. This is why most production solvers use the frequency map approach instead — which achieves the same result with a simpler comparison operation.

The TRIANGLE Family via Sorting

TRIANGLE sorted = A, E, G, I, L, N, R, T = AEGILNRT

Any word that sorts to AEGILNRT is an anagram of TRIANGLE. Four valid English words do: ALERTING, INTEGRAL, RELATING, TANGLIER — all sort to AEGILNRT. This is why the TRIANGLE family is celebrated: four valid eight-letter anagrams from one letter set is exceptional.

Letter Frequency Matching

The frequency map method is the most widely used approach in modern anagram solvers. Instead of sorting letters, it converts input into a character frequency map — a data structure that records how many times each letter appears.

Building a Frequency Map

Input WordFrequency MapTotal Letters
LISTENL:1, I:1, S:1, T:1, E:1, N:16
TRIANGLET:1, R:1, I:1, A:1, N:1, G:1, L:1, E:18
RETAINSR:1, E:1, T:1, A:1, I:1, N:1, S:17
AELSTA:1, E:1, L:1, S:1, T:15
STRESSEDS:2, T:1, R:1, E:2, D:18

How the Comparison Works

Once the input frequency map is built, the solver scans its word database. For each candidate word, it builds that word's frequency map and compares it to the input map.

In Exact mode: the two maps must be identical. LISTEN's map is {L:1,I:1,S:1,T:1,E:1,N:1}. SILENT's map is {S:1,I:1,L:1,E:1,N:1,T:1}. Identical — valid result. CASTLE's map is {C:1,A:1,S:1,T:1,L:1,E:1}. Different — rejected.

In Subset mode: every letter in the candidate word's map must be present in the input map with an equal or greater count. The candidate does not need to use every input letter. For LISTEN's map, a candidate word LIT {L:1,I:1,T:1} passes — all three letters are present in sufficient quantity in the input. This is how Scrabble rack analysis works: find all valid words the rack can make, regardless of which tiles remain unused.

Why STRESSED = DESSERTS

STRESSED has eight letters: S, T, R, E, S, S, E, D. The frequency map is {D:1, E:2, R:1, S:3, T:1} — S appears three times, E appears twice, and D, R, T each appear once.

DESSERTS has eight letters: D, E, S, S, E, R, T, S. The frequency map is {D:1, E:2, R:1, S:3, T:1} — identical to STRESSED in every position. The two words are confirmed anagrams.

As a further curiosity, DESSERTS spelled backwards is STRESSED — making this pair both a perfect anagram and a perfect reversal simultaneously, which is exceptionally rare in English.

The Complete Solver Workflow

Here is how a typical modern anagram solver processes a query from input to results:

StepOperationExample (input: LISTEN)
1Receive inputUser types "LISTEN"
2Normalise inputConvert to uppercase, strip spaces: "LISTEN"
3Identify wildcardsCount ? characters (zero in this case)
4Build frequency map{L:1, I:1, S:1, T:1, E:1, N:1}
5Apply length filterMinimum 3 letters (default), maximum 6 (input length, exact mode)
6Scan word databaseCheck each of 270,000 words against the frequency map
7Validate each wordDoes SILENT fit within {L:1,I:1,S:1,T:1,E:1,N:1}? Yes. Does CASTLE? No.
8Calculate scoresScore each result using Scrabble tile values: ENLIST = 6pts
9Sort resultsBy length, Scrabble score, or alphabetically per user preference
10Group by length6-letter: SILENT, ENLIST, TINSEL, INLETS; 5-letter: LIENS, LENIS...
11Return resultsDisplay to user with length tabs and copy functionality

The AELST Example — Most Productive 5-Letter Set

AELST (A:1, E:1, L:1, S:1, T:1) is the most productive 5-letter letter set in English. Running this through exact mode returns six valid common words: SLATE, STALE, LEAST, TALES, STEAL, TESLA. Each of these six words has an identical frequency map to the others — they form an anagram family. This is an unusually high yield for a 5-letter set; most 5-letter combinations produce one or two valid exact anagrams.

Wildcard Processing

Wildcard support — typically represented by the ? character — is one of the most practically useful features in anagram solvers. It represents any single letter and is used for blank Scrabble tiles, partially known crossword answers, and exploratory word finding.

How One Wildcard Is Processed

When input contains one ?, the solver runs 26 parallel checks — one for each letter of the alphabet substituted for the wildcard. For SILEN?, the solver checks SILENA, SILENB, SILENC... through SILENZ. For each substitution, it builds the frequency map and runs the standard database scan. Valid results from all 26 passes are collected and deduplicated.

Wildcard InputSubstitutions TriedValid Results Found
SILEN?SILENA through SILENZ (26)SILKEN (K=SILKEN), LINERS (R=LINERS), LINSEY (Y=LINSEY), LISTEN (T=LISTEN)
??STEN676 combinations (26×26)FASTEN, HASTEN, LASTEN, and all valid completions
L?STEN26 combinationsLISTEN (I substituted), FASTEN and HASTEN require different letter sets — only LISTEN is valid from L?STEN

Two Wildcards

Two wildcards multiply the search by 26 twice — 676 substitution combinations per word in the database. This is more computation, but well-optimised solvers complete the full database scan across all substitutions quickly. The practical benefit is significant: two blank Scrabble tiles dramatically expand the available words, and a solver that handles double wildcards is far more useful for competitive play.

Exact Mode vs Subset Mode

This distinction is the most practically important one for users. Both modes use the same frequency map algorithm — they differ only in what constitutes a valid match.

FeatureExact ModeSubset Mode
Match requirementResult must use every input letter exactly onceResult can use any combination of input letters
Result lengthMust equal input letter countAny length up to input count
Primary use caseJumble puzzles, anagram creation, Text TwistScrabble, Boggle, Bananagrams, word finding
LISTEN resultsSILENT, ENLIST, TINSEL, INLETS onlyAll exact results plus TILE, LENS, LINE, SINE, LET, TIN...
Result countFewer — all letters must be usedMore — partial combinations included
Algorithm differenceMaps must be identicalCandidate map must fit within input map

RETAINS in Both Modes

RETAINS (R:1, E:1, T:1, A:1, I:1, N:1, S:1) demonstrates the difference clearly.

Exact mode results (all 7 letters used): NASTIER, STAINER, STEARIN, ANTSIER, RETAINS — five valid 7-letter anagrams. This is the AEINRST family, the most productive 7-letter set in Scrabble, where each result earns the 50-point bingo bonus.

Subset mode results include all exact results plus shorter words: RETAIN, RATINE, TRAINS, RAINS, NEARS, EARNS, RATES, TEARS, RANTS, TINS, AIRS, and hundreds more — any valid word whose letters are available within the RETAINS rack.

To try both modes on any letter set, visit our Anagram Solver and use the mode selector.

Scrabble Rack Solving

Scrabble solvers are subset mode anagram solvers with one additional feature: Scrabble score calculation. For each valid word in the results, the solver calculates the base Scrabble point value by summing the official tile values of its letters.

Scrabble Score Calculation

LetterValueLetterValueLetterValue
A, E, I, O, U, L, N, S, T, R1ptD, G2ptsB, C, M, P3pts
F, H, V, W, Y4ptsK5ptsJ, X8pts
Q, Z10ptsBlank tile0pts

When results are sorted by Scrabble score, the highest-value plays appear first. A player holding RETAINS sees NASTIER (7pts base) at the top of score-sorted results — but the real value comes from the 50-point bingo bonus for using all 7 tiles, making each of these results worth 57pts minimum before premium squares.

Blank Tile Handling in Scrabble

Blank tiles are represented by ? in the solver. They contribute 0 points when used. The solver correctly assigns zero value to the letter a blank substitutes for — so if ? substitutes for Z in a word, that Z scores 0 points rather than 10. This is the official Scrabble rule for blanks.

Try our Scrabble Solver for full rack analysis with score sorting and bingo finding.

Performance and Database Size

Two factors determine how useful an anagram solver is in practice: how fast it processes queries and how many words its database contains.

Database Size

Word ListApproximate SizeUsed ForCoverage
TWL (Tournament Word List)~178,000 wordsNorth American ScrabbleStandard for US/Canada tournament play
SOWPODS~267,000 wordsInternational ScrabbleIncludes all TWL words plus 89,000 more
ENABLE~173,000 wordsWords With FriendsDifferent from TWL — some words differ
Standard English dictionary470,000+General vocabularyIncludes proper nouns, technical terms
Combined (TWL + SOWPODS + English)270,000+ uniqueComprehensive solvingBest coverage for all word games

A solver is only as complete as its word list. A solver using only TWL misses approximately 89,000 words valid in SOWPODS. A solver missing common English words will fail to find valid results that any standard dictionary would include. Database completeness is the primary quality differentiator between anagram solvers.

Processing Speed

Modern solvers process queries quickly through several design choices. Pre-loading: the word database is loaded into memory on first use rather than fetching from a server on each query. Local processing: browser-based solvers run entirely on the user's device, eliminating network round-trips. Efficient data structures: frequency maps enable constant-time letter checking rather than character-by-character comparison.

Server-based solvers introduce network latency on top of processing time. A query that processes locally in milliseconds becomes noticeably slower when it requires a round-trip to a server. For interactive use — where users expect immediate results — local processing is significantly better from a user experience perspective.

Algorithm Comparison

MethodHow It WorksStrengthsLimitations
Alphabetical sortingSort both words; compare sorted formsSimple; easy to understand and implementSorting overhead on every comparison
Frequency mapCount letter occurrences; compare mapsFast comparison; handles subset mode naturallyMap construction step required
Hash-basedHash the sorted letters; compare hashesVery fast lookup in pre-built databasesPre-computation required; less flexible
Trie / prefix treeNavigate tree structure by letterEfficient for pattern matching with known positionsMore complex; better for crossword than anagram

Can AI Solve Anagrams?

Large language models like GPT-4, Gemini, and Claude can suggest anagram solutions, but they approach the problem differently from dictionary-based solvers — and with different reliability characteristics.

How Language Models Handle Anagrams

Language models generate text by predicting likely next tokens based on patterns learned from training data. When asked for anagrams of LISTEN, a language model may correctly suggest SILENT (a well-known pair) but is less reliable at finding TINSEL or INLETS — words that are valid but less commonly associated with LISTEN in text. The model generates plausible-sounding answers rather than systematically checking all valid words.

For common short anagrams, language models perform well. For exhaustive results — finding every valid word from a 7-tile Scrabble rack — dictionary-based frequency map solvers are both faster and more complete. No language model reliably finds all valid Scrabble words from an arbitrary 7-tile combination without missing some valid plays.

Where AI Adds Value

AI tools are genuinely useful for adjacent anagram tasks: explaining why two words are anagrams, generating creative phrase anagrams (where judgment about meaning matters), or suggesting which anagrams have semantic connection to the original. These tasks require language understanding rather than exhaustive enumeration — exactly what language models are good at.

For exhaustive word finding from a letter set, use a dictionary-based solver. For creative wordplay and semantic anagram suggestions, language models can be a useful complement.

Word Unscrambler vs Anagram Solver

These terms are often used interchangeably. The underlying algorithm is identical in both cases. The practical difference is in how they are applied:

ToolTypical UseModeExpected Output
Word UnscramblerFinding the correct answer in a puzzle (Jumble, Text Twist)Exact — all letters requiredThe specific word the puzzle intends
Anagram SolverExploring all words a letter set can produceExact or SubsetComplete list of all valid words
Scrabble SolverFinding highest-scoring rack playSubset + score sortAll valid plays, ranked by points
Word FinderFinding words from available letters for any gameSubsetAll valid words from the letter pool

Our Word Unscrambler and Anagram Finder both use the same frequency map algorithm — the mode selector determines which type of results you see.

Frequently Asked Questions

How do anagram solvers work?
Most modern anagram solvers convert input letters into a character frequency map, then scan a word database checking each word against that map. Words whose letter requirements fit within the available letters are returned as results. The entire process typically completes in milliseconds.
What algorithm do anagram solvers use?
The most common approach is letter frequency matching: convert input to a frequency map (e.g. LISTEN → {L:1,I:1,S:1,T:1,E:1,N:1}), then check each dictionary word against that map. An alternative is alphabetical sorting — sort both input and candidate word, then compare. Both methods produce identical results.
How accurate are anagram solvers?
Accuracy depends entirely on the word database used. Solvers using comprehensive dictionaries like SOWPODS (267,000+ words) or combined TWL and standard English lists return all valid words. Solvers with smaller databases miss valid words. A solver is only as complete as its word list.
How does Scrabble rack solving work?
Scrabble solvers use subset mode: they find all words whose letter requirements fit within the available rack tiles, without requiring every tile to be used. Results are additionally sorted by Scrabble point value, calculated using official tile scores.
What is the difference between exact mode and subset mode?
Exact mode requires every input letter to appear in every result, used once each. Subset mode allows results to use any combination of the input letters. Exact mode is used for Jumble puzzles and anagram creation. Subset mode is used for Scrabble rack analysis and word finding.
How do wildcards work in anagram solvers?
A wildcard (?) represents any letter. The solver tries all 26 possible letter substitutions for each wildcard position. For one wildcard, this multiplies the search by 26. For two wildcards, by 676. Well-optimised solvers complete this extended search in the same sub-second timeframe.
Can AI solve anagrams?
Large language models can suggest anagrams but are unreliable for exhaustive results — they generate plausible-sounding words rather than systematically checking all valid words. A dictionary-based frequency map solver is both faster and more accurate for anagram solving than current AI approaches.
Why does letter order not matter in an anagram solver?
Because the frequency map algorithm counts occurrences of each letter rather than recording their sequence. LISTEN and TINSEL produce identical frequency maps ({E:1,I:1,L:1,N:1,S:1,T:1}), so they return identical results.
How do solvers handle repeated letters?
The frequency map tracks exact counts. If input is AABCD, the map is {A:2,B:1,C:1,D:1}. A result word requiring A:3 would be rejected. A result requiring A:1 would be accepted. Repeated letters in both input and results are handled correctly by frequency comparison.
What makes one anagram solver better than another?
Three factors: database size (more words = more complete results), algorithm efficiency (faster processing), and feature set (wildcard support, length filtering, score sorting, game-specific modes). A solver with 270,000+ words, sub-second processing, and wildcard support covers all practical use cases.
How does alphabetical sorting detect anagrams?
Sort both words alphabetically, then compare. LISTEN sorted = EILNST. SILENT sorted = EILNST. Identical sorted forms confirm they are anagrams. This method is simple and reliable but less efficient for scanning large databases than frequency maps.
How do crossword solvers differ from anagram solvers?
Crossword solvers use pattern matching — known letters occupy specific positions, unknown positions are represented by wildcards. An anagram solver finds words from a letter pool regardless of position. Many tools combine both: position-constrained search with optional anagram mode.
How fast can modern anagram solvers process results?
Browser-based solvers using pre-loaded dictionaries typically return results in under one second for most inputs. Server-based solvers add network latency on top of processing time. The speed depends on database size, algorithm efficiency, and whether processing occurs locally or remotely.
What word database do anagram solvers use?
Different solvers use different databases. Common sources include TWL (Tournament Word List, North American Scrabble), SOWPODS (international Scrabble, 267,000+ words), ENABLE (Words With Friends), and standard English dictionaries. The database determines which words appear in results.
How does a word unscrambler differ from an anagram solver?
They use the same underlying algorithm. The difference is in how they are used: a word unscrambler typically runs in exact mode to find a single correct answer from scrambled puzzle letters. An anagram solver explores all possible words from a letter set, often in subset mode.