Skip to content
kawu

How to Play Bulls and Cows

Bulls and Cows is the pencil-and-paper code-breaking game, known in Chinese as 1A2B after its scoring.

The rules

  1. The secret is a string of different digits from 0 to 9: four by default, three or five if you prefer.
  2. Guess a string of the same length, also with different digits.
  3. The answer is xAyB: A counts digits that are right and in place; B counts digits that are right but in the wrong place.
  4. 4A (or 3A, 5A) means you've found it. Fewer guesses is better.

Playing on kawu

Next, read the Bulls and Cows strategy. Prefer colours? Try Code Breaker.

Frequently asked questions

What do A and B mean?

A (a bull) is a digit that's right and in the right place. B (a cow) is a digit that's in the secret but in a different place. 1A2B means one digit is placed right and two more are right but misplaced.

Can the secret start with 0?

Yes. The secret is a string of different digits, not a number: 0 can be anywhere.

How many guesses should it take?

Four digits can always be found in seven guesses with perfect play, and usually in five or six. Three digits in about four; five digits in about seven.

Last updated 2026-10-20

Play Bulls and Cows now →Bulls and Cows strategy