Home Source code How to Win at Wordle Every Time

How to Win at Wordle Every Time


What is your first estimate in Wordle? Yours truly uses “farewell” for all its vowels. But there’s a better bet: if you’re playing hard mode and want to win in five attempts or less, choose scamp.

This little rascal triggers the first cup of a series of cascading algorithms that will unlock Wordle every time, guaranteed, says Laurent LessardNortheast Associate Professor of Mechanical and Industrial Engineering and New University Senior Professor Experiential AI Institute. He would know. He built them.

“When I see puzzles like Wordle, the thing that immediately comes to mind is: What’s the best way to play and win?” said Lessard. “What does it mean to have the best strategy?”

Laurent Lessard, an associate professor in the Department of Mechanical and Industrial Engineering, solved Wordle algorithmically. Photo by Matthew Modoono/Northeastern University

Lessard, who in his daily work does research on control theory and optimization, works in the moonlight as a kind of riddle detective. He solved the weekly FiveThirtyEight Riddlers for months, and posting elegant explanations on his blog, book proofswhere they’ve earned a cult following (and some shout-outs from Zach Wissner-Gross, who edits the Riddler column for data-driven media).

Then, in early 2022, a new puzzle swept the world. As the omicron reached its peak, millions of people huddled in front of their computer and phone screens, trying to guess a five-letter word every day in six attempts or less. Wordle was everywhere, even before the New York Times bought for seven digits. Just as quickly, guides supposedly offering the best way to win at the word game mushroomed. CNN even got into it.

But, says Lessard, the question is too broad, as there are a number of ways to define the “best” way to win, each with their own costs and benefits.

You can play to minimize the number of guesses needed to find the correct answer, but that requires taking big risks at first. A two-way win is impressive, and sometimes those risks pay off. But other times, you’ll need seven or eight guesses to find the answer, and that means losing.

Or, you can look for a strategy that would guarantee you find the right word in less than six tries. That might mean playing it a little safer at first – no flashy two-way Twitter broadcasts in this strategy – but you know you’ll always find the mystery word before your chances run out.

Laurent Lessard has devised a series of winning strategies based on three different ways of defining the “best way” to win. Photo by Matthew Modoono/Northeastern University

Around the same time people were sharing their local strategies online (start with “later” Where eliminate vowels as fast as possible) the Riddler asked a riddle who narrowed the survey: Devise a strategy to maximize your probability of winning Wordle in no more than three guesses.

It was something Lessard could work with, and he already had. Using the publicly available source code of Wordle, Lessard extracted the game’s two word dictionaries. One includes 2,315 mystery wordsor all possible solutions to the game. The other includes all 12,792 words you are allowed to guess. He used these lists as the foundation of his strategies.

Lots of smart features have made Wordle popular, say two Northeast experts.  Photo by Alyssa Stone/Northeastern University

To understand what Lessard did next, you must first understand how Wordle works. As mentioned, players have six chances to guess a five-letter word that changes daily. After each guess – which makes up a row in a six-level puzzle – Wordle sends a series of color-coded clues back to the player. Letters that appear in gray boxes (black square) are not in the mystery word. Letters that appear in yellow boxes (yellow square) are in the mystery word, but they are in the wrong place according to the player’s guess. And the letters that appear in green boxes (green square) are in the mystery word and in the right place.

Players can also switch between normal mode and hard mode. In normal mode, each guess can be unique and they don’t need to be tied to each other. On hard mode, they do. If you discover on your first guess that there is a “u” in the mystery word, your next guess must contain a “u”.

Taking all this into account, Lessard designed a series of winning strategies which are based on three different ways of defining the “best way” to win. The mechanisms behind these strategies contain serious calculations, which Lessard Explain in depth on the open source platform GitHub and in a more digestible format in an upcoming blog post.

Lessard was joined in his efforts by a few friends including Vincent Tjenga software engineer at Google who spotted Lessard’s work online, and Evan SparksVice President of AI and High Performance Computing at Hewlett Packard Enterprise.

One strategy, however, stands out: a comprehensive, step-by-step strategy guaranteed to win hard mode in 5 moves or less.

Fans of the game, proceed at your own risk.

Their work uses an algorithm that incorporates Wordle’s comments in hard mode. So after each guess, the computer narrows down the list of possible solutions based on which letters are known to be in the word and which are known not to be.

Lessard and Tjeng discovered that the only way to guarantee a victory in five fewer moves in hard mode is to start with “scamp” or “scowl”. Let’s say you use “scamp” as your first guess, and Wordle returns green, gray, gray, gray, gray (green square black square black square black square black square). Now the computer (and you) know that the mystery word starts with an “s” and does not contain the letters c, a, m or p. This narrows the list of possible options from 2,315 to 138.

The best word to choose next is “stern” because it matches what we know about the mystery word and contains the most commonly used letters from the remaining options. Now suppose Wordle returns green, gray, yellow, green, gray (green square black square yellow square green square black square). This reduces the possible solutions from 138 to just three: “shire”, “swear”, and “shore”. The next guess is “county”, and the answer that follows would identify the mystery word with certainty.

It is only one possible path. Lessard and Tjeng would spell out every move, depending on any outcome, in an online post. They also showed, through brute force computer research, that there is no strategy (even in normal mode) that guarantees victory in four moves or less. So five really is the best you can do!

To the hardcore wordsmith, such a plan may seem anathema to the spirit of the game. But where some see a word riddle, Lessard saw a mathematical riddle – a matter of probability and statistics that could be solved by unlocking just the right set of equations. He collaborated with friends who exchanged ideas and posted their progress online. People playing the word game select each other’s possible words and post their solution grids on Twitter.

In the end, is it really that different?

For media inquiriesplease contact Shannon Nargi at [email protected] or 617-373-5718.