Bulls and Cows: Rules, Strategy and the Word Version
Bulls and Cows is a two-player code-breaking game played with pencil and paper: each player writes a secret code of four different digits, the players take turns guessing each other's code, and every guess is answered with a count of bulls and cows. The first player to crack the other's code wins. The exact origin is unknown, but it has been played on paper for a century or more.
The rules, step by step
- Each player secretly writes a code of four different digits on their own sheet.
- Players take turns. On your turn, write down a four-digit guess and say it out loud.
- Your opponent compares it with their code and answers with two numbers: how many bulls and how many cows.
- Write the guess and the answer on your sheet, in a column you can read later.
- Keep going until someone guesses the other's code exactly. That answer is four bulls.
Whoever guesses first can finish a turn ahead, so some tables let the second player take one more turn. Agree on that before you start.
What a bull and a cow are
A bull is a digit in your guess that is in the secret code and in the same position. A cow is a digit that is in the secret code but in a different position. A digit that is not in the code at all earns nothing.
The key point: the answer never says which digit is the bull or the cow. You only get the counts. All the fun is working out which digits earned them.
A worked example
Say the secret code is 4271. Here is what four guesses would get:
| Guess | Bulls | Cows | Why |
|---|---|---|---|
| 1234 | 1 | 2 | 2 is in the right place; 1 and 4 are in the code but in the wrong places |
| 5678 | 1 | 0 | 7 is in the right place; 5, 6 and 8 are not in the code |
| 4217 | 2 | 2 | 4 and 2 are in place; 1 and 7 are swapped |
| 4271 | 4 | 0 | every digit in place, so the code is cracked |

The names the game goes by
The game is old and travels under many names. The feedback words change with the name.
| Language | Name | Right digit, right place | Right digit, wrong place |
|---|---|---|---|
| English | Bulls and Cows | bull | cow |
| Spanish | picas y fijas, also toros y vacas | fija | pica |
| Russian | быки и коровы | бык | корова |
| Korean | 숫자야구, usually with 3 digits | 스트라이크 | 볼 (아웃 = nothing matched) |
| Turkish | Sayı Bulmaca | artı + | eksi − |
How many guesses it takes
To get a feel for the numbers, a simple solver was simulated: every guess is a random code that still fits all the answers so far, 20 games per code. These are simulation results, not statistics about people.
| Version | Possible codes | Average guesses | Worst game | Solved within 7 |
|---|---|---|---|---|
| 3 distinct digits | 720 | 5.22 | 9 | 96.8% |
| 4 distinct digits | 5040 | 5.48 | 9 | 98.9% |
| 4 distinct digits, no leading zero | 4536 | 5.40 | 9 | 99.2% |
Even with 5040 possible codes, that simple solver needs only about five or six guesses. The method is the next section.
A simple strategy
- Open with two guesses that share no digit. Together the answers tell you roughly how many of those eight digits are in the code.
- Keep a written list. Every guess and its answer goes on paper. Memory fails first.
- Only guess codes that fit every answer so far. Before you guess, check the candidate against each earlier line: if it were the secret, would those lines have got the same answers? If not, it cannot be the code.
The solver in the table follows the last rule. For more on choosing guesses in the word format, see word-guessing strategy tips.
House rules to agree first
- Leading zero: may a code start with 0? Banning it leaves 4536 four-digit codes instead of 5040.
- Repeated digits: the classic game uses different digits only. If you allow repeats, agree how a repeated digit is counted before the first guess.
- How many digits: three is quick (720 codes), four is the usual game.
The word version, and what changes
The same game works with words. Each player writes a secret word on paper, and every answer counts letters without saying which ones: how many are in the right place and how many are in the word but elsewhere. It is the same deduction, with a much larger set of possible secrets.
The modern 5-letter format changes two things. First, the clue is per tile: each letter of your guess is marked on its own, so you learn the position directly instead of only a count. Second, everyone can guess at the same time instead of taking turns. For the full rules of that format, read how to play the 5-letter word game.
Playgridia has no number version of this game. The online game here is Word Duel: five letters, six guesses, with colored tile clues, played against others in real time.

In Word Duel you see your rivals' color grids as they play, but never their letters. For a two-player setup, see the two-player word game guide.
Grab a pencil, agree the house rules, and play three-digit rounds first. Write every guess down and only guess codes that fit. When you want the same deduction with letters and a clock, open Word Duel.
Frequently Asked Questions
How do you play Bulls and Cows?
Each player writes a secret code of four different digits. Players take turns guessing each other's code, and each guess is answered with the number of bulls and cows. The first player to guess the other's code exactly, which is four bulls, wins.
What is the difference between a bull and a cow?
A bull is a correct digit in the correct position. A cow is a digit that is in the code but in a different position. The answer gives only the two counts, never which digits earned them.
How many guesses does it take to crack a four-digit code?
In a simulation of a simple solver that only guessed codes fitting every earlier answer, the average was 5.48 guesses over the 5040 possible codes, and 98.9% of games were solved within 7. That is a simulated solver, not data about people.
Can a code start with zero or repeat a digit?
The classic game uses four different digits, and whether 0 may come first is a house rule to agree before you start. Banning a leading zero leaves 4536 possible codes instead of 5040. If you allow repeated digits, agree how they are counted first.
Is there an online number version on Playgridia?
No. Playgridia has no number version of this game. The online game here is Word Duel, which uses the same kind of deduction with 5-letter words, six guesses and colored tile clues.
How is the word version different from the number version?
In the 5-letter format each tile is marked on its own, so you learn the position directly rather than only a count. Everyone can also guess at the same time instead of taking turns.