1. Open with two disjoint guesses (1234 → 5678)
Testing 8 distinct digits in your first two moves immediately tells you how many of {9, 0} are in the code (4 minus the total Bulls + Cows from both guesses).
Bulls and Cows (also known as Cows and Bulls or 4-digit Mastermind) is a pure deduction puzzle. Your goal is to uncover a hidden 4-digit code made of unique digits from 0 to 9 in as few guesses as possible.
Each Bull means one digit in your guess is in the secret code AND sits in the exact same position.
Each Cow means one digit in your guess appears in the secret code, but belongs in a different position.
Suppose the hidden secret code is 5296. Here is how systematic deduction cracks it in just 4 turns:
1 Bull, 0 Cows: exactly one digit from {1, 2, 3, 4} is in the code and already in its right spot. We test four brand-new digits next.
1 Bull, 1 Cow: two digits from {5, 6, 7, 8} are in the code. That accounts for 3 of the 4 secret digits so far, meaning exactly one of {9, 0} must also be in the code.
3 Bulls, 0 Cows: locking in 5 and 2 while testing 9 and 0 reveals three exact positions at once. Only one digit (0) is wrong and needs swapping with a candidate from guess #2.
4 Bulls — Code cracked! Replacing 0 with 6 from {5, 6, 7, 8} completes the exact secret 5296.
With 10 × 9 × 8 × 7 = 5,040 possible 4-digit codes, disciplined information gathering beats random guessing every time. Most skilled players solve any code in 5 to 6 moves.
Testing 8 distinct digits in your first two moves immediately tells you how many of {9, 0} are in the code (4 minus the total Bulls + Cows from both guesses).
Getting 0 Bulls and 0 Cows removes 4 digits from the board in one shot, shrinking the search space from 5,040 down to just 360 remaining codes.
Long-press (or right-click on desktop) any digit on the keypad to mark it as ruled out or confirmed. Visual elimination prevents repeating dead digits.
When you know the digits but have Cows instead of Bulls, rotate two or three digits at once while keeping confirmed Bulls anchored.
Yes. Any digit from 0 through 9 can appear in the first slot, as long as all four digits in the code are distinct.
No. Every digit in the 4-digit secret code and in your guesses must be unique.
An optimal solver averages about 5.21 guesses and never needs more than 7. Human players who use disjoint opening guesses typically average 5 to 7 turns.
Open the Play with a Friend page, click Create session, and send the invite link via WhatsApp, Telegram, or any chat app. Both players race to crack the code in real time with no login required.
Bulls and Cows is the original 19th-century pencil-and-paper logic game that inspired both Mastermind (colored pegs, repeats allowed) and Wordle (5-letter words with per-slot color feedback).
Jump straight into a free browser match — no account or download required.