Back to Blog
Logic Games · May 2026

Mastermind Game Online — Free, No Download

Mastermind is one of the most elegant logic games ever created. A hidden code of colors. A limited number of attempts. Feedback after each guess that tells you how close you are without revealing what is wrong. The result is a pure deduction puzzle that has captivated players since 1970 and remains one of the best brain training games available today.

MemGenius offers a free online version of Mastermind that you can play instantly on your phone or computer. No download, no login, no cost. Your solving time goes straight to a world ranking.

Play Mastermind now
Free · No login · World ranking
Play now →

How to play Mastermind

The game generates a secret code — a sequence of five colors chosen from a palette of five options. Your goal is to identify the exact code within seven attempts.

After each guess you receive feedback in the form of colored borders on your pegs. A green border means that color is in the correct position. A pink border means that color is in the code but in the wrong position. No border means that color does not appear in the code at all.

The MemGenius version adds one mechanic that makes the game even more intuitive — colors that are in the correct position are automatically pre-filled in the next row. This lets you focus your attention on the positions that are still uncertain, dramatically speeding up your deduction process.

The cognitive science behind Mastermind

Mastermind is a sequential deduction problem. Each guess provides information that constrains the solution space. An optimal first guess eliminates the maximum number of possible codes regardless of the answer. Subsequent guesses use the accumulated information to narrow down the remaining possibilities until only one solution remains.

This process engages the prefrontal cortex — the brain region responsible for planning, hypothesis testing and updating beliefs based on new evidence. It is the same cognitive system used in scientific reasoning, strategic planning and any task that requires forming and revising mental models.

Research in cognitive psychology has shown that games requiring sequential deductive reasoning improve performance on tasks measuring fluid intelligence — the ability to solve novel problems without relying on prior knowledge. Mastermind is one of the clearest examples of a game that directly trains this cognitive system.

Strategies to crack the code faster

Start with maximum information

Your first guess should include as many different colors as possible. If you use the same color twice in your first guess and receive no green or pink feedback for that color, you learn nothing about it specifically — you only know that particular combination did not work. Spreading different colors across all five positions maximizes the information you receive from the first response.

Eliminate before placing

When you receive pink feedback — a color is present but in the wrong position — resist the temptation to immediately move it to another position. First, use subsequent guesses to confirm which positions are wrong. Moving a color to a position that is also wrong costs you an attempt without gaining information.

Use the pre-filled positions

The MemGenius version automatically locks correct positions in the next row. This is a significant advantage — it reduces the solution space immediately and lets you focus your deduction on the remaining positions. Never waste an attempt by moving a confirmed correct color.

Track what you know

Keep a mental or written record of which colors have been confirmed absent, which are present, and which positions have been eliminated for each color. The fastest Mastermind solvers maintain a complete picture of the constraint set at all times and never place a color in a position that prior feedback has already eliminated.

The history of Mastermind

Mastermind was invented by Mordecai Meirowitz, an Israeli telecommunications expert, in 1970. He could not interest major game companies in the concept, so it was published by a small British company called Invicta Plastics. It became one of the best-selling board games of the 1970s, eventually selling over 50 million units worldwide.

The game attracted serious mathematical attention almost immediately. In 1977, Donald Knuth published a paper proving that the original six-color, four-position version could always be solved in five or fewer guesses using an optimal strategy. This made Mastermind one of the first games to be fully solved by algorithmic analysis, and it remains a popular subject in computer science and artificial intelligence research.

Frequently asked questions

Is the Mastermind game on MemGenius free?
Yes, completely free. No login, no download, no subscription. Play directly in your browser on any device.
How many attempts do I get?
Seven attempts to crack the five-color code. Each attempt gives you feedback that narrows down the solution.
What does the green border mean?
A green border means that color is in the correct position in the secret code. That position is automatically pre-filled in your next row.
What does the pink border mean?
A pink border means that color appears in the secret code but in a different position than the one you chose.
How is the ranking calculated?
The ranking is based on solving time. The faster you crack the code, the higher your position on the world leaderboard.
Can I play Mastermind on mobile?
Yes. MemGenius is built mobile-first. Mastermind works perfectly on any smartphone browser with no installation required.

Can you crack the code?

Free Mastermind online. No login. Your time goes straight to the world ranking.

Play Mastermind now
Privacy PolicyTerms of Service