Solving Wordle with Entropy
I ran over 300 million calculations to find the best opener
Solving Wordle with Entropy
I ran over 300 million calculations to find the best opener
The motivation behind is article is the **3Blue1Brown’s video** on wordle, its an amazing video do check it out! Anyways i wanted to use wordle as an excuse to go deeper into the basics of information theory (might sound intimidating) tbh the core idea is quite intutive.
Also a quick disclaimer, I’m not expert when it comes comes to this topic this is just my attempt to break down what I understood into a simple, intuitive explanation along with enough math to make the idea meaningful.
What’s Wordle?
In case you’ve been living under a rock, here’s the basic idea behind the game, Wordle is a daily word game where you have six tries to guess a hidden five-letter word. After every guess, the game gives you feedback for each letter. A green tile means the letter is correct and in the correct position. A yellow tile means the letter exists in the word, but it is in the wrong position. A grey tile means the letter is not in the word at all.

my average worrdle attempt
So essentially, after each guess you make you get some sort of “Information” about the secret word. By the end, it's my goal to somehow bring in some fancy math to quantify this and solve this game!
Now in this article, I am going to build an algorithm for the “Hard Mode”. In normal Wordle, you can technically ignore the clues from your previous guesses and play any valid five-letter word next. Hard Mode does not allow that. Once you get a green letter, every future guess must keep that letter in the same position. Once you get a yellow letter, every future guess must include that letter somewhere in the word.
The 3-Guess Sweet Spot!
Solving the wordle in 4 attempts is pretty normal, It means you’ve played it decently used the clues properly and didn’t waste a lot of guesses. While solving the wordle in 3 attempts is just perfection 🤌🤌🤌 because getting it in one guess is basically pure luck and getting it in two is also mostly luck, unless the first guess gives you an absurdly good clue. But three guesses sits in that sweet spot which quite difficult, but not impossible!

guess distribution over 96 games
This is my guess distribution, as you can see I’m pretty shit at the game. You can clearly see the distribution is skewed towards the right with the mean guess to be around 4.5 guesses. So my motive is…** **Can i build any algorithm which is more efficient that my naive approach of guessing words randomly?
What actually makes a guess good?
Some people say “AUDIO” is the best opener, while some say use a word which has the letters “s” and “e” like “STARE” also cause a lot of 5-letter words in english start with the letter “s”. While there are others who just use whatever feels right for the day! (i am one of them)

But none of them fully convinced me. Saying “AUDIO is good because it has vowels” or “start with S because many words begin with S” still feels like guesswork. I wanted something more concrete, wanted to get my hands dirty with the numbers and actually prove, mathematically which opener gives the most useful information.
Enter Information Theory!
Information theory was developed by Claude Shannon (yes… Antrophic named the model after him) was an American mathematician and electrical engineer, in the 1940s. He was trying to figure out how do we send messages efficiently and reliably through noisy channels, like telephone wires or radio signals?

But to solve that, he first had to answer a deeper question:
How do we measure information in the first place? Some messages tell us almost nothing because we already expected them. Other messages are surprising because they rule out many possibilities at once. Shannon’s key idea was that information is connected to uncertainty. The more uncertainty a message removes, the more information it carries.
How the heck is this related to Wordle?
Before we make a guess, there are many possible hidden words. After we make a guess and see the coloured tiles, some possibilities get eliminated. Every guess is basically a message from the game telling us which words are still possible and which words are dead. So instead of asking, “Does this word feel like a good opener?”, we can ask a better question:
How much uncertainty does this guess remove on average?
Now lets get to the math part and understand underlying concepts in Information theory!
No one really knows what entropy means!
Alright that was just an exaggeration, but entropy is one of those “fancy” words that shows up in a lot of places like in physics they talk about disorder and randomness , in chemistry it shows up in thermodynamics and now in the field of information theory.
I’ll try to explain the concept with an example: Suppose tomorrow has a 75% chance of being sunny and a 25% chance of rain. If tomorrow turns out sunny, you are not going to be that surprised. Sunny was already the most likely outcome.
So mathematically, how surprised you are by an outcome is inversely proportional to the probability of that event taking place!

The reason why logarithm gets involved is because when we know an event is going to happen for sure. The suprise due to it will be 0, but if we go by out suprise ≈ 1/p. We end up with 1/1 which is 1, this is where logarithm comes and saves us by make log(1) which is zero (that’s what we want!)
Now, why log base 2 and not just base 10 or natural log?? Honestly, there is nothing magical about base 2. Claude Shannon used log base 2 in his 1948 paper, “A Mathematical Theory of Communication” because information was being measured in terms of binary choices and computers also represent information using 0s and 1s, so base 2 became the natural standard.
That is also why the unit of surprise is called a bit. One bit basically means the amount of information you get from resolving a perfect 50–50 choice, like yes/no, true/false, or heads/tails.

