Ludozio
Games · Puzzle · Mastermind

Mastermind

‹ deal ›
Time 0:00 Moves 0

How to play Mastermind

Mastermind is a game of pure deduction: a secret colour code hides behind the slots, and your job is to reconstruct it within a limited number of guesses. Every attempt returns a numbered clue that brings you closer to the answer. In the medium variant the code is four pegs drawn from six colours, repeats allowed, and you have ten guesses.

  1. Crack the hidden code A code of four pegs is drawn from six colours, with repeats allowed. Your goal is to reproduce the exact sequence, in the right order, before your ten guesses run out.
  2. Build a guess Tap the palette swatches to fill the four slots of the current row, then submit. An incomplete row is refused and costs no guess; tap a filled slot to clear it and choose another colour.
  3. Read the two clues After each guess, key-pegs appear: a black key marks a colour in the right place, a white key a colour that belongs elsewhere in the code. Their order never reveals which position they refer to.
  4. Deduce the code By cross-checking the clues from one guess to the next, narrow the possibilities until you pin the sequence down. Four black keys mean a win; otherwise the code is revealed on the tenth guess.
Full rules

Mastermind is a game of pure deduction: find a hidden colour code, the same for everyone and fixed each day.

The code is a sequence of coloured pegs (four in the medium variant) drawn from a palette of six colours, with repeats allowed. Each turn, build a guess by tapping the palette swatches to fill the slots, then submit. You then get a clue: the number of pegs of the right colour in the right position (black key-pegs) and the number of the right colour in the wrong position (white key-pegs). The count never double-uses a peg: exact matches are counted first, then, for the rest, the minimum of each colour shared by the two sequences. The order of the key-pegs never reveals a position.

By cross-checking the clues from one guess to the next, you gradually narrow the possibilities until you pin the code down. An incomplete guess is refused and does not cost a turn; tap a filled slot in the current row to clear it and replay it. You win as soon as you get four black key-pegs; you lose if your ten guesses run out, and the code is then revealed.

Three levels are offered: easy (four pegs, six colours, no repeats), medium (four pegs, six colours, repeats allowed) and hard (five pegs, eight colours, repeats allowed). In colour-blind mode, a number appears on each peg so the colours can be told apart without ambiguity.

Playing tips
Open with a varied spread

On your first turn, lay out a range of different colours to probe the palette at once. The total number of keys, black and white together, tells you how many of those colours appear in the code.

Isolate one peg at a time

When you are hunting for a colour's exact spot, change only a single slot from one guess to the next. The shift in the key count tells you precisely what that one change did.

Use the total key count

The number of keys tied to a colour, black and white combined, equals how many copies of that colour are in the code. Handy for working out whether a colour repeats.

Rule out anything scoring zero

A guess that returns no keys at all proves that none of its colours are in the code. Drop them for good and focus your remaining turns on the colours that are left.

Frequently asked questions

What is the difference between a black key and a white key?

A black key-peg means a peg of the right colour sitting in the right position. A white key-peg means a colour that is in the code but at a different slot. The count never double-uses a peg: exact matches are tallied first.

Can colours repeat within the code?

It depends on the variant. In medium (four pegs, six colours) and hard (five pegs, eight colours), repeats are allowed, so a colour may appear more than once. In the easy variant, every colour in the code is unique.

How many guesses do I get to find the code?

You have ten guesses. You win the moment you score four black keys; if your ten guesses run out before then, the game is lost and the code is revealed.

Do I need an account to play?

No. Mastermind runs right in your browser, with no account or sign-up. Once the page has loaded it works offline too, and your game in progress stays put if you return to the tab.

Is the code the same for everyone?

Yes. Mastermind offers a daily code, identical for every player and fixed each day. That lets you compare your number of guesses with others on the same day's board.

How can I tell the colours apart if I see hues poorly?

Turn on colour-blind mode: a number then appears on each peg, so the colours can be told apart without ambiguity. Everything else, clues included, works in exactly the same way.

Come back tomorrow Five puzzles a day, the same for everyone. See today's five
This grid
LevelEasy