
What is Bulls and Cows?
Bulls and Cows is a code-breaking guessing game. A secret code of four different digits is hidden, and after each guess you are told how many digits are right and in the right place (bulls) and how many are right but in the wrong place (cows). From those two numbers alone you work out the code.
It is an old pencil-and-paper game for two players and the forerunner of the board game Mastermind. This version was built by Daily Guessing Game: the computer sets the code, you get 8 guesses, and there is one daily code for everyone plus unlimited practice.
How to play Bulls and Cows
- Press Play. The game loads on this page.
- Enter four digits. Tap the number pad or type on your keyboard. A digit cannot be used twice in one guess, and a code can start with 0.
- Press Guess (or Enter). Your guess is added to the list with its score.
- Read the score. Each bull is a correct digit in the correct position. Each cow is a correct digit in the wrong position. You are not told which digits earned them.
- Crack the code within 8 guesses. Four bulls wins.
A worked example
Suppose the code is 4271 and you guess 1234.
- The 2 is in the code and in the right place: 1 bull.
- The 1 and the 4 are in the code but in the wrong places: 2 cows.
- The 3 is not in the code at all.
The game reports "1 bull, 2 cows". It is up to you to find out which digit is which.
How many codes are there?
With four different digits chosen from 0 to 9 there are 10 × 9 × 8 × 7 = 5,040 possible codes. That sounds like a lot for 8 guesses, but every answer removes most of them. Computer analysis of Bulls and Cows has shown that with perfect play any four-digit code can be found in 7 guesses or fewer, so the 8 you get here leave a little room for error.
Strategy for Bulls and Cows
- Open with fresh digits. Guesses such as 0123 and then 4567 test eight different digits in two turns. Whatever is left over tells you about 8 and 9 without spending a guess: the bulls and cows of the first two guesses plus the digits from 8 and 9 must total four.
- Add up bulls and cows. Their sum is the number of correct digits in a guess, whatever the positions. A total of 0 is good news: all four digits are eliminated.
- Change one thing at a time. Swap two digits or replace one, and compare the new score with the old one. If a bull turns into a cow, you know which position mattered.
- Make every guess possible. Before you press Guess, check the guess against all earlier scores. A guess that could not be the code can still be useful early on, but late in the game it wastes a turn.
- Keep notes. Players traditionally write out the digits 0 to 9 and cross off the ones that are ruled out.
Daily and Practice modes
- Daily: one code per day, the same for every player. Progress is saved in your browser, so you can close the page and come back. A new daily Bulls and Cows code starts at midnight in your own time zone.
- Practice: unlimited rounds with a new random code each time.
When you finish you can copy a result that shows the bulls and cows of each guess as coloured dots, without revealing the digits.
Bulls and Cows FAQ
How do you play Bulls and Cows?
Guess a four-digit code with no repeated digits. A bull is a correct digit in the correct position; a cow is a correct digit in the wrong position. Use the counts to work out the code within 8 guesses.
What is the difference between a bull and a cow?
A bull means right digit, right place. A cow means the digit is in the code but in a different place.
How many possible codes are there in Bulls and Cows?
5,040. Four different digits from 0 to 9 can be arranged in 10 × 9 × 8 × 7 ways.
Can a code start with zero or repeat a digit?
A code can start with 0. It cannot repeat a digit, and neither can your guesses.
Is Bulls and Cows the same as Mastermind?
They are close relatives. Bulls and Cows is the older pencil-and-paper game played with digits; Mastermind is a board game that uses coloured pegs.
Is the daily code the same for everyone?
Yes. Everyone playing on the same date gets the same code. It changes at midnight in your own time zone.
Who made this version of Bulls and Cows?
It was built by Daily Guessing Game for this site.



