Skip to main content
L
Loopaloo
Buy Us a Coffee
All ToolsImage ProcessingAudio ProcessingVideo ProcessingDocument & TextPDF ToolsCSV & Data AnalysisConverters & EncodersWeb ToolsMath & ScienceGames
Guides & BlogAboutContact
Buy Us a Coffee
L
Loopaloo

Free online tools for developers, designers, and content creators. Your files are processed in your browser and are never uploaded - no accounts required. A few network utilities (like What's My IP and Currency Converter) call public APIs to do their job and say so on their pages.

support@loopaloo.com

Tool Categories

  • Image Tools
  • Audio Tools
  • Video Tools
  • Document & Text
  • PDF Tools
  • CSV & Data
  • Converters
  • Web Tools
  • Math & Science
  • Games

Company

  • About Us
  • Contact
  • Blog
  • FAQ

Legal

  • Privacy Policy
  • Terms of Service
  • Disclaimer

Support

Buy Us a Coffee

© 2026 Loopaloo. All rights reserved. Built with privacy in mind.

Privacy|Terms|Disclaimer
  1. Home
  2. Games
  3. Mastermind
Add to favorites

Mastermind

Crack a secret colour code from right-place and wrong-place feedback, with a live count of the codes still possible. Four difficulties, six modes and a daily code.

No account, nothing trackedMore gamesJump to full guide

Initializing in your browser…

You might also like

Sudoku

Play fresh Sudoku puzzles at five difficulties, each checked to have exactly one solution. Notes, undo, and hints that explain why a digit belongs.

Minesweeper

Clear the minefield using the numbers as clues. The three classic boards or your own size, a safe first click, chording, long-press flags on phones and best times.

Breakout

Break every brick with a bouncing ball and paddle. Endless levels, boss fights, fourteen power-ups and coins for upgrades, with mouse, touch and keyboard control.

A sample round

A Normal game: 4 pegs, 6 colours, repeats allowed, so 1,296 possible codes. The secret is red, green, blue, yellow. Here are your first two guesses.

Guesses

1. red red blue blue
2. green yellow blue purple
What Mastermind produces

Feedback and codes left

1. 2 green, 0 amber   (114 codes left)
2. 1 green, 2 amber   (13 codes left)

The first guess matches red in the first place and blue in the third, so two green dots; the second red and the second blue have nothing left to match, so no amber. Only 114 of the 1,296 codes would have answered that way. The second guess keeps blue in third place (one green), and green and yellow are both in the code but in the wrong places (two amber), while purple is absent. Combined with the first answer that leaves 13 codes, and a good third guess can split those so the fourth or fifth one wins.

Break a hidden colour code by deduction

Work out a secret code of four or five coloured pegs. After each guess you are told how many pegs are the right colour in the right place and how many are the right colour in the wrong place, and the game counts how many codes still fit everything you have learned. Four difficulties and six modes include a daily code and a mode where the computer tries to break yours.

How to play

  1. 1Choose a mode and a difficulty, or keep Classic on Normal.
  2. 2Tap colours (or press their number keys) to fill the pegs of your guess.
  3. 3Tap a peg in your row to clear it, then press Check or Enter.
  4. 4Read the feedback: green for the right colour in the right place, amber for the right colour in the wrong place.
  5. 5Use the Codes left count and the deductions panel to plan your next guess.
  6. 6Break the code before your guesses run out, then play again or replay your game.

Tips & best practices

  • Open with two pairs, such as red, red, blue, blue. It splits the possibilities more evenly than four different colours.
  • Watch the Codes left count: a guess that barely lowers it taught you little, so try something more different next time.
  • When the feedback total drops between two guesses, compare them: the colours you changed explain the difference.
  • Try to make every guess one that could still be the answer, unless a different guess would rule out far more codes.
  • Use the deductions panel to spot colours that are already ruled out, and stop using them.

Why play it

  • Practising logical deduction

    Every guess narrows the possibilities, and the Codes left counter shows exactly how much.

  • A daily puzzle

    The daily code is the same for everyone on a given day, so you can compare guess counts with friends.

  • Learning how a computer solves it

    Set a code in Code maker mode and watch each guess the computer chooses to split the remaining codes.

  • Teaching with colour and symbols

    Easy mode with symbols on pegs works well for children and for colour-blind players.

Controls and rules

  • Four difficulties from 256 to 32,768 possible codes
  • Classic, Timed, No repeats, Super, Daily and Code maker modes
  • Feedback that handles repeated colours correctly
  • A live count of the codes still consistent with your answers
  • A deductions panel built only from the feedback you have seen
  • Two hints per game that lock a peg to its true colour
  • A computer code breaker that uses Knuth's minimax strategy
  • Symbols on pegs for colour-blind players, and four colour themes
  • Keyboard controls, replay of finished games and a shareable daily result
  • Statistics, streaks and achievements saved in the browser

Examples

  • A first guess on Normal

    Red, red, blue, blue against a secret of red, green, blue, yellow earns two green dots. Codes left drops from 1,296 to 114.

  • A swapped pair

    If the code is red, blue, green, yellow and you guess blue, red, green, yellow, you get two green dots and two amber: the two pegs you swapped are right in colour but not in place.

  • Stumping the computer

    On Expert the computer has six guesses for 32,768 possible codes. Set an awkward code with repeats and see whether it gets there.

How it works

How a round works. Pick a colour for each peg and press Check. The feedback beside your row has one green dot for every peg that is the right colour in the right place and one amber dot for every peg that is the right colour but in the wrong place. The dots are not in the order of your pegs, so part of the puzzle is working out which pegs earned them. Break the code within the guess limit to win.

Repeated colours. Codes may use a colour more than once, and the feedback counts colours fairly: exact matches are counted first, and an amber dot is only given for colours left over after that, so a guess never earns more dots for a colour than the code contains. For example, guessing red, blue, blue, blue against the code red, red, blue, green gives two green dots and no amber: the first red and one blue are exact, and nothing that is left matches. No repeats mode removes this wrinkle by using each colour at most once in the code.

Difficulties and modes. Easy uses 4 pegs and 4 colours with 12 guesses, which is 256 possible codes. Normal is the classic 4 pegs, 6 colours and 10 guesses, or 1,296 codes. Hard uses 5 pegs and 6 colours with 8 guesses (7,776 codes), and Expert 5 pegs and 8 colours with only 6 guesses (32,768 codes). Classic plays by the standard rules. Timed adds a clock of 10, 5, 3 or 2 minutes that pauses if you switch tabs. Super adds a ring to each of your pegs showing whether it is right, in the wrong place or not in the code. Daily gives everyone the same code on the same calendar day. In Code maker you set the code and the computer tries to break it, using the minimax strategy Donald Knuth described in 1976, which never needs more than five guesses on the standard board.

Help for thinking it through. The Codes left counter shows how many codes are still consistent with every answer you have had, so you can see how much each guess taught you. The "What your answers prove" panel lists, from the feedback alone, how many of each colour the code can contain and which colours are still possible at each peg. Two hints per game each lock one peg to its true colour, at a cost of 150 points. Symbols on pegs adds a shape to every colour for colour-blind players. You can play with the mouse or touch, or with the keyboard: number keys place colours, Backspace removes the last one, Enter checks and H takes a hint. A win scores 1,000 points plus 100 for every guess you had left (and 2 for every second left in Timed mode), minus hints, multiplied by 1, 1.5, 2 or 3 from Easy to Expert. Statistics, streaks and achievements are kept in this browser.

Frequently asked questions

What do the green and amber dots mean?

Each green dot is a peg of the right colour in the right place. Each amber dot is a peg of the right colour in the wrong place. A position with neither gets no dot, and the dots do not line up with your pegs.

How are repeated colours scored?

Exact matches are counted first. Amber dots are then given only for colours still left over on both sides, so you never get more dots for a colour than the code holds. Red, blue, blue, blue against red, red, blue, green scores two green and no amber.

What does Codes left mean?

It is the number of possible codes that would have given exactly the feedback you received for every guess so far. When it reaches 1, the code is determined and you only need to enter it.

How does a hint work?

It reveals the true colour of one peg you have not yet got right in any guess and locks it into your row. You get two per game, and each costs 150 points.

How good is the computer in Code maker mode?

On the standard 4 peg, 6 colour board it follows Knuth's minimax strategy and always breaks the code within five guesses. On the larger boards it searches within a time limit so the page stays responsive, which means it can occasionally run out of guesses on Expert.

Is the daily code the same for everyone?

Yes, for a given difficulty and calendar date. It changes at midnight in your own time zone, and replaying it does not change it.

Can I play with the keyboard?

Yes. Number keys place colours, Backspace removes the last peg, Enter checks your guess and H takes a hint. After a game, Enter or N starts a new one. The keys only work while the game is on screen.

Related tools and how they differ

  • Wordle: The same kind of deduction with letters: coloured tiles say what is right and where.
  • Sudoku: A pure logic puzzle with no guessing at all once you know the techniques.
  • Minesweeper: Another game of reading clues and ruling possibilities out.

Private by design

The game runs entirely in your browser. No account is needed and no gameplay data is collected.