Mastermind – Play Online for Free
In Mastermind you crack a secret color code. After each guess small pegs tell you how many colors are right and how many of them sit in the right spot, but not which ones. The game was invented in 1970 by Mordecai Meirowitz, an Israeli telecommunications expert. After the big game companies turned it down, the plastics firm Invicta of Leicester brought Mastermind out in 1971 and 1972, and in 1973 it won the first "Game of the Year" award in Britain.
Its model was Bulls and Cows, an old pencil-and-paper game in which you guess numbers. For the famous box cover, a hairdressing businessman posed in a suit with a computer science student from Leicester standing behind him. The computer scientist Donald Knuth proved that any code of four pegs and six colors can be cracked in five guesses at most. You can play Mastermind here for free and with no sign-up: our online Mastermind has three levels, with five pegs and eight colors on Hard.
Placing Pegs, Reading Hints: Rules and Strategies for Mastermind
At the top of the board the secret code lies hidden under question marks. You have ten guesses to find it, and each one works like this:
- A guess: fill the holes of the row outlined in green with colors and press "Check" or Enter. The row can only be checked once every hole is filled.
- Black pegs: for every peg that is right in both color and position, a black key peg appears next to the row.
- White pegs: each further peg whose color is in the code, but in a different spot, earns a white key peg.
- No positions given away: the key pegs always appear in the same order, black ones first. Which of your pegs they refer to is for you to work out.
- Repeated colors: a color only counts as often as it appears in the code. If yellow is in the code once and you place yellow four times, you get a single black peg.
- Controls: a click on a color puts it into the marked hole, and the marker jumps to the next free one. A click on a hole of the current row marks it and takes out a peg that is already there. On a computer the keys 1 to 6 help, up to 8 on Hard, along with the arrow keys, Backspace and Delete.
- Levels: on Easy the code consists of four different colors out of six, and in your own row too each color may appear only once. Normal allows the same color more than once, and Hard has five positions and eight colors. Each level keeps its own code.
- End of a round: when you crack the code or all ten rows are used, the code is revealed. "Next Code" or Enter starts the next round. "New Code" starts over at any time; if you have already guessed in the current round, a quick question comes first.
- Counters: the game shows your current guess, the codes you have cracked and your streak. Giving up or losing a round ends the streak. Your browser saves your progress.
Hardly anyone cracks a code by luck alone. These ideas get you there faster:
- Open with two pairs: on Normal, a start like red, red, yellow, yellow has proven itself. Knuth's strategy for five guesses at most begins with exactly this pattern.
- Colors first, positions second: black and white pegs together reveal how many of your colors are in the code. Settle first which colors are in it, then deal with their order.
- A row without pegs is a win: if a row gets no pegs at all, none of its colors is in the code. Such colors make good placeholders later for testing single positions.
- Do the math on Easy: here exactly four of the six colors are in the code. If you place four different colors and get three pegs, exactly one of the two remaining colors is in.
- Change little at a time: if you swap only two pegs from one guess to the next, the black pegs make it easy to read what the swap did.
- Only play consistent rows: every new guess should fit all the answers so far. Check it in your head against the pegs of each row above before you submit it.
- Start broad on Hard: Easy has 360 possible codes, Normal 1,296 and Hard 32,768. Use your first guesses there to test as many of the eight colors as you can.
Code Cracked? Five More Puzzles for Sleuths and Guessers
If you like drawing the right conclusions from a handful of clues, our site has plenty more to chew on:
- Guess the Word: the closest relative of Mastermind, with words instead of colors. Unlike the key pegs, it tells you for every single letter whether it sits in the right spot.
- Hangman: letter by letter you close in on a hidden word, and every miss brings the little figure one step closer to the gallows.
- Battleship: again you are looking for something hidden. Each hit and each miss narrows down where the enemy fleet is waiting.
- Sudoku: digits instead of colors, but just as much pure logic. Each number may appear only once in every row, column and box.
- Memory: here it is mostly your memory that counts. Turn cards over, remember where they lie and keep going until every pair is found.










