Entropy is essentially the weighted average of individual surprises. So when we say the entropy of this weather example is 0.81 bits, we are saying that the average uncertainty is less than one full 50–50 choice because sunny is more likely than rain. The result is not completely predictable, but it is also not maximally uncertain. If both sunny and rain had a 50% chance, the entropy would be 1 bit because both outcomes are equally possible. But here, sunny dominates, so the average surprise is lower.
Back to Wordle!
A Wordle guess works the same way. After each guess we get a feedback. Each possible feedback pattern splits the remaining answers into different groups. If one feedback pattern contains almost all the remaining words, then the guess did not help much. It barely reduced uncertainty. But if the guess splits the remaining words into many balanced groups, then no matter what feedback we get, we eliminate a lot of possibilities.

Let’s say we start our first guess with the word CRAMP. Since each letter can come back as grey, yellow, or green, there are mathematically:
3⁵ = 243, possible feedback patterns. You can think of these as 243 possible buckets that the remaining words could fall into.
But in reality, not all 243 patterns are possible. Based on the actual list of 12,966 valid five-letter guess words, only 101 feedback buckets (**my program does this calcualation — ntg fancy about it) show up for CRAMP**.
One possible bucket could be something like: R is green in position 2, and P is yellow from position 5 (**this is the feedback from the game).**
The goal now is to use this information properly and choose the next guess in a way that reduces the remaining possibilities as much as possible. Now I have a simple algorithm for this too( it just loops through all 12,966 valid guess words and checks which words fit the feedback pattern we got from CRAMP). For the above example it leaves us with 24 possible final answers.
["erupt", "gripe", "grope", "preen", "press", "pride", "pried", "print",
"prior", "privy", "prize", "probe", "prone", "prong", "proof", "prose",
"proud", "prove", "prowl", "proxy", "prude", "prune", "tripe", "trope"]
Now out of these 24 possible answers, which one is the best second guess? As in which word gives us the most useful information after we play it. In other words, we want the guess that splits these 24 words into the cleanest and most balanced feedback buckets.
If our second guess is ERUPT (**choosing cause it’s the first word), the 23 remaining words split into 8 different feedback buckets*, with each bucket containing a different number of possible answers. Some buckets are small, which is good because they narrow things down quickly. Some buckets are larger, which means the feedback would still leave us with multiple options. We can finally calculate its entropy and measure how much information this guess is expected to give us:*

comparing the other 23 words with ‘ERUPT’
We can finally calculate it’s entropy and measure how much information this guess is expected to give us

math behind the algorithm
Now that we have done this for ERUPT, we repeat the same process for the other 23 possible answers if I play this word, how does it split the 24 remaining answers into feedback buckets? Then we calculate the entropy of that split. The word with the highest entropy is the best second guess because it is expected to give us the most information.
A high-entropy guess breaks the remaining possibilities into cleaner buckets, which helps us narrow down the correct answer in fewer attempts.
Top entropy (out of the 24 possible answers):
1. PRONE entropy = 3.605
2. PREON entropy = 3.491
3. PRIDE entropy = 3.320
4. GROPE entropy = 3.304
5. PRION entropy = 3.272
6. GRIPE entropy = 3.241
7. TROPE entropy = 3.236
8. PROSE entropy = 3.236
9. TRIPE entropy = 3.205
10. PROVE entropy = 3.205
Our word ERUPT was nowhere close... It only had an entropy of 2.5 bits, while PRONE had a much higher entropy of 3.605 bits. That means PRONE was expected to split the remaining 24 words much better and give us more useful information.
So we play PRONE as the second guess and finish the game, i got “P”, “R”, “N” in the right positions! (feedback from the game) which leaves us with the only possible word which is…..

After CRAMP and PRONE, the solver narrows the answer down to PRINT.
Entropy is really powerful!
As of when I’m writing this article (3 July 2026), I wanted to test my algorithm. I started with SLATE (**will tell you why later) and got yellow for “A” and “T”. After feeding this into the program, the solver gave me a pretty bizzare second guess “TAINT”**.

Screenshot from the Wordle solver program.
At first, I genuinely thought this was stupid. A double T as the second guess? Really??? My instinct was to play something cleaner like HABIT, because it looked more “normal” and still used the clues properly.
Entropy can see something that we humans can’t perceive, it was picking the word that was expected to split the remaining possibilities best. And after playing TAINT, the feedback narrowed everything down to a single answer!

