Skip to content

🕵️ Mastermind strategy: crack it in 5

In summary: The best Mastermind strategy is to start with a combination that uses several different colors, then use the black and white peg clues from each guess to rule out combinations through logical deduction, rather than guessing at random.

By Miguel Arechaga

Mastermind is pure deductive reasoning: there is a secret colour code and you must uncover it in as few guesses as possible, guided only by the feedback. With the right method, almost any code falls in 5 guesses or fewer. Here is the method.

First: understand the feedback completely

After each guess you receive two kinds of clue:

A key detail many miss: the pegs are not ordered. The first black peg does not refer to your first slot; only the quantities matter.

The ideal first guess

Open with two pairs of colours: for example blue-blue-red-red. Why? Because the reply instantly tells you how many blues and reds the code contains, far cleaner information than trying four different colours. On your second guess try two other pairs (green-green-yellow-yellow) and within two moves you will know almost the full colour composition of the code.

The elimination method

From the third guess on, every play must obey one sacred rule: be consistent with ALL previous feedback. Before placing, check: “if the code were what I am about to play, would the earlier replies have been exactly what they were?”. If any does not match, that combination is impossible: discard it and try another. This simple habit is 80% of the strategy.

Advanced tips

Pairs at the start, strict elimination afterwards and your counts up to date: you will see 4-5 guesses become your usual average.

📘 Keep reading: How to play Mastermind (Secret Code).

Ready to play?
Put what you've learned into practice.
🎮 Play Mastermind free 🏫 See all games
Miguel Arechaga

Written by Miguel Arechaga

Creator and developer of MundoSudoku. Logic-puzzle enthusiast sharing guides and tips so you can enjoy and improve at every game.