Bulls and Cows (1A2B)

Play Bulls and Cows online: each player hides a 4-digit code, you take turns guessing, and the game scores every guess as bulls (A) and cows (B). Two players on one phone, or solo practice.

👥 1-2 players⚔️ 2-Player Duels⚡ No download · No sign-up

🕹️ How to play

  1. How do you start a game of Bulls and Cows?: Pick Solo practice to start guessing at once, or Two players to confirm the rules (4 digits, no repeats by default). Each player sets a secret code — tap Random if you can't think of one — and the screen covers itself before the phone is passed.
  2. How do you guess?: Type digits on the keypad and press Submit. The result reads like 1A2B: A (bulls) are right digits in the right place, B (cows) are right digits in the wrong place. Use each result to rule digits out until you hit 4A0B.
  3. How do two players share one phone?: After each guess, tap Pass to rival. The screen stays covered until the other player taps their name, and no code or notes are ever shown while covered. At the end both codes are revealed and every guess is coloured digit by digit, so nobody can cheat.

📖 Rules & variants

Bulls and Cows rules: the code uses digits 0–9, 4 digits long with no repeats by default, and it may start with 0. After every guess you learn how many digits are right and in place (bulls, A) and how many are in the code but misplaced (cows, B). 4A wins.

Worked example: code 4271, guess 1234. The 2 is in the right place — 1 bull. The 1 and 4 are in the code but misplaced — 2 cows. Result: 1A2B. The 3 isn't in the code. The score says how many, never which.

Scoring with repeated digits: each digit matches only once, bulls first. Code 6622, guess 2666: the second 6 is a bull; one 2 and one more 6 are cows, so the answer is 1A2B — not 1A3B, a common mistake in hand scoring.

Two-player result: if the first player cracks the code, the second player still gets the last guess of that round — crack it too and it's a draw. If the second player cracks it first, they win outright. 30 guesses each without a winner is a draw. Rematches swap who goes first.

Invalid guesses don't cost a turn: too few digits, a repeated digit under no-repeat rules, or a number you already tried are blocked with the reason shown. Copying your rival's guess is fine — you're cracking different codes.

Variants: 3 digits (720 codes), 4 digits (5,040) or 5 digits (30,240), each with optional repeated digits. Solo practice keeps your fewest guesses per variant and rates each win Mastermind, Sharp, Steady or Cracked.

❓ FAQ

How do you play Bulls and Cows?
In Bulls and Cows one player hides a secret number and the other guesses it, getting a count of bulls and cows after every try. A bull is a right digit in the right place, a cow is a right digit in the wrong place; four bulls cracks a 4-digit code. Here you can play solo against a random code or with a friend on one phone.
What do bulls and cows mean in the number guessing game?
Bulls are digits that are correct and in the correct position; cows are digits that are in the code but in a different position. Together they tell you how many of your digits appear in the code. Code 4271 and guess 1234 give 1 bull (the 2) and 2 cows (the 1 and 4), written 1A2B.
What is the best strategy for Bulls and Cows?
The best Bulls and Cows strategy averages a little over 5 guesses for a 4-digit code with no repeats, and any code can be cracked in 7. In practice: spend the first two guesses on eight different digits, treat a 0A0B result as gold because every digit in it is ruled out, change only one or two digits at a time, and track eliminated digits with notes.
Can you play Bulls and Cows with 2 players on one phone?
Yes — this version is built for two players on one phone. Each player locks a secret code, and the screen covers itself at every handover so neither of you sees the other's code or notes. At the end both codes are revealed and every guess is coloured digit by digit, so you can check the scoring together.
Is Bulls and Cows the same as Mastermind?
Bulls and Cows is the pencil-and-paper number game that came before the Mastermind board game, and the scoring is the same idea: exact hits versus right-but-misplaced. Mastermind uses coloured pegs and allows repeats; classic Bulls and Cows uses 4 distinct digits. Turn on repeated digits here for the Mastermind-style variant.
How are bulls and cows counted with repeated digits?
With repeated digits each digit in the code can be matched only once, and bulls are counted before cows. Code 6622 with guess 2666 scores 1 bull and 2 cows (1A2B), because only one extra 6 and one 2 are left to pair after the bull. Many quick implementations wrongly report 1A3B.

Last updated: 2026-10-19 · Saved on this device only