🔐 Code Breaker

Guess: 1/10
Best win: -
Pick colors for your guess

About Code Breaker

Code Breaker is a free logic game: crack a hidden color code using the clues given after each guess.

Code Breaker is a Mastermind-style logic game. The computer picks a secret code of colored pegs, and you try to guess it. After every guess you get clue pegs that tell you how close you were.

In classic mode the code has 4 pegs chosen from 6 colors, and you get 10 guesses. Hard mode uses 5 pegs, 8 colors and 12 guesses. Colors can repeat in the code, and each color is labelled with a number so the game is easy to read.

4
PEGS IN CLASSIC MODE
6
COLORS IN CLASSIC MODE
1,296
POSSIBLE CODES, CLASSIC
10
GUESSES, CLASSIC

How to play Code Breaker

  1. Choose Classic (4 pegs, 6 colors, 10 guesses) or Hard (5 pegs, 8 colors, 12 guesses).
  2. Tap a color to place it in the next empty slot of your guess. Tap a placed peg to remove it.
  3. When every slot is filled, press Check.
  4. A black clue peg means one peg is the right color in the right place. A white clue peg means a right color in the wrong place. The clue pegs are not in any particular order.
  5. Use the clues to work out the code before you run out of guesses. Colors can appear more than once.

Code Breaker tips and strategy

Frequently asked questions
What do the black and white pegs mean?
Black means a correct color in the correct position. White means a correct color in the wrong position. A color is only counted as many times as it appears in the code.
Can colors repeat in the secret code?
Yes. The code can use the same color more than once, in any positions.
How many guesses do I get?
Classic mode gives 10 guesses for a 4-peg code with 6 colors. Hard mode gives 12 guesses for a 5-peg code with 8 colors.
How many possible codes are there?
Classic mode has 6 to the power of 4, which is 1,296 possible codes. Hard mode has 8 to the power of 5, which is 32,768.
Is there a best strategy?
Yes. Always guess a code that is still possible given the clues you have seen. Computer scientists have shown that 4-peg, 6-color codes can always be cracked in 5 guesses with the best strategy.
Why are the colors numbered?
Each color has a number on it so the pegs are easy to tell apart, including for colorblind players.
Is it free to play?
Yes. It is free in your browser with no download or account.