Code breaker

Crack the hidden 4-peg code in 10 guesses. ● means right color, right spot; ○ means right color, wrong spot. Colors can repeat. A new code every day.

Daily code

    Keys: 1–6 add a peg, Backspace undoes, Enter guesses.

    How to crack the code

    There are 6 × 6 × 6 × 6 = 1,296 possible codes. Every guess splits them into groups by the clue it would get, so a good guess is one where no group is very large. Some habits that help:

    Common questions

    How does code breaker work?

    There is a hidden code of 4 pegs in 6 colors, and colors can repeat. After each guess you get two numbers: ● is how many pegs are the right color in the right spot, ○ is how many more are the right color but in the wrong spot. Use them to narrow it down in 10 guesses or fewer.

    Is this the same as Mastermind?

    It's the same classic code-breaking game. Mastermind is the board game version, invented by Mordecai Meirowitz in 1970; it in turn grew out of an older pencil-and-paper game called bulls and cows.

    What is the best possible score?

    Five guesses. Donald Knuth showed in 1977 that every code with 4 pegs and 6 colors can be cracked in at most five guesses, and that some codes can't be guaranteed in fewer.

    What is a good first guess?

    Two colors in pairs, like red red blue blue. Knuth's five-guess method starts that way, because it splits the 1,296 possible codes into the most useful groups.

    Why does it say how many codes are still possible?

    After each guess we count every code that fits all your clues so far. It is a quick way to see how much a guess taught you.

    More games