DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk5 min

Wordle Solver: How Positional Letter Counts Rank Guesses

Build a JavaScript Wordle solver that ranks guesses by positional letter frequency and filters possible answers using exact green, yellow, and gray feedback.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

You can build a useful Wordle solver by counting how often each letter appears in each position among the remaining possible answers, then scoring guesses against those counts. After every guess, simulate the game’s green, yellow, and gray feedback and discard any answer that would not produce the exact same pattern. This is a clear, inexpensive teaching heuristic—not a guarantee of optimal play.

What the solver needs to track

Wordle uses five-letter guesses and provides five color results per guess; the cited solver models a six-guess limit. A practical implementation needs a set of possible answers and a way to compare each one with the feedback received.

As an Amazon Associate I earn from qualifying purchases.

It helps to keep two word pools distinct:

  • answers: the words still possible as the hidden answer.
  • allowedGuesses: words accepted as guesses, including words that are not possible answers.

A guess from the second pool can be useful even when it cannot be the answer: it may distinguish among several remaining candidates. Josh Stephenson’s repository documents a historical set of 2,315 answers and 10,637 guess-only words; those are snapshots, not current official counts. The repository documentation also describes filtering candidates from feedback.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Score guesses using positional letter frequency

General English letter frequency is a blunt guide. A solver can make a more relevant estimate by counting letters at each position among the answers that remain possible. For example, if many candidates begin with S, that should affect the value of an S in the first position—not an S elsewhere.

  1. Start with the selected answer list as the candidate set.
  2. For each of the five positions, count how many remaining candidates contain each letter at that position.
  3. Score a word by adding the count for its letter at each position.
  4. Sort the candidate guesses by score, highest first.

Because every candidate has five letters, dividing each positional count by the number of candidates would scale every score equally; it would not change the ranking. The cited example using an original answer list reports S as most frequent in position one, A in positions two and three, and E in positions four and five. These are properties of that particular list, not universal Wordle constants.

function positionalFrequencies(candidates) {
  const counts = Array.from({ length: 5 }, () => Object.create(null));

  for (const word of candidates) {
    for (let i = 0; i < 5; i++) {
      const letter = word[i];
      counts[i][letter] = (counts[i][letter] || 0) + 1;
    }
  }
  return counts;
}

function scoreWord(word, counts) {
  return [...word].reduce((score, letter, i) =>
    score + (counts[i][letter] || 0), 0);
}

function rankCandidates(candidates) {
  const counts = positionalFrequencies(candidates);
  return [...candidates].sort((a, b) =>
    scoreWord(b, counts) - scoreWord(a, counts));
}

Here the guess pool and candidate pool are the same, so the highest-ranked guess is necessarily a remaining answer. If you want to consider all accepted guesses, score each word in allowedGuesses against frequencies calculated from answers; do not accidentally treat an allowed guess as a possible answer.

Rank #2
Boardle – Wordle-Inspired Word Game Board for Adults, Families & Couples | 2-Player Word Puzzle Board Game, Educational Vocabulary Challenge, Fun for Family Game Night
  • Wordle Experience in a Board Game – Love Wordle? Boardle brings the same addictive 5-letter word challenge to your table, no screens required. Compete in real life word-guessing duels that capture the fun of the online game in a social, face-to-face format. (This game is unaffiliated with NYT/Hasbro Wordle.)
  • Head-to-Head 2-Player Word Duel – Challenge a friend or partner in a battle of wits. Boardle is a 2-player board game where each player takes turns secretly writing a 5-letter word while their partner deciphers the other’s word through strategic guesses. It’s perfect for couples’ game nights or a quick round of competitive fun with a buddy.
  • Fun for Family Game Night & Parties – Bring family and friends together with this fast-paced word puzzle game. Play one-on-one or form teams for group play. Boardle spices up parties, classrooms, and family game nights by getting everyone thinking and laughing as they race to crack the code.
  • Build Vocabulary & Brainpower – More than just a game, Boardle is an educational word puzzle that helps expand vocabulary and sharpen spelling skills. Great for English learners and word enthusiasts, it’s an engaging tool for teachers or parents to make learning fun. (Screen-free brain teaser!)
  • Premium Quality & Complete Set – Boardle comes with a durable game board, letter tiles, color-coded clue pegs, and even a sand timer for timed rounds – everything you need for endless play. High-quality components ensure longevity, and the sleek design makes it a great gift for puzzle lovers. (Ages 14+)

Simulate feedback correctly, including repeated letters

Feedback must be exact before it is safe to prune candidates. For a guess and a possible answer, generate five results: green for an exact-position match, yellow for a present letter in another position, and gray for a guess letter with no remaining matching occurrence.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Repeated letters make a one-pass check unreliable. First mark greens and consume those answer-letter occurrences. Then, for each unmatched guess letter, mark yellow only if an unconsumed copy remains. Otherwise mark it gray. This prevents a guess with two copies of a letter from receiving two positive marks when the answer contains only one available copy.

Rank #3
5 Letter Wordlet Word Game for Family Game Night, 2–4 Players, Ages 8+
  • Guess the Secret Word: Inspired by the most popular online word game that broke the internet, 5-Letter Wordlet is the wordle style party game families and friends can enjoy together.
  • Play All Day: With 5-Letter Wordlet, the fun never ends, as players aren't limited to one word puzzle a day like the online version. Unlimited play with dry erase guessing boards and markers means unlimited fun!
  • Grab and Go Game: 5-Letter Wordlet's game boards are specifically designed to pick up and hold.
  • Party Game Night: Make it a party game night with 5-Letter Wordlet, the wordle based game that is great for evenings with friends and family, game nights, or date nights.
  • What's Inside: The 5-Letter Wordlet Word Party Game is loaded with 3 Dry Erase Guessing Boards, 3 Dry Erase Markers, 90 Guessing Chips, 200 Secret Words, and Instructions to get your game night started in five minutes or less
