FlayaPlaya

Mastermind

Puzzlemedium

Mastermind is the classic code-breaking puzzle game that has challenged minds since 1970. The computer creates a secret code of four colored pegs, and you have ten guesses to crack it. After each guess, feedback tells you how close you are — without revealing which colors are correct. Play Mastermind online free and put your deductive reasoning to the ultimate test. Each guess earns black pegs (right color, right position) and white pegs (right color, wrong position). Use this feedback systematically to narrow down the possibilities and crack the code. Mastermind is a beautiful example of information theory in action. Each guess, combined with its feedback, eliminates large swathes of possible codes. Expert players can crack any code in five moves or fewer using optimal strategies.

Controls: Click a color, then click a position to place it. Click Check to submit your guess.

How to Play Mastermind

The computer generates a secret code of 4 colored pegs using 6 possible colors. You have 10 attempts to guess the exact code — all four colors in the correct positions.

Click a color from the palette to select it, then click a position in the current guess row to place it. Fill all four positions, then click Check to submit your guess. You'll receive feedback: black pegs mean a color is correct AND in the right position, white pegs mean a color is in the code but in the wrong position.

Use the feedback strategically. Black pegs tell you to keep that color in that position. White pegs tell you the color exists but needs to be moved. No peg for a position means that color either isn't in the code or is already accounted for by other pegs.

Mastermind Tips & Strategies

  • Start with a guess that tests multiple colors — like four different colors.
  • Track eliminated colors — if a color gets no feedback at all, it's not in the code.
  • Black pegs are more valuable than white — lock in confirmed positions first.
  • Use process of elimination: if you know 3 of 4 colors, the last must be one of the remaining.
  • Try systematic shifts: move a color that got a white peg to different positions.
  • Expert strategy: the first guess of all different colors eliminates the most possibilities.

Frequently Asked Questions

What do the black and white pegs mean in Mastermind?

A black peg means one of your colors is exactly right — correct color in the correct position. A white peg means a color exists in the code but is in the wrong position. No peg means that color isn't in the code (or is already counted).

Can the same color appear twice in the code?

Yes! The secret code can contain duplicate colors. A code like Red-Red-Blue-Green is valid. This adds complexity since you must consider duplicates in your deductions.

What is the best opening guess in Mastermind?

A strong opening guess uses 3-4 different colors to gather maximum information. Popular openings include AABB (two pairs) which works well mathematically, or ABCD (four different) for maximum color coverage.

More Puzzle Games

You Might Also Like