How to Play Bulls and Cows
Bulls and Cows is a classic number guessing game of pure logic. One player thinks of a secret number, and the other tries to find it. After every guess, the only feedback is two counts: how many bulls and how many cows the guess scored. You piece those clues together, rule numbers out, and home in on the answer. All you really need is a pencil and paper, which is why it has been played in classrooms, on long car trips and on early computers for generations. Here you can play it online for free — on your own, as a daily puzzle, in a race against the computer, or by letting the computer try to crack your number.
The secret number
In the standard game, the secret is a 4-digit number made from the digits 0–9, with every digit different — for example 4271 or 0385. A leading zero is fine. If you are new to the game, try 3 digits first: there is less to keep track of, and you will pick up the logic quickly.
How to count bulls and cows

Compare the guess with the secret number digit by digit. A digit that is correct and in the correct position is a bull. A digit that appears in the answer but in a different position is a cow. In the example above, the 2 is in the second position in both numbers, so it’s a bull. The 1 and the 4 are in the answer, just not where they were guessed, so they are cows. The 3 isn’t in the answer at all and scores nothing.
The key twist is that you only learn the totals — “1 bull, 2 cows” — never which digits earned them. Working out which is which is the whole puzzle. When you score 4 bulls (or 3 on the 3-digit game), you have cracked the number.
On screen, bulls are shown as filled red circles (●) and cows as white circles (○), and the result is also written out, for example “1 bull, 2 cows”. In the two-column race view the results are shortened to “1B 2C”.
Zero bulls and zero cows is a great result

A guess where nothing matches feels like a miss, but it is actually solid information: those digits are out. To keep track, use the Memo feature. Press “Memo”, then tap a digit to cycle it through × (not in the answer), ○ (in the answer) and no mark. Writing down what you know as soon as you know it saves a lot of second-guessing later.
Counting with repeated digits

If you allow repeated digits in the settings, numbers such as 1123 or 0000 become possible answers. The rule then is that a digit can only score as many times as it appears in the answer. Count the bulls first; then, among the digits left over, count how many the guess and the answer share — those are the cows. In the example, the guess contains two 5s but the answer has only one, so only one of them can score.
Playing against the computer

In a race, you first choose your own secret number — the CPU can’t see it. Then you take turns making one guess each, and whoever cracks the other’s number first wins. Guessing first gives a small edge, so if you want a fairer game, open “Fine-tune the rules” and turn on the last-guess option: the second player then gets one final guess in the same round, and if both players crack it, the game is a draw.
Bulls and Cows Rules: Modes and Variations
There are four ways to play on this page.
| Mode | What you do |
|---|---|
| Solo | Find the number the CPU has hidden in as few guesses as you can. Turn on “Solve within 10 guesses” for a limit. |
| Daily puzzle | One puzzle per date (4 digits, no repeats). Everyone gets the same answer on the same day, so you can compare scores with friends and family. Solve it every day to build a streak. |
| Race the CPU | You and the CPU try to crack each other’s numbers, one guess at a time. |
| Let the CPU guess | You choose a number and the CPU works it out. Each time you press “Next guess”, it shows how many candidates remain and which digits it has pinned down. |
You can also change the number of digits and whether digits may repeat. Each step makes the puzzle noticeably harder:
| Setting | Possible answers | Difficulty |
|---|---|---|
| 3 digits, no repeats | 720 | A gentle start for learning the rules |
| 4 digits, no repeats | 5,040 | The standard game |
| 3 digits, repeats | 1,000 | 000 or 121 are possible — watch your assumptions |
| 4 digits, repeats | 10,000 | The hardest: you must also work out how many times a digit appears |
Bulls and Cows Strategy: Tips to Solve Faster
1. Use different digits for your first two guesses

In the standard 4-digit game, a strong start is two guesses with no digits in common, such as 0123 followed by 4567. For each guess, bulls plus cows equals the number of digits from that group that are in the answer. In the example, one digit comes from 0–3 and two from 4–7, so the last one must be 8 or 9. You still don’t know the positions, but knowing roughly which digits are involved makes everything after that much easier.
2. Look at bulls + cows first
The total of bulls and cows tells you how many of the digits you guessed are in the answer. Deal with that first — “which digits are in?” — and only then use the bulls to decide where they go. Splitting the problem into “what” and “where” keeps your thinking tidy.
3. Change one digit and compare
Suppose 0123 scores 1 bull and 1 cow, and 0129 scores 1 bull and 0 cows. Only the last digit changed, so the difference tells you directly that 3 is in the answer and 9 is not. Changing just one digit turns the result into information about a single digit. It costs a few extra guesses, but it is a very reliable way to make progress.
4. Sometimes guess a number that can’t be the answer
When only a few similar candidates remain — say 2748, 2749 and 2786 — guessing them one at a time might take three more tries if you are unlucky. Instead, you can guess a number you know is wrong but that tests the digits where the candidates differ (4, 8, 9 and 6 here) all at once. The result then tells you exactly which candidate is right, and you win on the following guess.
5. A cow is never where you put it
When a guess scores zero bulls but some cows, every one of those digits is in the answer but not in the position where you placed it. Keep track of that too: along with your ○ memo, remember things like “3 is in, but not third from the left”. Position clues add up quickly.
6. With repeats, guess pairs to count digits
When repeated digits are allowed, a guess made of pairs, such as 1122, is very useful: in one guess it tells you how many 1s and 2s the answer contains between them. The Hard CPU opens the same way — watch it in “Let the CPU guess” mode to see the idea in action.
Bulls and Cows FAQ
Can the number start with 0?
Yes. Numbers like 0385 are valid answers, and you can also start a guess with 0.
How many guesses is a good score?
In the 4-digit game with no repeats, solving in 5 or 6 guesses is very good. Even with careful reasoning, luck can push it to about 7. The 3-digit game still takes around 5 guesses, because each clue tells you less when there are fewer digits.
How do the computer levels differ?
Easy often forgets earlier clues, so it takes a long time to find your number — a good choice for a first race or for playing with younger family members. Normal finds numbers about as fast as a new player: it pays attention mostly to the most recent clue and sometimes overlooks earlier ones. Hard uses every clue properly and usually picks the guess that shrinks the list of candidates the most, whatever the result. Watching the Hard CPU in “Let the CPU guess” mode is a great way to learn good technique.
When does the daily puzzle change?
A new puzzle appears when the date changes on your device. You can replay it as often as you like on the same day, but only your first solve counts toward your record and streak.
Can I stop and continue later?
Yes. Open the page again in the same browser on the same device and choose “Continue”. Your memo marks are kept too.
Is there sound?
Sound is off at first. Press “Sound: off” below the game to turn on button and result sound effects.
History of Bulls and Cows
Bulls and Cows is an old paper-and-pencil game, played in many countries under many names — possibly for a century or more. Around 1970 it was already being written as a program for early computer systems, where it was a favourite because the computer could keep the secret and score every guess instantly. In Japan the same game is widely known as “Hit and Blow”, and it has appeared as a number guessing game on television. The details — how many digits, whether repeats are allowed, whether players take turns — vary from place to place, but the idea is always the same.
Because it is so simple to state and so rich in logic, Bulls and Cows is also a popular exercise for programmers and mathematicians: people have calculated the best possible strategies and written solvers that crack any 4-digit number in just a handful of guesses. For most of us, though, the fun is in the “aha” moment when a scattered set of bulls and cows suddenly points to a single number.