Mastermind
Play Mastermind free online — crack a 4-peg secret color code with black and white pegs. Easy 6 colors/12 guesses, Medium 7/10, Hard 8/8. No download.

Puzzle
Mastermind
More Games
See all games📖 How to Play
Tap a color from the palette to fill the selected peg slot, then press CHECK to submit your guess. A black peg means the right color in the right position; a white peg means the right color in the wrong position. Crack the code before you run out of guesses!
❓ Frequently Asked Questions
How does the feedback work in Mastermind?
After each guess you get small pegs as feedback. A dark peg means one of your colors is exactly right — correct color AND correct position. A light peg means a correct color is in the wrong position. No peg means that color is not in the secret code at all.
Can colors repeat in the secret code?
Yes! The secret code can contain the same color more than once. For example, Red, Red, Blue, Green is a valid code. This makes Mastermind tricky — watch the feedback carefully to avoid over-counting repeated colors.
What is the best opening strategy for Mastermind?
Start with a guess that uses four different colors to maximize information. Then use the black and white peg counts to eliminate possibilities. On Medium and Hard, try to cover as many colors as possible in your first two guesses before committing to a theory.
How many colors and guesses does each Mastermind difficulty have?
The code is always 4 pegs. Easy uses 6 colors and 12 guesses, Medium 7 colors and 10 guesses, Hard 8 colors and 8 guesses. Colors can repeat. Pick the level from the menu before you start — you cannot change it mid-round.
How is the score calculated in Mastermind?
A win scores a base of 200 (Easy), 400 (Medium) or 700 (Hard), minus 20 points for every guess after the first, with a floor of 50. A loss scores 0. Fewer guesses on a harder level is the way to climb the best-score HUD.
Can I play Mastermind against a friend?
No local two-player. You guess a random secret the computer picked. Fill all 4 slots then tap CHECK — incomplete rows will not submit. Best win score is saved in this browser. Free, no download.
What happens if I run out of guesses?
That round is a loss and scores 0. The secret then reveals. A win is 200/400/700 minus 20 per guess after the first, floor 50. Level is locked for the round (6/7/8 colors, 12/10/8 guesses). Solo.
Do the black and white pegs show which colors are correct?
No. Feedback is counts only: dark pegs = exact color and position, light pegs = right color in the wrong slot. Their order does not map to your four holes, so you cannot tell which peg is which. There is no hint. On desktop, keys 1–6/7/8 fill the selected slot, arrows move between slots, Enter submits CHECK, Backspace clears that slot. Incomplete rows never submit.
Can I change a peg after placing it, and is there a hint in Mastermind?
Yes on the current row only. Tap a filled hole then another palette color, or Backspace/Delete to clear the selected hole. Rows already sent with CHECK are locked - there is no undo and no hint. All 4 holes must be filled or CHECK does nothing. Desktop: keys 1-6/7/8 fill the selected hole and auto-advance, arrows move between holes, Enter submits. Code is 4 pegs with repeats allowed; Easy 6 colors/12 guesses, Medium 7/10, Hard 8/8. Win is 200/400/700 minus 20 per guess after the first (floor 50); a loss is 0. Solo vs a random secret.



