Skip to content

Learn the rules of Mastermind

One thing to notice as you play

Use the controls beside the game rather than guessing the rules. Check guess records your attempt. Exact means correct colour and position; misplaced means correct colour in another position. Start a new round when you are ready to try again.

Aim for this result

Check the rule below as you play. Deduce a hidden four-colour code within ten guesses, using exact and misplaced feedback. Try the rule on the board, then read the next instruction.

Work through the instructions

  1. The computer chooses four positions from six colours; repeated colours are allowed.
  2. Select a code position and then choose a colour. Fill all four positions.
  3. Check guess records your attempt. Exact means correct colour and position; misplaced means correct colour in another position.
  4. Each secret peg can match only one guess peg. Use the feedback to narrow the next guess.
  5. Find all four exact positions to win. After ten unsuccessful guesses the secret code is revealed.

How to interact with the game

The example and rules describe the same game you can play above. Tap one of four positions, then a labelled colour button. Numbers identify colours as well as the swatches. Press Check guess only when all slots are filled. Start a new round when you are ready to try again.

Follow the example

The board gives you the information needed for the next action. For secret 1,1,2,2 and guess 1,2,1,3, feedback is one exact and two misplaced. The extra 3 has no match.

Pay attention to this rule

Use the controls beside the game rather than guessing the rules. Four misplaced matches do not mean four exact positions. Also, repeated colours must not be counted more times than they appear in the secret. Try the rule on the board, then read the next instruction.

Questions that come up during play

When I start, what is the aim of Mastermind?

Deduce a hidden four-colour code within ten guesses, using exact and misplaced feedback. Use the labelled controls for your next action.

When I start, how do the controls work?

Tap one of four positions, then a labelled colour button. Numbers identify colours as well as the swatches. Press Check guess only when all slots are filled. Use the labelled controls for your next action.

During a round, can you show an example?

For secret 1,1,2,2 and guess 1,2,1,3, feedback is one exact and two misplaced. The extra 3 has no match. Keep the current game state in view while applying this rule.

For this game, which mistake should I avoid?

Four misplaced matches do not mean four exact positions. Also, repeated colours must not be counted more times than they appear in the secret. The controls work with mouse or touch.

When I start, what rules and limits are used here?

Four positions, six colours and ten guesses, with repeated colours allowed. This is an independently coded free colour-code puzzle, not an official branded edition. Scores here do not represent cash or prizes.

When I start, how many people can play here?

Solo. This is local browser play, not internet matchmaking. Scores here do not represent cash or prizes.

When I start, can the secret repeat a colour?

Yes. Any of the six colours can appear more than once. The worked example offers another way to follow the rule.

What does misplaced mean?

The guessed colour appears in the secret but not at that position, after exact matches have been accounted for. The game is played locally in your browser.

For this game, are colour numbers part of the rules?

They are labels for accessibility; the number and its colour refer to the same peg choice. No download or player account is required.

When I start, can I see the answer?

The answer is shown when you solve the code or use all ten guesses. Scores here do not represent cash or prizes.