Bulls and Cows · Crack the hidden number with strikes and balls
Number Baseball (also known as Bulls and Cows) is a deduction game: you work out a hidden number from nothing but clues. The hidden number uses 3 different digits from 1 to 9 (or 4, if you pick 4 digits), and every guess you make earns a clue.
For example, if the answer is 381 and you guess 318, the 3 is in the right place (1 strike) and the 1 and 8 are in the number but in the wrong places (2 balls), so the clue is "1S 2B". No digit can repeat, and 0 is not used.
There are 9×8×7 = 504 ways to pick 3 different digits from 1 to 9 in order, and 9×8×7×6 = 3,024 for 4 digits. Every first guess is equally good: relabel the digits and positions and they all look the same.
Here is how likely each clue is after the first guess with 3 digits, counted over all 504 codes.
| Clue | Codes left | Chance |
|---|---|---|
| 1B | 180 | 35.7% |
| Out | 120 | 23.8% |
| 1S | 90 | 17.9% |
| 2B | 54 | 10.7% |
| 1S 1B | 36 | 7.1% |
| 2S | 18 | 3.6% |
| 1S 2B | 3 | 0.6% |
| 3B | 2 | 0.4% |
| Hit | 1 | 0.2% |
One clue cuts 504 codes down to at most 180. An "out" feels like a waste, but it wipes out all three digits at once, leaving only the 120 codes made from the other six digits. With 4 digits, the most common first clue is 2B (27.8%), and an out is rare (4.0%).
Easy remembers only the last 2 clues and Normal only the last 3, then picks a number that fits them, a bit like a person who forgets earlier hints. Hard uses every clue and picks the number that leaves the fewest codes on average after the next clue.
Average guesses for the AI to solve a code alone, over 1,000 games per level (measured October 25, 2026):
| Level | 3 digits | 4 digits |
|---|---|---|
| Easy | 8.1 | 11.2 |
| Normal | 5.7 | 6.7 |
| Hard | 4.7 (max 6) | 5.0 (max 7) |
Luck matters a lot in a duel. Over 1,000 AI-vs-AI games with 3 digits, Hard went 486 wins, 209 draws, and 305 losses against Normal. Measurements for the other games are in AI Difficulty Benchmarks.
Create a room and send the 6-character room code or link to play a friend in real time. The room creator picks the number of digits and guesses first, and the first player switches with every rematch.
Online, only the server knows the secret numbers. Your number is never sent to your opponent's browser. When they guess, the server judges it and sends both of you just the clue. Even opening the developer tools won't show the other number, and both numbers are revealed only when the game ends. See the online play guide for how room codes work.