Duels

Code Breaker: crack your friend’s secret code

You pick a secret code, your friend picks one too. Take turns guessing: green means right digit, right place; yellow means right digit, wrong place. Whoever cracks the other’s code first wins. One link, no app, no account.

  • 2 players
  • About 4 min
  • Watchable live
  • Free, no sign-up

Challenge a friend

Start the game, then send the link. The first person to accept plays you.

Mode
Code length
Made of
Repeats

Links stay open 48 hours after the last move.

A blue strip with four hidden code tiles marked with question marks, above a paper slip of guesses with green and yellow pegs

The classic logic game, played over a link

Code Breaker is one of the oldest pencil-and-paper games there is. With numbers it’s called Bulls and Cows; with coloured pegs, millions know it as the board game Mastermind. The idea fits in a sentence: guess a secret code, and after every guess you only learn how many of your digits are right, never which ones. From those two little numbers you work out the code like a detective.

On BeatMe you play it against someone you know. Each of you locks in a code for the other, then you take turns guessing. Make a game, send the link in any chat, and play live or one guess at a time. The codes stay on our server, so nobody can peek, and every hint is worked out there too.

How to play Code Breaker

Pick your secret code

Choose four digits (or colours) for your friend to crack. Your friend does the same for you. By default every digit appears only once.

Guess their code

On your turn, type four digits and tap Check. You get a green peg for every digit in the right place and a yellow peg for every digit that is in the code but somewhere else.

Work it out

Use the pegs to rule digits in and out. The Notes button lets you cross digits out on the keypad, just like on paper.

Crack it first

The first to get four greens wins. If the player who started cracks it, the other gets one last guess to draw. Rematch on the same link.

Watch: rules and 3 tricks to win

Plays from YouTube when you press play. Watch on YouTube

The rules in short

  • Duel (the classic): you each pick a secret code and take turns guessing the other’s. Both of you always get the same number of guesses.
  • Race: our server picks one code, and you both crack it at the same time. Fewer guesses win, and on a tie the faster player.
  • Green means a right digit in the right place. Yellow means a right digit in the wrong place. You learn how many, never which ones.
  • Code length: 3 for a quick game, 4 for the classic, 5 for a real puzzle.
  • Digits or colours: digits 0 to 9, or six colours, each with its own shape, so they work for children and for colour blindness too.
  • Repeats: by the classic rules every digit appears only once (as in Bulls and Cows), while colours may repeat; switch repeats on for a harder code like 7 7 0 1.

How to crack a code fast

Start with guesses that test many digits at once: 1 2 3 4, then 5 6 7 8. Between them, those two guesses tell you how many of the code’s digits are 9 or 0. Then move one digit at a time: if a green turns into a yellow, you know exactly which digit was in the right place.

Every guess should be one that could still be the answer. Check it against all your earlier hints before you tap Check. A good player cracks four different digits in five to seven guesses, and with practice you’ll get there too.

A fair game with hidden codes

Your code goes to our server and never reaches your friend’s phone until the game is over. The hints are worked out there too, so nobody can fake a peg. In a race, you see only your friend’s pegs, never their guesses, until you’re done yourself.

Code Breaker FAQ

Can I play Code Breaker online with a friend for free?

Yes. Start a game on this page and send the link. Your friend taps it and plays in the browser, with no app, no account and no cost.

Is this Bulls and Cows?

Yes. With digits it’s the classic Bulls and Cows: a bull is a right digit in the right place (our green peg), a cow is a right digit in the wrong place (our yellow peg).

Is this Mastermind?

It’s the same kind of code-breaking game, and with the colour option it plays much like it. Mastermind is a trademark of its owner, and BeatMe isn’t affiliated with it.

What happens if we both crack the code?

In a duel, both players always get the same number of guesses. If you both crack the other’s code in the same number of guesses, it’s a draw. In a race, the faster player wins a tie.

How long does a game take?

About four minutes live with four digits. You can also play one guess at a time: the link stays open for 48 hours after the last move.

More games for two