wordle on 3 july’26 🤯🤯🤯
Which Word Should You Start With?
At the start of the game, we have no clues at all. So finding the best opener is basically the same problem as before, just on a much larger scale. Earlier, we calculated entropy for a guess by checking how it split 24 remaining words into feedback buckets. For the opener, we do the exact same thing, except now we test every possible starting guess against the full Wordle answer list.
So for each of the **12,966 valid guess words, the algorithm compares that word against every possible answer and records the feedback pattern it would produce. If we use the standard Wordle answer list of about [2,315](https://www.kaggle.com/datasets/cprosser3/wordle-5-letter-words) possible solutions (*around 10,651 words are allowed as guesses but will never be chosen as the hidden answer words like REAST* fall into this category useful for collecting information, but not realistic final solutions.)
12,966 × 2,315 ≈ 30,015,000, 30 million comparisons just to rank the best opening word!
My poor macbook took 34.7 seconds to compute this and here’s the result:

expected_remaining = the average number of possible answers left after playing that word. Lower is better
But I was not fully satisfied with just thIS result. There was nothing technically wrong with it, but it felt like something was missing. This tells us which opener gives the most information immediately after the first guess but again, Wordle is not a one-move game. What if a word is slightly worse on the first guess, but puts us in a much better position for the second guess?
Two-stage Entropy approach
For full two-stage entropy, we would need to do that second-guess search for every possible first-guess outcome, across every possible opener
12,966 × 12,966 ×2,315 ≈ 389 billion calculations, this would take ages to complete :(
Instead of brute-forcing two-stage entropy for all 12,966 words, I took the top 10 words from the one-step entropy ranking and ran the two-stage calculation only on those. This is quite reasonable cause the best opener is unlikely to suddenly come from somewhere far down the list. More realistically, the top few words might just shuffle around once we look one move deeper. So instead of wasting hours testing everything, I focused on the candidates that were already performing well.
10 × 12,966 ×2,315 ≈ 300 million calculations, took around 5min 50sec to come up with the final ranking!

result after two-stage entropy
So yeah… we have a winner 🏆🏆🏆 “SLATE” is mathematically the best opener in wordle! (hard mode)
Let’s look at how my wordle_solver.py perform!
I wrote a Python program that simulates the game for every possible Wordle answer. For each hidden word, the solver starts with SLATE, reads the feedback, filters the remaining candidates, chooses the next guess using entropy, and keeps going until it either finds the answer or runs out of attempts.
Functions in wordle_solver.py
* legal_hard_guess(): checks whether a guess follows the Hard Mode constraints.
* entropy(): splits the remaining answers into feedback buckets and calculates
how much information a guess gives.
* get_entropy_suggestions(): ranks all legal guesses by entropy and suggests
the best next moves.
* simulate_game(): runs the solver against a hidden answer and records how
many guesses it takes.
The results were honestly better than I expected. Out of 2,315 possible Wordle answers, the solver successfully solved 2,307 of them within six tries. That gives it a success rate of about 99.65%. The average number of guesses was around 3.53, and more than half of the words were solved within three guesses.

wordle_solver.py performance
Things I coded but did not explain here!
There are few things which i deliberately didn’t go through because they are not quite relevant to information theory:
- Commonness Score: Entropy is great when there are many possible answers left because we care about getting information but when the answer pool becomes small, pure entropy is not always the best move. At that stage, it may be better to guess a word that is more likely to actually be the answer. So I added a commonness score using word frequency (wordfreq library), which helps rank words based on how commonly they appear in English.
- Practical Fallback: When there are still many possible answers, it focuses on entropy and tries to reduce uncertainty. But when the list becomes small enough (less than 10 words — hardcoded), it starts caring more about whether the word is a realistic final answer.
If you are curious, you can take a look at **my repo!**
Information Theory Is Bigger Than Wordle
I used Wordle because it is a simple and fun way to see entropy in action, but the same idea of measuring and reducing uncertainty shows up in a lot of other fields.
- Data compression — reducing file sizes by encoding common patterns more efficiently.
- Communication systems — sending messages reliably through noisy channels.
- Cryptography — measuring randomness and uncertainty in secure keys and encrypted messages.
- Machine learning — using entropy in decision trees, classification, uncertainty estimation, and model evaluation.
And with that we are done 🎉🎉🎉… it was one hell of a ride! what started off as a simple guessing game had so many concepts hidden inside. We looked at how information theory could be leveraged to solve the game mathematically.
Always stay curious!
메타데이터
- post_id
- 4f4b20fb710e
- slug
- solving-wordle-with-entropy-4f4b20fb710e
- url
- https://medium.com/@thisisnotmygoooglemailid/solving-wordle-with-entropy-4f4b20fb710e
- canonical_url
- https://medium.com/@thisisnotmygoooglemailid/solving-wordle-with-entropy-4f4b20fb710e
- author_url
- https://medium.com/@thisisnotmygoooglemailid
- status
- ok
- fetched_at
- 2026-07-15 19:22:58