Black & white pegs
Black means right color, right spot. White means right color, wrong spot. No peg means the color isn't there.
Guess the hidden color sequence and use black and white peg clues to zero in on the exact code before you run out of guesses.
Pick colors below to fill your first guess.
Black means right color, right spot. White means right color, wrong spot. No peg means the color isn't there.
Choose code length, palette size and guess limit before every new game to change the difficulty.
Win or lose, the secret sequence is revealed at the end so you can see exactly what it was.
The computer secretly picks a sequence of colored pegs. Your job is to guess the exact sequence within a limited number of tries, using feedback after each guess.
Mastermind is a deduction game that rewards careful tracking more than luck. Since peg colors in the feedback don't say which position they refer to, working out the code is a puzzle of elimination — testing colors, then testing positions, then refining as the guess count shrinks.
The hidden code may reuse a color more than once, so don't assume all pegs are unique colors.
Early guesses that spread out colors evenly reveal which colors are even in play before you worry about position.
More colors and a longer code make the puzzle exponentially harder — start small if you're new to it.
There's no hidden randomness after the code is set — every clue is exact, so careful notes beat guesswork.
Common questions about pegs, repeats and strategy.
A black peg means one of your guessed colors is the correct color in the correct position. A white peg means a guessed color exists in the code but in a different position. Peg colors give no clue about which slot they refer to.
Yes. The hidden code can use the same color more than once, just like the classic board game, which is part of what makes deduction tricky.
By default you get 10 guesses, though you can change the code length and color count before starting a new game, which affects how hard the puzzle is.
The game reveals the secret code so you can see what it was, and you can start a fresh game with a new hidden code at any time.
A common approach is to first find which colors appear at all using simple test guesses, then use black-peg feedback to narrow down positions. Tracking previous guesses carefully is more effective than guessing randomly.