Code Breaker

Guess the hidden colour code. Every guess comes back with two numbers — how many pegs are exactly right, and how many are the right colour in the wrong place.

About 2 minThinkingNo download, no sign-up
Starter4 pegs · 6 colours

This round measures how you narrow a set of possibilities down to one from limited feedback, right now.

Your score is net time, and lower is better; every guess that contradicts your own clues adds 8 seconds.About two minutes. There is no countdown.
A guess and its feedback21
  1. Tap colour keys to fill the row.
  2. Press submit.
  3. Read the feedback, then reason out the next guess.
● right place · ◇ right colour · order means nothing

How to read the feedback

Filled circle: one peg is the right colour in the right place.

Hollow diamond: one peg is a colour in the code, but somewhere else.

The order of the marks means nothing — they never say which peg.

The code may repeat a colour, at every difficulty.

First time here? You get a 3-peg 4-colour practice board before anything is scored.

Difficulty

How to read your score

ScoreWhat it means
Under 50 seconds (Starter)A net time under 50 seconds on the Starter tier of this Code Breaker — 4 pegs, 6 colours, 10 guesses — is the fastest of five descriptive bands, not a ranking against other players. At this pace each guess is usually chosen to split the remaining possibilities rather than to test one idea. Compare it with your own Starter rounds on the same device.
50-79 seconds (Starter)A net time of 50 to 79 seconds on the Starter tier of this Code Breaker is the second of five descriptive bands, and it is inside the 80-second Starter target that moves you up a difficulty. It is the pace of a clean deduction: you read each feedback pair before committing to the next guess. Net time includes eight seconds per inconsistent guess, so check the consistency rate beside it.
80-119 seconds (Starter)A net time of 80 to 119 seconds on the Starter tier of this Code Breaker is the middle of five bands, not the middle of a population. The Starter target is 80 seconds, so only the very bottom of this band still meets it: two rounds in a row at or under 80 seconds move you up to Steady, and 81 seconds does not count. A couple of guesses spent re-reading the board is what that difference usually is.
120-179 seconds (Starter)A net time of 120 to 179 seconds on the Starter tier of this Code Breaker is the fourth of five bands and usually means testing one colour at a time instead of combining clues. Before your next guess, ask which codes the feedback you already have has ruled out; a guess that is already ruled out adds eight seconds and cannot tell you anything new.
180 seconds or more (Starter)A net time of 180 seconds or more on the Starter tier of this Code Breaker is the slowest of five bands and a completely ordinary result for the first few rounds. It says nothing about ability. Play a few more and compare the times with each other rather than with this table.

These ranges describe Starter rounds only; the other three difficulties have no reference range on this site yet, and a round there shows your own history instead. They come from internal test runs, not from a survey of players, so they cannot tell you how you compare with other people. Lower is better, and the fairest comparison is your own earlier rounds at the same difficulty.

How to play

  1. How do you start a round of Code Breaker?: Pick a difficulty, then press Start. Your first visit runs a 3-peg 4-colour practice board that is not timed and not recorded. After it, press Start scoring: the board is covered for 1.2 seconds while you decide your opening guess, and the clock starts the moment the cover lifts.
  2. How do you make a guess in Code Breaker?: Tap the colour keys to fill the row from left to right; each key carries a letter as well as a colour, so the code is readable in greyscale. Tap a filled position to clear it. When every position is filled, the submit button becomes available and your guess is added to the history with its feedback beside it.
  3. How do you read the feedback marks?: A filled circle means one peg is the right colour in the right place; a hollow diamond means one peg is a colour that is in the code but sitting somewhere else. Each number is shown beside its shape. The order of the marks carries no information at all — they never tell you which position they refer to, and that is the whole difficulty of the game.
  4. How is your Code Breaker score worked out?: Your score is net time and lower is better: the clock from the moment the cover lifts to the guess that cracks the code, plus eight seconds for every guess that contradicted your own earlier feedback. Beside it you get the number of guesses, your consistency rate and your raw time, and the card tells you from which guess your clues already pointed at a single code.

What this measures

A hidden code is a row of coloured pegs. Starter and Sharp use 6 colours, Steady and Expert use 8; Starter and Steady are 4 pegs long, Sharp and Expert are 5. The code may repeat a colour at any difficulty, and no arrangement is excluded — including all pegs the same.

Every guess comes back with two counts. Filled circles are pegs that are the right colour in the right place; hollow diamonds are pegs whose colour is in the code but in a different position. Each peg is counted at most once, so a guess with three of one colour against a code with one earns a single mark, not three.

The marks are unordered. Two circles tell you that two of your four pegs are exactly right, never which two. Working out which is the task.

You get 10 guesses at Starter, 12 at Steady, 12 at Sharp and 14 at Expert. Crack the code and the round ends with a time; run out of guesses and the round ends without one, and the card shows you the answer.

Net time is the score: your actual time plus eight seconds for each inconsistent guess. A guess is inconsistent when the feedback you already have rules it out — the code it proposes cannot be the answer, so the guess cannot possibly narrow anything. Guessing at random is therefore expensive, while a wrong-but-possible guess costs nothing extra.

Nothing is a hint. There is no undo, no note-taking, no solver, and the game never tells you how many candidate codes are left while you are playing — that number is the answer in disguise. Only the result card, after the measurement, tells you from which guess your clues were already down to a single code.

