Code Crack
Runs entirely on your device — works with the network off, no ads, no account, no tracking.
- Works offline
- Keyboard playable
- Screen-reader playable
- No ads, no account
- No betting, no money, no prizes
- 2–5 minAll ages
How do you narrow a hidden four-digit code down from exact and misplaced clues?
By treating every answer as a filter over the whole list of possible codes rather than as a hint about individual digits. Start with a spread opening such as 0123: whatever comes back, it splits 5040 codes into a much smaller group. If it answers 0 in place, 0 misplaced you have deleted all four of those digits at once and are down to 360 codes — an enormous win from one question. Then ask about a code that is itself still possible and that moves digits you are unsure about into different positions; a guess that could win outright and also splits what is left is doing two jobs. The count under each row is the only score that matters while you play: a guess that takes 210 codes down to 14 taught you more than one that takes it to 190, however encouraging the second one felt. Near the end, use the ★ and ✕ marks — once four digits are starred you already know the whole digit set and the only question left is the order, which is at most 24 arrangements and usually far fewer.
Build a four-digit code with no digit twice. 5040 codes are possible and you have 7 guesses.
Find the hidden four-digit code. No digit is used twice.
5040 codes are possible: ten digits, four places, none repeated. Fill all four slots to ask about one of them.
- ✓ right digit, right place
- △ right digit, wrong place
- ★ in every code that still fits
- ✕ in none of them
- ◆ standing in your guess
5040 of 5040 codes still fit every answer. 0 of 7 guesses used.
← → choose a position · ↑ ↓ change its digit, skipping any digit already standing elsewhere · Enter asks about the code · Backspace clears the position, which is free. Click the board first, or press Tab to focus it.
What this builds
SKILL — judge a guess by how much it cuts the field, not by how right it feels — the guess that halves what is still possible has taught you more than the one that scored better
Crack a four-digit code by ruling codes out
There is a hidden code: four digits, no digit used twice. Ask about any code and you are told two numbers — how many digits are right and in the right place, and how many are right but in the wrong place. Nothing else. Ten digits in four places with no repeats makes exactly 5040 possible codes, and every answer you get throws most of them away. Code Crack counts the survivors for you after every guess: 5040, then a few hundred, then a dozen, then one. Watching that number fall is the game — it turns guessing into elimination, which is a different and much better skill.
It runs entirely on your device: 0 network requests, works offline. No ads, no account, nothing to buy, and no betting, money or prizes of any kind.
How to play
- Focus the board — click it, or press Tab until it is focused.
- Choose a position with the left and right arrows. The four boxes are positions 1 to 4, numbered underneath.
- Set its digit with the up and down arrows, or click a digit on the strip below. Any digit already standing in another position is skipped over, so you can never build a code with a repeat in it — the hidden code never has one either.
- Press Backspace to empty the position you are on. Clearing and rearranging cost nothing; only asking a question does.
- Press Enter, or click Ask about this code, to spend one guess. You get back ✓ n in place and △ n misplaced, and the row records how many codes were still possible before your guess and how many are left after it.
- Read the strip. A digit marked ★ in appears in every code that still fits, so it is certainly in the answer. One marked ✕ out appears in none of them, so it certainly is not. Both are proved from your own answers, not hinted.
- Watch the line under the board. While you are building a code it tells you whether that code is still one of the survivors, or how many of your own answers already rule it out.
- Win by asking about the code itself. Lose by running out of guesses — you get between seven and ten, depending on how hard the board is to eliminate.
FAQ
How do you narrow a hidden four-digit code down from exact and misplaced clues?
By treating every answer as a filter over the whole list of possible codes rather than as a hint about individual digits. Start with a spread opening such as 0123: whatever comes back, it splits 5040 codes into a much smaller group. If it answers 0 in place, 0 misplaced you have deleted all four of those digits at once and are down to 360 codes — an enormous win from one question. Then ask about a code that is itself still possible and that moves digits you are unsure about into different positions; a guess that could win outright and also splits what is left is doing two jobs. The count under each row is the only score that matters while you play: a guess that takes 210 codes down to 14 taught you more than one that takes it to 190, however encouraging the second one felt. Near the end, use the ★ and ✕ marks — once four digits are starred you already know the whole digit set and the only question left is the order, which is at most 24 arrangements and usually far fewer.
Why are repeated digits not allowed?
Two reasons, and the second is the real one. It removes a whole class of confusing answers — with repeats present, one digit in the code can be "used up" by two in your guess, and the counts stop matching most people's intuition. More importantly it pins the number of possible codes at exactly 10 × 9 × 8 × 7 = 5040, which is small enough for the game to walk the entire list after every single guess. That is what lets it show you an exact survivor count instead of a vague hint, and the exact count is the thing worth learning from. The entry control enforces it structurally: a digit standing in one position is skipped when you scroll another, so a repeat is not rejected — it cannot be typed.
How is the guess budget decided?
By a solver, not by a designer. Before the board is dealt, a reference eliminator plays it out: it asks about the first code still consistent with everything it has been told, filters the survivors by the answer, and repeats until only the code is left. That is run from four fixed openings which between them touch all ten digits, and the budget is the worst of those four runs plus two spare. Using a single opening would be unfair in a subtle way — 0123 is the first code in list order, so an eliminator starting there would appear to solve that particular board in one guess when it is no easier than any other. Because the budget comes from a run that actually finished, it is always achievable: playing strictly by elimination wins every board here, with guesses to spare.
Can the game ever deal a code I could not have worked out?
No, and that is structural rather than lucky. The code is drawn by taking four digits at random without replacement, so it is by definition one of the 5040 codes the game enumerates, and the answers you are given are computed from that same code. The list of survivors therefore always contains the answer, can never be empty, and shrinks to exactly one code. There is no generate-and-check loop that could fail, and no seed that produces an unfair board — the worst that can happen is that you spend guesses on codes your earlier answers had already ruled out, which the board flags for you.
Is there any money, betting or in-app purchase in this?
None, and there never will be. No currency, nothing to buy, no hints to unlock for a fee, no prizes.
Does it work offline?
Yes. Once the page has loaded once, the whole game — the board, the code generator, the exact survivor count and the solver the budget comes from — is on your device. No server is involved in play at any point, and nothing about your game leaves the browser.
Can I play it with a keyboard or a screen reader?
Both. Arrows choose a position and change its digit, Enter asks, Backspace clears. Every position announces its number and its digit; every answer is announced as words and numbers — "two in place, one in the code but misplaced" — with the survivor count after it; and every digit on the strip announces whether it is certainly in the code, certainly not, or unproved. An empty position carries a dashed edge and a ·, a digit standing in your guess carries ◆, and the proved digits carry ★ or ✕, so nothing on the board depends on telling two colours apart.
Limits
Ten digits, four positions, no repeats: 5040 possible codes, which the game walks in full after every guess, so the survivor count and the ★/✕ marks are exact rather than estimated. Answers are the two standard counts and nothing more — the game never tells you which digit was right. The budget runs from seven guesses on the loosest boards to ten on the tightest, and comes from the reference eliminator's worst opening plus two. Score is 200 for a solve, 70 for each guess you did not need, and 150 more if every guess you made was still possible when you made it.
Related
Colour Code is the sibling puzzle: the same two-number answer, but six symbols with repeats allowed and no survivor count — pure deduction in your head. Gap Logic turns on order rather than elimination, and Light Grid turns on parity.
Bookmark this page (Ctrl+D, or ⌘D on Mac) or install the app — it works offline the next time you need it.
Have a question or feedback about this game?
Private: this note isn't tracked, and nothing you did in this game is sent — only what you type here.