function feedback(guess, answer) {
  const result = Array(5).fill("gray");
  const remaining = answer.split("");

  // Exact matches consume answer occurrences first.
  for (let i = 0; i < 5; i++) {
    if (guess[i] === answer[i]) {
      result[i] = "green";
      remaining[i] = null;
    }
  }

  // Misplaced matches can use only occurrences not already consumed.
  for (let i = 0; i < 5; i++) {
    if (result[i] === "green") continue;
    const matchAt = remaining.indexOf(guess[i]);
    if (matchAt !== -1) {
      result[i] = "yellow";
      remaining[matchAt] = null;
    }
  }

  return result;
}

function filterAnswers(answers, guess, observed) {
  return answers.filter(answer =>
    feedback(guess, answer).every((color, i) => color === observed[i])
  );
}

Represent the observed pattern in the same order and with the same color labels as feedback. After each turn, replace the candidate set with the filtered result, recalculate positional frequencies, and rank again. The two-pass repeated-letter method is also described in the wordlesmith implementation documentation.

Use the loop after each Wordle turn

  1. Choose the answer list and allowed-guess list your program will use.
  2. Rank guesses using frequencies from the current answer candidates.
  3. Enter a guess in Wordle and record the five colors in order.
  4. Filter the answer candidates by retaining only words whose simulated feedback exactly matches the recorded colors.
  5. Recalculate positional frequencies from the reduced set and rank the next guess.

If filtering produces no candidates, check the recorded color order, the word-list coverage, and repeated-letter handling before changing the scoring formula. A candidate list cannot recover an answer that is missing from its underlying word list.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Frequency versus information-focused strategies

Frequency is transparent and cheap to compute, which makes it a strong baseline for learning. It is not the same objective as information gain: a high-scoring likely answer may be less useful than a guess that divides the candidates into more distinct feedback groups.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Common alternatives score a guess by the feedback buckets it creates among remaining answers:

Best Value
Hasbro Gaming Wordle The Party Game for 2-4 Players, Official Wordle Board Game Inspired by New York Times, Games for Ages 14+, Word Games
  • PLAY WORDLE IN REAL LIFE WITH FRIENDS: Inspired by the popular digital version, Wordle: The Party Game features the same gameplay fans love, but players compete in real life to solve the Wordle
  • THE WORD IS … PARTY: Swap solo play for social with this analog version of the Wordle game. Players take turns writing down a 5-letter Secret Word. The others try to guess it in the fewest tries to win
  • UNLIMITED PLAY WITH DRY-ERASE BOARDS: No more waiting for a new Wordle game. Use the Wordle dry-erase boards and markers to play as many rounds as there are players. Replay again and again
  • 4 WAYS TO WORDLE: Try the classic play or 3 variations. In fast mode, players race to solve the Wordle first. In timed mode, beat the clock—or receive more points. Or compete in groups with team mode
  • FRIENDS & FAMILY GAME NIGHT: Break out this fun game for evenings with friends or family game nights. For ages 14 and up, it’s a great gift for adults, teens, Wordle fans, and word puzzle lovers
  • Entropy: favors guesses expected to reduce uncertainty.
  • Expected remaining set size: favors guesses with smaller average feedback groups.
  • Minimax: favors guesses that minimize the largest possible remaining group.

These objectives can choose a word that is not itself a plausible answer, provided it is an allowed guess. Such a probe can clarify the set, but it may use a turn that a lucky direct answer would not need.

The wordlesmith repository reports the following average-guess results on its original 2,315-answer set when guesses are restricted to remaining answers. They are results for that project’s data and benchmark assumptions, not a universal ranking or a promise for a current game:

Strategy Reported average guesses Guess pool and answer set
Frequency 3.640 Remaining answers; original 2,315-answer set
Entropy 3.598 Remaining answers; original 2,315-answer set
Minimax 3.677 Remaining answers; original 2,315-answer set

The same repository documents a broader 14,855-word valid-guess snapshot, identified as mid-2025, and notes that performance differs when the full pool is available. Its benchmark and strategy documentation distinguishes those pools and objectives. A separate 2022 paper by Chao-Lin Liu reports a baseline average of 4.078 guesses with 1.77% of games exceeding six guesses, and a best-performing strategy averaging 3.674 guesses with 0.65% exceeding six, on the paper’s stated simulator and 2,315-word set. These results are not directly comparable to the repository figures because solver methods and benchmark procedures differ. See Liu’s paper.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Word lists and benchmark limits

Word lists change, and a historical answer list can omit a word that is accepted or used in a later version of the game. The wordlesmith project specifically cautions that its original answer set may miss legitimate answers and identifies its broader valid-word snapshot as mid-2025. Neither that snapshot nor another repository list should be described as the current official New York Times list.

When reporting a solver benchmark, specify the answer set, whether guesses are limited to remaining answers or may come from all valid guesses, and how outcomes beyond six turns are counted. Average guesses alone can conceal worst-case behavior and failures. For a teaching project, the most valuable early correctness check is usually the feedback simulator: an incorrect duplicate-letter result corrupts every later candidate set, regardless of how sophisticated the ranking is.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.