The difficulty moves with you. Each tier has a target net time — 80 seconds at Starter, 110 at Steady, 130 at Sharp, 170 at Expert. Crack two rounds in a row at or under the target and the next round steps up; miss it once and it steps back down. You can also pick a difficulty by hand at any time.

If two submissions arrive within a quarter second of each other, the second one is thrown away rather than counted, so a double tap or a held key can never spend a guess for you.

A round ends without a time if you switch away, refresh, stop part-way, or the page stalls long enough to affect the clock. Times you already finished are untouched, and an abandoned round is never written into your scores.

Times at different difficulties are kept apart, and so are best times: a Starter round and an Expert round are two different measurements wearing one label. The page always says which difficulty a best time belongs to.

Every round has a run id, and the id is the code: open the same link twice and you get the same two boards. A round opened from a shared link still scores on screen, but it is never recorded and never competes for your best time — a board you can replay until you remember it is not a measurement.

FAQ

What are the rules of mastermind?

One player hides a code of coloured pegs and the other guesses it; each guess is answered with two counts — how many pegs are the right colour in the right place, and how many are the right colour in the wrong place. Nothing else is revealed, and in particular the marks are never matched to positions. Here the same round link always hides the same code, colours may repeat, and you get between 10 and 14 guesses depending on the difficulty.

How many guesses does it take to win mastermind?

For the classic 4-peg 6-colour game, the best possible average is 4.34 guesses, with 6 in the worst case; Knuth's minimax strategy averages 4.48 instead but is guaranteed to finish within 5, and a strategy that only asks each guess to be consistent with the feedback so far averages about 4.6. Those are mathematical results about the game, not figures about players, and they are why the result card carries 4.34 as its reference line. Your own card also reports the guess from which your clues already pointed at a single code, which is the part you can actually act on.

How many possible codes are there in mastermind?

A 4-peg 6-colour code has 1,296 possibilities: repeats are allowed, so every position is chosen independently and the count is 6 x 6 x 6 x 6. The four difficulties on this page give 1,296 codes at Starter (4 pegs, 6 colours), 4,096 at Steady (4 pegs, 8 colours), 7,776 at Sharp (5 pegs, 6 colours) and 32,768 at Expert (5 pegs, 8 colours). Nothing is excluded, not even a code with every peg the same colour — leaving those out would make the set biased, and your deduction assumes every arrangement is possible.

What is a good mastermind time?

There is no single good time, because it depends on the board: a 4-peg 6-colour code has 1,296 possibilities and a 5-peg 8-colour one has 32,768. For the Starter rounds on this page, internal test runs land between about 50 and 120 seconds of net time, and 80 seconds is the target that moves you up a difficulty. These are ranges from test runs, not a survey of players, so they cannot tell you how you compare with other people.

What is a good mastermind strategy?

Two habits carry most of it. First, never submit a code that your own feedback has already ruled out — it cannot be the answer and it cannot narrow anything, which is exactly why this page charges eight seconds for it. Second, prefer a guess that splits the remaining possibilities into similarly sized groups over one that tests a single hunch, because the worst case of the former is much smaller. The classic mistake is to keep one colour fixed and vary the rest one peg at a time: it feels systematic, but it spends a guess to learn what a mixed guess would have told you anyway.

What is the best first guess in mastermind?

For the 4-peg 6-colour board, a two-pair opening such as AABB is the standard first move, and it is the shape used in the published minimax analysis of the game. It works because it divides the 1,296 codes into fairly even groups whatever the answer turns out to be, so the worst case you can be left with after one guess is small. No opening does the work for you, though — the round is decided by how you use the two counts that come back, and on the 5-peg boards your second guess matters far more than your first.

What is the difference between mastermind and bulls and cows?

They are the same deduction game with different stimuli and one different rule. Bulls and cows uses digits, usually with no repeats allowed, and reports bulls and cows; mastermind uses coloured pegs, allows repeats, and reports black and white key pegs. This page follows the mastermind rule — repeats are allowed at every difficulty, which is why it is stated in the legend before you start, and it is the single assumption new players most often get wrong.

What does the consistency rate mean in Code Breaker?

The consistency rate is the share of your guesses that were still possible given the feedback you already had, so 100% means you never submitted a code your own clues had already ruled out. Submitting the same losing code twice is the clearest example of an inconsistent guess: the first answer already proved it wrong. The rate is reported beside your time because the two together say something the time alone does not — a fast round with a low rate means you were guessing, and a slow round at 100% means you were being careful.

How do you get better at code breaking puzzles?

Stay on one difficulty until your times stop dropping, then let the ladder move you up. The change that shortens most times is doing the elimination on paper in your head before touching a key: name one code the feedback has ruled out and say why, and the habit generalises to the whole remaining set. What gets faster with practice is this task, and the honest way to see it is your own earlier rounds at the same difficulty.

Does playing deduction games train logical thinking?

What reliably improves is your code breaking: you eliminate faster, waste fewer guesses and read repeated colours correctly. Evidence that this carries over to reasoning at work or in daily life is much weaker, so treat the time here as a reading of this task on this day, not as a reading of you. Play it because the puzzle is worth solving, and use the times to compare yourself with yourself.

This test is for self-understanding and practice only, not a clinical or intelligence diagnostic tool. It is a non-standardised timed adaptation of the mastermind deduction game; its times cannot be used interchangeably with clinical assessment scores.

Last updated: 2026-09-27 · Scores stay on this device