Online Code Breaker Game
Crack a secret 4-slot color code chosen from 6 colors in 10 guesses. Green, yellow, and gray pegs guide your logical deduction.
Runs in your browser. No data leaves your device.
Frequently Asked Questions
How do I play Code Breaker?
A secret code of 4 colors is randomly generated from 6 options (allowing repeats, creating 1,296 possible combinations). Feedback uses a two-pass algorithm: the first pass identifies exact matches (correct color and position), then the second pass scans remaining slots for color-present-but-wrong-position matches, consuming each secret slot only once to prevent double-counting. Players get 10 guesses to deduce the code.
How do the feedback pegs work?
A green peg means one of your colors is correct and in the correct position. A yellow peg means one of your colors is in the code but in the wrong position. A gray dot means that color is not in the code.
What is the best strategy?
Start with a guess that uses all different colors to maximize information. Use the peg feedback to systematically eliminate colors and positions. Most codes can be cracked in 4-6 guesses with logical deduction.
How many possible codes are there?
With 6 colors and 4 positions (allowing repeats), there are 1,296 possible codes. The feedback pegs give you enough information to narrow this down with each guess.