Mastermind

Puzzle
Medium5-15 minlogic, deduction, code
Play instantly in your browser - no download, no signup, 100% free.

About Mastermind

Crack the secret color code with logical deduction. Each guess tells you how close you are - solve it in as few moves as possible.

Game by WebGames · License: MIT

Mastermind FAQ

How do you play Mastermind?

The codemaker picks a secret sequence of four coloured pegs. You then guess the sequence, and after each guess you get feedback telling you how close you are. Use that feedback to narrow the possibilities and crack the code before you run out of guesses.

What do the black and white pegs mean in Mastermind?

A black peg means one of your pegs is the correct colour in the correct position. A white peg means one of your pegs is the correct colour but sits in the wrong position. The pegs are not tied to specific slots, so you have to work out which ones they refer to. Four black pegs means the code is broken.

How many possible codes are there in Mastermind?

With six colours and four positions allowing repeats, there are 6 to the power of 4, which is 1296 possible codes. A good strategy solves it in five guesses or fewer, and the theoretical average for an optimal player is about 4.34 guesses.

What is the best Mastermind strategy?

Start with a guess that repeats two colours twice, such as two reds followed by two blues. This tests several colours at once and gives you more information than four different colours would. From there, keep every guess consistent with all feedback you have received so far, which steadily eliminates impossible codes.

Is Mastermind free to play in the browser?

Yes. No download, no sign-up, no account. It works on desktop and mobile, and the same logic that made the 1970s board game a classic is intact - pure deduction, no luck involved.

More Puzzle Games