Canonical: https://toolipedia.app/code-breaker-solver

# Code-Breaker and Bulls and Cows Solver

Enter each guess with its black and white pegs, or bulls and cows, and see how many secret codes are still possible and which guess to try next.

Breadcrumbs: Toolipedia > Everyday tools > Games, puzzles and random picks > Code-Breaker and Bulls and Cows Solver

## About Code-Breaker and Bulls and Cows Solver

Helps you crack the secret code in a colour-peg game or Bulls and Cows. Choose the game, the code length, the number of colours and whether repeats are allowed, then list each guess you made on its own line with the feedback, for example ABCD 1 2 for one black peg and two white pegs. The page lists how many secret codes are still possible, and suggests the next guess that leaves the fewest codes in the worst case (Knuth's minimax idea). In the standard game a first guess AABB with no pegs leaves 256 of 1,296 codes; 1234 with no bulls or cows leaves 360.

## How to use Code-Breaker and Bulls and Cows Solver
1. Pick the colour-peg game or Bulls and Cows and set the code length, number of colours and repeat rule.
2. Type your guesses, one per line, as the code followed by black pegs (or bulls) and white pegs (or cows).
3. Read how many codes remain, play the suggested next guess, and add its feedback as a new line.

## Why use this tool?
- Private: everything happens in your browser. Nothing you enter is uploaded.
- Free, with no sign-up, no watermark and no limit on how often you use it.
- Works on phones, tablets and computers: Android, iPhone, Windows, Mac and Linux. Nothing to install.
- Free to embed on your own website, with a ready-made code to copy.

## Also known as
- code breaker and bulls and cows solver
- code breaker solver
- bulls and cows solver
- code breaker next guess
- colour peg code solver
- 1234 bulls and cows

## Frequently asked questions

### How do I write the colours in the colour-peg game?

Use the letters A to H: A red, B blue, C green, D yellow, E orange, F purple, G pink and H brown. Digits 1 to 8 also work. Bulls and Cows uses the digits 0 to 9.

### What do black and white pegs mean, and bulls and cows?

Black pegs, or bulls, are right symbols in the right place. White pegs, or cows, are right symbols in the wrong place, counted without reusing a peg twice.

### Why does it say no code fits my feedback?

At least one line contradicts the others, usually because the black and white counts were swapped or mistyped. Check each line against the game; the solver never guesses past a contradiction.

### Is Code-Breaker and Bulls and Cows Solver free?

Yes. Code-Breaker and Bulls and Cows Solver on Toolipedia is free to use, with no sign-up and no watermark.

### Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

### Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

### Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.

### Can I put Code-Breaker and Bulls and Cows Solver on my own website?

Yes. Use the Embed on your site button under the tool to copy a short piece of code and paste it into your page. It is free, needs no account, and the tool keeps working inside your page.

## Related tools

More free tools that go well with Code-Breaker and Bulls and Cows Solver:
- [Number Guessing Game](https://toolipedia.app/number-guessing-game)
- [Hangman solver](https://toolipedia.app/hangman-solver)
- [Retro Arcade Games](https://toolipedia.app/retro-arcade-games)
- [Logic Brain Teasers and Peg Solitaire](https://toolipedia.app/logic-brain-teasers-and-peg-solitaire)
- [Maze Game and Solver](https://toolipedia.app/maze-game-and-solver)
