Bulls and Cows strategy: how to crack the code fast
Every guess is a question and every score is an answer. Here is how to ask better questions, shown with a real game you can also watch on the home page.
The best first guess
Any four different digits, such as 1234. Every first guess with four different digits splits the 5,040 possible codes into the same groups, as the table further down shows, so none is better than another. The choice starts to matter with the second guess.
Open with two guesses that use eight different digits
Guess 1234, then 5678. Add up the two scores, counting positions plus digits for each. The total is how many of the code’s four digits come from 1 to 8, and the rest come from 0 and 9. A total of 4 means neither 0 nor 9 is in the code, 3 means exactly one is, and 2 means both are.
A real game, round by round
Leo hid the code 7856. You do not know that yet. These four guesses crack it.
| Round | Guess | Score | Why this guess | What the score tells you |
|---|---|---|---|---|
| 1 | 1234 | 0/0 | Start with four different digits. | None of 1, 2, 3 or 4 is in the code. Cross all four out. |
| 2 | 5678 | 0/4 | Try four new digits. | All four are in the code, but every one is in the wrong spot. The code is 5, 6, 7 and 8 in some other order. |
| 3 | 7851 | 3/0 | Give each digit a new spot, and use 1, a known miss, as a blank. | 7, 8 and 5 are in the right spots, and the blank adds nothing. Only 6 is left for the last spot. |
| 4 | 7856 | 4/0 | Only one code fits every clue. | Cracked in 4 rounds. |
What the first score tells you
There are 5,040 possible codes: four different digits from 0 to 9. Any first guess with four different digits splits them the same way. This table shows how many codes each first score leaves.
| First score | Codes left |
|---|---|
0/0 | 360 |
0/1 | 1,440 |
0/2 | 1,260 |
0/3 | 264 |
0/4 | 9 |
1/0 | 480 |
1/1 | 720 |
1/2 | 216 |
1/3 | 8 |
2/0 | 180 |
2/1 | 72 |
2/2 | 6 |
3/0 | 24 |
4/0 | 1 |
About two games in three open with 0/1, 0/2 or 1/1, which leave the most codes. A 0/0 is the best news: it removes four digits and leaves 360 codes. A 4/0 on the first guess is the one-in-5,040 jackpot.
Use a known miss as a blank
Once you know a digit is not in the code, you can put it in a guess as a blank. In round 3 above, 1 is a blank, so the score only counts 7, 8 and 5. That lets you test where three digits go without any noise from the fourth.
Keep every guess possible
Whenever you can, guess a code that could still be the answer given every score so far. It can win on the spot, and it is easy to check. A computer sometimes picks a guess that cannot win because it splits the codes left more evenly, but for a person a possible guess is the simple, strong choice.
Track what you know with notes
In Hide & Crack, tap a digit in a past guess to mark it In, Maybe or Out, and pin a digit to a spot. Digits marked Out are crossed out on the keypad, so you can see at a glance what is left. Your notes follow the match to every device.
Aim for 7 rounds or fewer
In Solo, 7 rounds or fewer earns an Excellent grade, 8 is Good, 9 or 10 is Fair, and 11 or more is Keep practicing. Seven is a fair target: it has been proved that any code can be cracked within seven guesses, and the best possible average is about 5.21 guesses (Wikipedia). To check a game of your own, enter it in the Bulls and Cows solver. New to the game? Start with the rules of Bulls and Cows.