A pool table from above: the white cue ball rolling into the triangle of coloured ballsNewDuels8-Ball PoolBreak, pot your group, sink the 8. 2 players · 8 minA football flying into the top corner past a diving goalkeeperNewDuelsPenalty ShootoutShoot, save, outsmart your friend. 2 players · 4 minA golf ball rolling towards a hole with a red flag on a greenNewBeat My ScoreMini GolfSame course. Fewest strokes wins. 2–4 players · 3 minA hand-drawn gallows with a stickman on squared paper, next to letter tilesPopularRacesHangmanSame word. Fewer sticks win. 2 players · 3 minA blue Connect 4 board with red and yellow discs, one more yellow disc dropping in from abovePopularDuelsConnect 4Four in a row. Outsmart them. 2 players · 5 minA mint-green Tic-Tac-Toe board with red crosses winning on the diagonal and yellow noughtsPopularDuelsTic-Tac-ToeThree in a row. Thirty seconds. 2 players · 1 minA table of face-down blue cards with a few turned over: two matching hearts, a star and a moonNewDuelsMemory MatchFlip two. Remember everything. 2 players · 4 minA letter tile with a big S next to an answer sheet with categories and a pencilRacesCity Country RiverOne letter. Six categories. Go! 2 players · 3 minAn orange stopwatch with a tomato-red button, its hand just short of the target mark at the topNewBeat My ScoreStop the ClockStop it on the dot. Even in the dark. 2 players · 2 minA blue arcade cabinet with a dark light panel, a tower of glowing red blocks narrowing to the top and a big red button belowNewBeat My ScoreStack TowerStop the blocks. Stack them to the top. 2 players · 2 minA round glass flask with a little ringed planet inside, bubbles and stars rising from itNewRacesScience & Nature QuizPlanets, animals, the human body. Who knows more? 2–4 players · 3 minA big red push button next to a stopwatch, ready for a reaction test between two playersBeat My ScoreReaction DuelWait for green. Then tap. Faster. 2 players · 1 minA word search sheet taped to the table, three words circled with highlighter pensNewRacesWord SearchSame grid, same words. Who finds them all first? 2 players · 5 minA white knight in mid-jump across a wooden chess board, about to give check to the black kingNewDuelsChessOne link. No sign-up. Your move. 2 players · 15 minA blue sea grid with two paper ships, red hit bursts, white misses and a crosshair taking aimDuelsSea BattleHide your fleet. Hunt theirs. 2 players · 10 minA rock, a sheet of paper and a pair of scissors in a triangle, with arrows showing which one beats whichSealed RoundsRock Paper ScissorsLock in your throw. Reveal together. 2 players · 1 minTwo grids of letter tiles in green, yellow and grey, one finished with a full green rowNewRacesWord DuelSame word, six guesses. Who cracks it first? 2 players · 3 minPaper cards with sums on them, a big “7 × 8” in front, next to a ticking stopwatchNewRacesSpeed MathSame sums. Who adds up faster? 2 players · 1 minA minefield of raised tiles with numbers, a red flag and a black mineRacesMinesweeper DuelSame minefield. Fastest sweeper wins. 2 players · 3 minA globe with a little flag pinned on it, next to four answer cards marked A, B, C and DNewRacesGeo QuizFlags, capitals, rivers. Who knows the world better? 2–4 players · 3 minA cheerful Snakes and Ladders board with a smiling snake, a wooden ladder and two round pawnsNewDuelsSnakes and LaddersClimb the ladders, dodge the snakes! 2–4 players · 6 minA paper Sudoku taped to the table, the last digit being written in blue penNewRacesSudoku DuelSame puzzle, two clocks. Who solves it first? 2 players · 8 minA Ludo board with red and yellow pawns and a big white dice showing sixDuelsLudoRoll a six. Race your pawns home. 2–4 players · 10 minA football resting on the penalty spot of a green pitch, four answer cards beside it, the right one tickedNewRacesFootball QuizWorld Cups, legends, the rules. Who knows football better? 2–4 players · 3 minA fan of playing cards with a red eight of hearts on top, and a pile of cards beside itNewDuelsCrazy EightsMatch the suit. Eights are wild. Empty your hand first. 2–4 players · 5 minA line of cream domino tiles snaking across the table, with a double placed crosswiseNewDuelsDominoesMatch the ends. Block the line. Domino! 2 players · 6 minA keyboard with the keys W, P and M flying off towards a chequered finish flagRacesTyping RaceSame words. Type faster. 2 players · 1 minA checkers board with red and yellow pieces, one crowned king and a double jumpDuelsCheckersJump, capture, get crowned. 2 players · 10 minAn hourglass whose falling sand forms a small pyramid, next to four answers, the right one tickedNewRacesHistory & Inventions QuizPyramids, inventions, explorers. Who knows history better? 2–4 players · 3 minA wooden 2048 tray with colourful number tiles from 2 to 2048, the 2048 tile glowing in the cornerNewBeat My Score2048Slide the tiles. Join the numbers. Beat my score. 2–4 players · 3 minA tablet with the numbers 1 to 6 scattered on white tiles across a dark screen, and a banana lying on its cornerNewBeat My ScoreChimp TestRemember the numbers. Beat the chimp. 2 players · 3 minA Nine Men’s Morris board of three nested squares with red and yellow stones and a glowing millDuelsNine Men’s MorrisThree in a row. Take a stone. 2 players · 10 minA sheet of squared paper with ink dots, lines between them and boxes filled in red and yellowDuelsDots and BoxesClose the box. Take another turn. 2 players · 5 minTwo leather dice cups on a wooden table, one lifted to show five dice, with a paper slip that reads three foursNewDuelsLiar’s DiceBid high, bluff hard, call “Liar!” 2–4 players · 6 minSquared paper with red X’s and yellow O’s, five X’s in a diagonal row struck through with an ink lineDuelsFive in a RowFive in a row. The board is huge. 2 players · 6 minA hand-drawn Chinese chess board with the river across the middle, a red cannon jumping over a screen to capture a black chariotNewDuelsChinese ChessCross the river, trap the general. Classic or face-down Cờ úp. 2 players · 20 minA green mancala board with two rows of six pits and a store at each end, a hand of seeds being sown into the pitsNewDuelsMancalaSow the seeds. Fill your store. 2 players · 8 minA green Reversi board with red and yellow discs, one disc halfway through flipping overNewDuelsReversiTrap their discs. Flip the board. 2 players · 8 minFive dice in a row, all showing six, with a burst of starsBeat My ScoreFive DiceSame dice. Better choices win. 2–4 players · 5 minA solitaire game on green felt, the cascading piles of cards and the four foundations, one card flying homeNewRacesSolitaire DuelSame deal, two tables. Who gets all 52 home first? 2 players · 6 minA backgammon board with red and yellow checkers on mint and lilac points and two dice showing six and fiveDuelsBackgammonRoll, race, hit and bear off. 2 players · 15 min