Crack the Code — Mastermind rules and how to play
Crack the Code is a digital version of Mastermind for 1–8 players in which one player (or the phone) hides a 3, 4 or 5-digit code and everyone else takes turns guessing, learning after each guess only how many digits are in the right place and how many are right but misplaced.
- Players
- 1–8 players
- Length
- ~10 minutes
- Type
- Brain game
- Type
- Relaxed
Runs in your browser · no download · no account
Mastermind has survived fifty years of board-game fashion because the rules take ten seconds to explain and the game takes a lifetime to be good at. You guess a code. You are told how close you were, but not which parts were close. Everything after that is deduction.
This version swaps the coloured pegs for digits, which removes the fiddliest part of the original — nobody has to squint at a maroon peg next to a brown one — and adds the two things a phone can do that a plastic board cannot: it scores the feedback for you instantly and it never, ever miscounts. A 4-digit code with repeats allowed is one of 10,000; without repeats it is one of 5,040, and either is comfortably crackable in ten guesses if the group is disciplined.
It works as a party game with a setter hiding codes and the room arguing over the next guess, and it works alone at one in the morning against a phone that does not care how tired you are. Both are the same screen.
Crack the Code is part of
What you need
- One phone, passed between guessers
- 2 to 8 players, or one player against the phone
- Optionally paper, though the built-in scratchpad replaces it
- About 10 minutes
How to play Crack the Code
Choose a code length (3, 4 or 5 digits), whether digits may repeat, and how many guesses the group gets. Then pick who hides the code: one of the players, or the phone.
In player mode the setter takes the phone alone, types a secret code and memorises it. In phone mode the code is random and everybody hunts together — one player on their own works fine.
Breakers take it in turns to type a full-length guess and hit Guess. Nobody is allowed to skip their turn, and the setter never guesses.
Every guess comes back with pegs: a filled green dot for each digit that is the right number in the right slot, and a hollow amber dot for each digit that is in the code but in the wrong slot. The dots never tell you which digit is which.
Use the scratchpad under the board to cross out digits you have ruled out. Tap a digit again if you cross one out by mistake.
Cracking the code scores the guess budget minus the guesses used, plus one — so an early crack is worth far more. If the code survives, the setter takes 5 points instead.
The setter rotates each round. After the last code, the highest total wins, and a tie is settled by one more code.
Scoring and winning
- Cracking the code scores the guess budget minus the guesses used, plus one. On a 10-guess game, cracking it on guess three is worth 8 points and cracking it on the last guess is worth 1.
- The points go to whoever typed the winning guess, which is why turn order matters more than it looks.
- If the code survives every guess, the setter takes 5 points instead. In vs Phone mode nobody scores.
- Revealing the code deliberately ends the round with nobody scoring at all — not even the setter.
- The recap lets you reassign the crack to another player and nudge the points, for when one person worked it out and another one typed it.
- The setter rotates every round. Highest total after the last code wins, and a tie is settled with one more code.
Crack the Code strategy and tips
- Open with a spread, not a hunch. Something like 0123 tells you how many of those four digits are in the code at all, which is worth far more than a lucky first guess.
- Change one thing at a time once you have a foothold. If you swap two digits and move a third, the feedback that comes back is unreadable.
- Track the total. If a guess returns three dots of any colour, exactly three of those digits are in the code — cross the rest off the scratchpad immediately and permanently.
- To locate a digit you know is in the code, keep it and shuffle its position while holding everything else constant. A green dot appearing tells you exactly where it lives.
- Turn on repeated digits only once your group is comfortable. It roughly doubles the search space and it breaks the habit of assuming four different numbers.
- As the setter, do not be clever. 1111 feels devastating and is usually cracked fast, because the first spread guess that includes a 1 gives the whole thing away.
Variants and house rules
Solo against the phone
Pick one player and vs Phone mode. Every round is a fresh random code and your score is a measure of how few guesses you needed. A 5-digit code with repeats in 8 guesses is a genuinely hard target.
One code each
Set the number of codes to match the number of players so everyone sets exactly once. It is the fairest format, because setting is an advantage — the setter cannot lose points.
Silent breakers
House rule: no discussion at all. Each breaker guesses on their own read of the board. It doubles the length of a round and triples the arguing afterwards.
Hard mode
Five digits, repeats on, eight guesses. Very few codes fall in a first sitting, which means the setter bounty of five points becomes the real prize.
Co-op speedrun
Everyone against the phone, talking freely, trying to crack three codes in the fewest total guesses. Write the number down and beat it next week.
Crack the Code FAQ
What are the rules of Crack the Code?
One player or the phone hides a code of 3, 4 or 5 digits. Guessers take turns typing a full-length guess and are told how many digits are correct and in the right position, and how many are correct but in the wrong position. Crack it before the guesses run out.
What do the dots next to a guess mean?
A filled green dot is a digit that is the right number in the right slot. A hollow amber dot is a digit that appears in the code but sits somewhere else. The dots never tell you which digit is which — that is the whole game.
Is this the same as Mastermind?
Yes, with digits instead of coloured pegs. The feedback rule is identical, including how repeated digits are counted.
Can you play Crack the Code alone?
Yes. Pick a single player and let the phone set the code. It is the one game here that is genuinely as good solo as it is in a group.
How many guesses should a 4-digit code take?
A careful player cracks a 4-digit code with no repeats in about five guesses. Ten is a generous budget; eight is where it starts to bite.
How do repeated digits change the feedback?
Each digit in the code is matched at most once. If the code is 4471 and you guess 4444, you get two green dots and nothing else — the other two 4s have nothing left to match.