Puzzle · 6 min read

Code Breaker Strategy Guide: How to Crack the Color Code Every Time

Master the logic behind Code Breaker (Mastermind) with proven strategies for eliminating colors, reading feedback dots, and solving the secret code in as few guesses as possible.

Play Code Breaker Strategy Guide now

Understanding the Feedback

Every guess produces up to four feedback dots arranged in a two-by-two grid. A filled black dot means one of your pegs is the correct color sitting in its exact slot. A grey dot means one of your pegs is a color that appears somewhere in the secret, but you placed it in the wrong position. Empty squares mean some of your pegs share no color with the secret at all.

The dots are not assigned to specific positions — they only tell you counts. If you guess Red-Blue-Green-Yellow and receive one black dot and one grey dot, you know exactly one color is in its right place and exactly one other color exists in the secret but is misplaced. You do not know which peg earned which dot. Working out those assignments is the puzzle.

Repeating colors in your guess can distort the count. If the secret is Red-Red-Blue-Green and you guess Red-Red-Red-Red, you will receive two black dots and nothing else — the third and fourth Reds are simply wrong. Keep this asymmetry in mind when the feedback seems lower than expected.

The Opening Guess

Your first guess is pure information gathering. Choose four distinct colors — say Red, Blue, Green, Yellow — and note how many total dots come back. Zero dots eliminates all four; you know the secret uses only Purple and Orange. Two dots of any kind means at least two of your four colors are present. Four black dots on your first try means you cracked it immediately (very rare).

Many experienced players open with the same four colors every game, building intuition for exactly how each feedback pattern maps to the remaining possibilities. Consistency is a strength here: it lets you compare notes mentally across sessions and recognize promising patterns faster.

Eliminating Colors vs. Placing Colors

After your opening guess, split the problem into two sub-problems: which colors belong in the code, and which slot does each belong to. These are independent tasks that you solve simultaneously but should think about separately.

If a color earned a grey dot, it is in the code but misplaced. On your next guess, move it to a different slot. If it earns a black dot in the new position, you have locked it. If it earns no dot at all, you know it appeared exactly once in the secret (the first slot was the only place it existed) and the new slot is wrong.

Colors confirmed absent can be mentally discarded. Mentally crossing off two or three colors early narrows the field dramatically — with six colors and four slots, confirming which three are present limits the arrangement space to a manageable set of permutations.

Handling Repeated Colors

Repeated colors are the hardest part of Code Breaker. If you suspect a color appears twice, deliberately guess it in two different slots. The feedback will tell you how many of those instances are correctly placed versus present-but-wrong. An unusually low dot count — fewer than you expect given your current knowledge — is often the signal that a repeat is at work.

A safe technique: once you believe you know three of the four colors, guess those three plus a wild fourth. If the count holds, the fourth is a repeat. If the count drops, the fourth is new. This bracketing approach avoids the confusion of introducing two unknowns at once.

Endgame: Narrowing to the Solution

By guess five or six you should know all four colors and be hunting for the arrangement. List every permutation of your confirmed colors, then eliminate candidates that would have produced feedback different from what you already have. This is constraint satisfaction: each prior guess is a filter, and only arrangements consistent with every filter remain.

If three positions are locked (three black dots) but the fourth is not, you have at most five remaining possibilities — the other five colors minus any confirmed absent. One targeted guess resolves it. Similarly, two locked positions with two confirmed-present-but-misplaced colors leaves a small grid of swaps to check.

Do not guess randomly in the endgame. Even one guess that narrows four possibilities to two is better than one that confirms your current best guess but tells you nothing if it is wrong. When you can afford it, play the guess that gives you the most information rather than the guess you think is most likely correct.

Building a Faster Intuition

Expert players solve most games in five guesses or fewer by keeping a running mental model: a set of "possible secrets" consistent with all feedback so far. After two guesses, that set is usually small enough to reason about explicitly. After three well-placed guesses it is often just one or two candidates.

Play regularly and review your solved games. Ask yourself: at which guess did I first know all four colors? Could I have placed them faster? The feedback pattern after guess two is the richest learning moment — what you read from it determines whether you spend three more guesses or one.

Code Breaker rewards patience over speed. Take a moment before each guess to recheck every dot from every prior attempt. A single misread dot is the most common reason players exhaust their ten guesses without cracking the code. Slow, deliberate logic beats fast, optimistic guessing every time.