Starting the game

Bulls and Cows online

The classic number code-guessing game. Rules, an example, strategy and a free game with friends in your browser.

1

What is Bulls and Cows?

Bulls and Cows (also called Cows and Bulls) is a logic game for two players in which you have to guess a secret code made of digits. All you need is paper and a pen, and the hints after each guess let you narrow down the possible answers step by step.

The game is older than the Mastermind board game, and computer versions of it were written as early as the late 1960s. It is still a great way to practise logical thinking and ruling out possibilities.

2

Bulls and Cows rules

  • One player thinks of a secret code, usually 4 digits, e.g. 7 0 4 1.
  • The other player guesses by naming any code of the same length.
  • After each guess they are told how many bulls and how many cows there are.
  • A bull (🐂) is a right digit in the right place.
  • A cow (🐄) is a right digit in the wrong place.
  • Whoever cracks the code in the fewest guesses wins.

You will find the exact rules of the online version, including game modes and time limits, on the page Game rules.

3

Example game

This is how a game could go when the secret code is 7041.

AttemptScoreWhat it tells you
12340 🐂 2 🐄No digit is in its place, but two of 1, 2, 3, 4 are in the code.
56711 🐂 1 🐄One digit is in the right place, another is in the code somewhere else. You can cross out 5 and 6.
74012 🐂 2 🐄All four digits are right; two of them need to swap places.
70414 🐂 0 🐄Four bulls: code cracked in 4 guesses.
4

Strategy: how to win at Bulls and Cows

Find the digits first

Two opening guesses without repeats, e.g. 1234 and 5678, show how many digits are in each group. If together they give fewer than 4 hits, the missing digits are 9 or 0.

A 0 and 0 result is good news

When a guess has no bulls and no cows, you can cross out all of its digits at once. Your next guesses get much easier.

Then place them

Once you know the digits, move them one at a time. Every swap that changes the number of bulls tells you where a digit belongs or where it certainly does not.

Every guess must fit all the clues

Before you guess, check that your code would give the same results for all your previous guesses. It is the simplest way not to waste moves.

5

How to play online?

Guess The Code is an online version of Bulls and Cows for 1–4 players. Everyone sets a secret code and guesses the rivals’ codes, and the game counts the bulls and cows for you. You can play with friends over the internet, against a bot, on one phone in Hot Seat mode, or solve the daily puzzle.

How to start in 10 seconds

Go to the home page, click “Create lobby”, then add a bot or send your friends the lobby code. No download and no sign-up.

The step-by-step guide shows how: How to play?.

6

Mastermind, Wordle and Bulls and Cows

Bulls and Cows vs Mastermind

Mastermind is a board-game version of the same puzzle: coloured pegs instead of digits, and black and white key pegs instead of bulls and cows. The logic is the same.

Bulls and Cows vs Wordle

Wordle works in a similar way, but with words, and it shows a colour for each letter. In Bulls and Cows you only get the counts, so you have to work out yourself which digits were hits.

7

Frequently asked questions

Can I play Bulls and Cows online with friends?

Yes. In Guess The Code you create a lobby, send your friends a 6-character code and play together in the browser, on a phone or a computer. Up to 4 people per game.

Can I play alone?

Yes. You can guess a code made up by the computer in Solo mode, or add a bot to the lobby and play against it.

Can digits repeat in the code?

Not in the classic version, where each digit appears once. In Guess The Code digits can repeat and a code can start with zero, which makes the puzzle a little harder.

How many guesses does it take to crack the code?

In the classic version with 4 different digits there are 5040 possible codes. With the best strategy every one of them can be cracked in at most 7 guesses, a little over 5 on average. Without a computer it usually takes a few more.

Is the game free?

Yes. Guess The Code is free, runs in your browser and needs no download or account.