HumanDebugminigames & tests

Your streak

How it works

The site has a new address

We're now at humandebug.eu. We've brought over the progress saved in your browser.

If you had an account, sign in again: your leaderboards, records and streak are waiting for you, nothing has been lost.

Sign in

Crack the code: how to solve the safe puzzle

By Luigi Federico · updated

A three-digit lock and five guesses with their clues: “682, one digit right and in the right place”, “738, nothing is right”. It is one of the most shared logic puzzles online, and almost everyone tries it by eye. With a method it always works, even with five digits.

Play Crack the Safe5-10 min, new every day, free

How the game works

Every day 5 safes, the same for everyone, from easiest to hardest: from 3 to 5 digits, with more clues and less direct ones. The code always has all different digits.

Every safe is generated and checked by the computer: only one code is possible and every clue is needed, so removing any clue leaves more than one code. Turn the wheels and press Open: each wrong try costs 20%, and on the fifth the safe locks. You can also skip it and see the solution step by step.

First of all: rule out

Start from the “nothing is right” clues: all their digits drop out of the code. Cross them out at once, in the other guesses too: a clue with a digit ruled out gets simpler.

Then look at digits that appear in several guesses. If the 6 is in the right place in one clue and in the wrong place in another, it can't be in both places: that tells you where it is, or that it isn't there.

Right place or wrong place

“Wrong place” tells you two things: the digit is in the code, and not there. It is the most useful clue, because it takes a position away from a digit you know is in. “Right place” doesn't tell you which digit: you have to cross it with another clue.

When one clue alone isn't enough, combine two: try the few options of the first and see which one contradicts the second. The hard safes in the game need exactly this.

Why it is hard

The mind looks for a code that confirms the clues instead of asking which codes they rule out. Psychologist Peter Wason showed it in 1960 with a rule task: almost everyone tries to confirm their idea, few try to disprove it. Rule out first, confirm later, and you get there much faster.

Frequently asked questions

Can digits repeat?
No: in the game the code always has all different digits, like in the classic lock puzzles.
Is there really only one code?
Yes: the program tries every possible code (up to 30,240 with five digits) and keeps only safes with a single solution, where every clue is needed.
If I close the page, do I lose the game?
No: the daily game stays saved. When you come back you start from the safe you were on, with the wrong tries already made.

Source: P. C. Wason, On the failure to eliminate hypotheses in a conceptual task (1960).

Educational content, not medical or psychological advice.

More guides