Skip to content
Michael Lizzio

Wordle Solver

A Wordle solver that ranks guesses, narrows the answers, and can play automatically

  • Python
  • Selenium
  • Beautiful Soup
  • OpenCV
  • PyAutoGUI
  • Letter-frequency scoring

February 2022

Human-led
Wordle Solver running beside Wordle as it narrows the answer from LATER and NOISY to SWOON
What it is
A program that solves Wordle. It narrows down the possible answers from the colors, picks the best next guess, and in Super mode plays the game in the browser by itself.
Why I made it
When Wordle first came out in 2022, I wanted to know if I could make a program solve it consistently.
What I did
I wrote the filtering and the letter scoring in Python, then used OpenCV and later Selenium so it could read the board and type its own guesses.
How it turned out
It was my first big project, and I learned a lot in the process. It's where everything else on this site started, including the Cryptogram Solver.

The details

Choosing the next word

After every guess, the solver throws out the words that don't match the colors anymore. It counts how often each letter shows up in the words that are left, and scores each possible guess from those counts. Repeated letters count for less, so early guesses test as many new letters as possible.

Normal mode and Super Wordle

Normal mode works next to any Wordle game: I type in the five colors as numbers, and it suggests the next guess. Super mode does the whole thing itself. An early version read the tile colors from screenshots, and a later Selenium version clicked the on-screen keyboard and read each tile from the page.

I also added some deliberately bad modes that pick a random guess, a totally random word, or the worst option, mostly because it was funny to watch.

Examples

The terminal explains the color codes, suggests words and says how many answers are left after each guess.

  • Wordle Solver instructions for entering gray, yellow and green feedback and choosing manual or random guesses
  • Wordle Solver beside the browser after LATER and NOISY, with the terminal reporting four possible answers
  • Wordle Solver narrowing the candidates to SWOON and completing the browser puzzle

Videos

A full play-through of the solver and its features.