Play Code Breaker — Free
A hidden code of four coloured pegs is waiting. You have ten guesses to crack it — read the black and white feedback pegs after every try and reason your way to the exact answer.
Tap a colour to place it in the active row, tap a placed peg to remove it, then Submit. Keys 1–6 place a colour, Backspace clears, Enter submits.
What is Code Breaker?
Code Breaker is a pure deduction puzzle in the classic mastermind mould: a secret four-peg colour code is hidden at the start of every round, and your job is to figure out exactly what it is. Each peg is one of six colours, and — importantly — the code can repeat colours, so a code might be four different shades or four of the very same one. You never see the code while you play. Instead you make a guess, the game grades it, and you deduce the rest from the grades. It is a game of pure information: no reflexes, no timing, no luck beyond the random code you are handed, just logic applied one careful row at a time.
What makes this codebreaker logic game so moreish is the feedback system. After every guess you are shown a cluster of small key pegs — black and white — that tell you how close you got without ever revealing which peg was which. A black peg means one of your pegs is the right colour and in the right position; a white peg means you have the right colour but placed it in the wrong slot. Turning those two little numbers into a confident conclusion is the whole art of the game. With only ten guesses on the board, every row you spend has to teach you something, and the satisfaction of watching a jumble of colours resolve into a single certain answer is what keeps players coming back for one more code.
How to Play
The feedback pegs are scored the standard way, with no double-counting — each peg in your guess can earn at most one marker. Read them like this:
- a black peg means one peg is the right colour in the right position (an exact hit);
- a white peg means one peg is the right colour but in the wrong position;
- the whites are counted from what is left after the blacks, so a colour is never credited twice.
A round is lost only when you run out of tries. The game ends when:
- you use all ten guesses without producing four black pegs — the code is then revealed;
- you cannot submit a row until all four pegs are filled — partial guesses do not count.
Code Breaker Tips & Strategy
Code Breaker rewards planning far more than speed. A guess is only worth making if it can tell you something you did not already know, and the best players treat their first few rows as experiments rather than attempts to win. These techniques will get you cracking codes in fewer guesses.
Open by surveying the colours
Do not try to win on turn one — try to learn. A classic strong opening is a guess that pairs two of one colour with two of another, then a second guess that surveys two fresh colours the same way. The total of black plus white pegs each guess returns tells you how many of those colours appear in the hidden code, regardless of position. In just two or three rows you can map out roughly which of the six colours are in play and how many of each, which shrinks the puzzle dramatically before you ever worry about order.
Separate "how many" from "where"
The single most useful habit is to read the two feedback numbers as two different questions. Black plus white together answers "how many of my colours belong in the code at all"; the split between black and white answers "and how many are already in the correct slot". When you change the position of a colour between guesses and a white peg flips to black, you have just located that colour exactly. Deliberately re-arranging colours you already know are present — without adding new ones — is the cleanest way to convert vague matches into pinned positions.
Change one thing at a time
When you are close, resist the urge to overhaul the whole row. If you swap a single peg and the black count goes up by one, that peg was right; if it goes down, the peg you removed was right. By altering just one position per guess you can attribute every change in the feedback to a specific cause, turning the endgame into a tidy chain of yes-or-no answers instead of a fog of guesswork.
Eliminate colours that score zero
If a guess containing a colour returns no pegs that can be traced to it, that colour is not in the code — cross it off entirely and never waste a peg on it again. Keeping a running mental (or paper) list of confirmed colours, banned colours and known positions is what lets strong players close out a code with several guesses to spare. Every fact you lock in makes the remaining possibilities collapse faster, and with the field of six colours narrowed to two or three the exact answer usually falls out on its own.
Reading the Feedback Pegs
The feedback pegs are the heart of Code Breaker, so it is worth understanding exactly how they are counted. First the game checks every position: for each peg that is the correct colour in the correct slot, you earn one black peg. Those exact hits are then set aside. From whatever colours remain unmatched on both sides, the game counts overlaps by colour — using the smaller of the two quantities for each colour — and awards that many white pegs. Because the blacks are removed first and each colour is only credited up to the number that actually appears, no peg is ever counted twice and the totals can never exceed four.
A worked example makes it click. Suppose the hidden code is red-red-green-blue and you guess red-blue-red-red. Your first peg, red, sits exactly where a red belongs, so that is one black. After removing it, the code still has a red, a green and a blue unmatched, while your guess still offers a blue and two reds. The leftover red overlaps once and the leftover blue overlaps once, giving two white pegs — so the feedback is one black and two whites, not more. Learning to compute the pegs yourself, even roughly, is a superpower: it lets you predict what a candidate guess would score against your leading theory and choose the guess that rules out the most possibilities.
Code Breaker vs Other Logic Puzzles
If you enjoy Sudoku, Nonogram or a good word-guessing game, Code Breaker will feel like a kindred spirit built on the same engine of pure deduction. Where Sudoku hands you constraints and asks you to fill a grid, and a word game gives you letter feedback to home in on a hidden word, Code Breaker gives you colour feedback to home in on a hidden sequence. All of them reward the same discipline: gather information cheaply, never guess when you can deduce, and let each clue prune the tree of possibilities. None of them need arithmetic or fast fingers — only patience and a clear head.
The twist that gives Code Breaker its distinct flavour is that you choose the questions. In a number puzzle the clues are fixed from the start, but here every guess is a probe you design, and a well-chosen probe can eliminate dozens of candidate codes in a single row. That makes the game feel less like solving a static puzzle and more like a conversation with a hidden opponent who answers honestly but tells you only the bare minimum. Play a handful of rounds and you will start seeing your guesses as information-gathering moves rather than shots in the dark — which is exactly the mindset that turns a ten-guess scramble into a confident four- or five-guess solve.
FAQ
Is Code Breaker free to play?
Yes — Code Breaker on vygam is completely free. There is no download and no sign-up; it plays instantly in your browser on phone, tablet or desktop.
How do you play Code Breaker?
A hidden code of four coloured pegs is set at the start, using six possible colours with repeats allowed. Click the colour swatches to fill a row, submit your guess, and read the black and white feedback pegs. A black peg means one peg is the right colour in the right spot; a white peg means a right colour in the wrong spot. Crack the exact code within ten guesses to win.
What do the black and white pegs mean in Code Breaker?
After each guess you get feedback pegs. Black pegs count how many of your pegs are both the correct colour and in the correct position. White pegs count how many are the correct colour but in the wrong position. Feedback is scored without double-counting, so a single peg in your guess can earn at most one black or one white marker.
How many guesses do you get in Code Breaker?
You have ten guesses to deduce the hidden code. If your tenth guess is not exactly right, the game ends and the secret code is revealed so you can see how close you were.
What is a good opening guess in Code Breaker?
A strong opening is a guess that tests several colours at once, such as two of one colour and two of another. The total number of black and white pegs it returns tells you how many of those colours appear in the code, which narrows the field quickly before you start pinning down exact positions.
Is Code Breaker the same as Mastermind?
Code Breaker is a codebreaker logic game built on the classic mastermind-style deduction format: a hidden colour code, coloured guesses, and black and white key pegs that report your progress. It is our own free browser version of that timeless pen-and-peg puzzle.