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: .
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
- Choose a level: Easy (4 positions, 5 colours, no repeats), Classic (4 positions, 6 colours, 10 attempts) or Hard (5 positions, 8 colours).
- Place colours: tap a colour or press the digits 1–8; tap a position to refill it.
- Check: the pegs beside the row show your hits, from which you deduce the code.
- Hint: fills in a code that fits all feedback so far and shows how many possibilities remain.
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
- Wikipedia – Mastermind (board game)
- Wikipedia – Mastermind: Five-guess algorithm (Knuth 1977)
- MDN: Crypto.getRandomValues()
As of: · Editorial policy
Related tools
- Play tic tac toe onlineTic tac toe online: play the computer (easy, medium, unbeatable), a friend on one device or by link. 3×3, 4×4 and 5×5 boards with score – free, no sign-up.
- Play sudoku online – daily puzzle and solverPlay sudoku online free: a new daily sudoku every day plus 4 levels, notes, mistake check and hints. The solver explains every step. Printable grid.
- Play hangman onlineFree hangman game in your browser: 3,000 common English words in three levels, a word of the day, or send your own secret word to a friend as a link.
- Dice roller: roll d6, d20 and more onlineDice roller: roll d4 to d100 or type dice notation like 3d6+2 or 2d20kh1. Several sets at once, advantage, roll history, exact odds and a shareable link.
- Online score keeperFree online score keeper and score counter for board and card games: rounds, running totals, rankings, target score and undo. Saved locally in your browser.
- Play Solitaire OnlineFree Klondike solitaire in your browser: draw 1 or 3, unlimited undo, hints and a winnable daily deal. Share your time – the link deals the same cards.
- Conversation starters at randomConversation starters at random: spin for one of 90 open questions for friends, dates, the family table, teens, work small talk or deeper talks. Add yours.
- Bingo caller online with voiceBingo caller online: draws the balls 1–75 or 1–90 with no repeats, reads each number aloud and marks it on the board. Auto mode, full screen, no sign-up.
- Mini golf scorecard onlineMini golf scorecard online: tap the strokes of each player after every hole, the card adds up and names the winner after 18 holes. No app, share by link.