Mastermind game online

In this Mastermind game you crack a secret colour code: place colours, press “Check” and read the black and white pegs to see how close you are. Three levels, a hint button and a link to share a code with a friend.

Source: Wikipedia – Mastermind (board game). Updated: .

Pick colours for the highlighted row.

    Wins / games
    0
    Best attempt
    –

    Feedback: a black dot = right colour in the right place, a white dot = right colour in the wrong place. “Easy” uses each colour once; other levels allow repeats.

    Keyboard: digits 1–8 pick the colour, Backspace deletes, Enter checks.

    Wins and level are stored only in this browser (localStorage).

    My Toolbox

    Result

    How it is calculated

    Mastermind is a logic game: you have to guess a secret colour code in as few attempts as possible. After each guess the computer shows how many colours sit in the right place (black) and how many occur in the code but are misplaced (white).

    How to play Mastermind

    Tips for fewer attempts

    The classic version has 1,296 possible codes. Start with two pairs, such as 1 1 2 2, and evaluate every answer: each new guess should itself still be a possible code. With this strategy you solve almost every code in five or six attempts; Donald Knuth showed in 1977 that every code can be found in at most five moves. After a win you can share the code by link.

    Frequently asked questions

    How does Mastermind work?

    The computer picks a secret colour code. You guess it, and after each try black pegs show right colours in the right place, white pegs right colours in the wrong place.

    How many attempts do I get?

    Ten on the classic level, twelve on Easy and Hard. You win once every position shows black.

    What do the black and white dots mean?

    Black: colour and place are right. White: the colour is in the code but in another place. The order of the dots says nothing about which positions they refer to.

    What does the hint do?

    It enters a code consistent with all feedback so far and tells you how many codes are still possible. Games played with a hint do not count for the best attempt.

    Can I share a code with friends?

    Yes. After a win a share button appears; the link contains the code, so your friend solves the same puzzle and can compare results.

    Are my results saved?

    Wins, games and the best attempt per level are stored only in your browser (localStorage) and are not transmitted.

    Sources and legal basis

    As of: · Editorial policy

    Related tools