Last updated: March 29, 2026
Break a hidden color code by using black and white peg clues after each guess.
Loading game...
Mastermind was invented in 1970 by Mordecai Meirowitz and became a major code-breaking board game after Invicta Plastics released it in the early 1970s. The idea descends from Bulls and Cows: one player hides a code, and the other uses feedback to narrow it down. Online, the computer sets the hidden pattern. Each guess gives exact-position and wrong-position clues. The challenge is information. A good guess does not just try to win; it splits the remaining possibilities. Start guessing and decode the pattern.
You guess red, red, blue, blue and get no pegs. Red and blue are not in the code at all.
You know green is in the code. Guess green in position one. If black feedback increases by one, green belongs there.
A guess with two yellows returns only one clue. At most one yellow appears in the hidden code.
Play Mastermind online for free. Test colors, interpret feedback pegs, and narrow the hidden code with each guess.
| Version | Difficulty | Players | Typical Time |
|---|---|---|---|
| 4 Pegs, 6 Colors | Medium | 1 | 5 to 12 min |
| No Repeats | Easy | 1 | 4 to 10 min |
| 5 Pegs | Hard | 1 | 8 to 18 min |
| Hard (5 Pegs, 8 Colors) | Hard | 1 | 10 to 20 min |
| 6 Pegs, 8 Colors | Expert | 1 | 12 to 25 min |
Black means correct color and position. White means correct color in the wrong position.
In the common rule set, yes. Some beginner modes disable repeats.
A balanced guess with repeated pairs can test both color presence and duplicate rules.
A test guess can split the remaining possible codes into smaller groups. For example, if you already know two colors, a guess that rearranges them with two new colors may reveal both position information and color absence. This is the idea behind Donald Knuth's well-known five-guess approach: choose moves that shrink the worst remaining case, not only moves that look close. Keep each guess consistent with every earlier clue unless you are using it as a pure information test. Record duplicates carefully because repeated colors change the count.
Mastermind is pure deduction in a small board. Make guesses that teach you something, track every clue, and let the possible codes shrink until one answer remains.
A 2026 meta-analysis found that cognitive training produces moderate but real improvements in brain function. Here are the best free brain training games you can play right now in your browser.
Read articleThe Tower of Hanoi has a clean mathematical solution: 2^n minus 1 moves. Learn the recursive formula, the proof by induction, and why this puzzle appears in every computer science curriculum.
Read articleRandom shooting in Battleship takes 95 shots on average to win. A probability-based strategy brings that down to 42. Learn the parity method, density mapping, and hunt-and-target tactics that actually work.
Read articleThe world's favorite number puzzle
Reveal hidden pictures with logic
Find matching pairs by memory
Find hidden words in a letter grid
Guess the word letter by letter
Slide tiles into correct order
Classic word puzzle with clues
Guess the hidden word in 6 tries