OSRS Mastermind Solver
Solve every OSRS Mastermind lock: the Fremennik Exiles cave door, the Secrets of the North chest and each lockpicking puzzle. Enter a try, get the best next guess.
Your tries
| Try | Guess and marks | Codes left | Remove |
|---|
What each slot can still be
How many of the codes that fit have each value in each slot. A dash means that slot cannot be that value.
Codes that still fit
A worked game
| Try | Guess and marks | Codes before | After |
|---|
Every lock
Every Mastermind lock in the game. Pick one in the panel and the page plays by its rules.
| Lock | Pins | Tries | When the tries run out |
|---|---|---|---|
| The Fremennik ExilesThe cave door on the Island of Stone, resealed by the basilisks. Values Air, Water, Earth, Fire, Astral, Cosmic. Nothing to carry: the door opens once the runes are right, and it stays open after that. | 4 | 9 | After nine wrong tries (eight on the board and one more) the puzzle resets with a new code. |
| Secrets of the NorthThe chest in the secret room off the Carnillean Mansion basement, holding the dusty scroll. Values 1, 2, 3, 4, 5, 6. A lockpick or a hair clip. | 6 | ~9 | Running out of tries resets the lock, and the code stays the same. |
| Desert Treasure II - The Fallen EmpireThe four locked stone chests around Kasonde, holding barricades and satchels. Values 1, 2, 3, 4, 5, 6. Nothing to carry. | ~4 | ~9 | Running out of tries resets the lock. |
| Desert Treasure II - The Fallen EmpireThe gate at point L of the Ghorrock Prison map. Values 1, 2, 3, 4, 5, 6. The lockpick from under the bed slab in your cell. | 6 | ~9 | Running out of tries resets the lock. |
| The Final DawnThe blue chest in the hidden room behind the painting in Metzli's chambers. Values 1, 2, 3, 4, 5, 6. Nothing to carry. You cannot open it while you hold an emissary scroll. | ~4 | ~9 | Running out of tries resets the lock. |
| Fallen From GraceThe door of the Ardeaglais cathedral on Wyrmscraig, picked again to leave. Values 1, 2, 3, 4, 5, 6. Something to pick the lock with. | 5 | ~9 | Running out of tries resets the lock with a new code: "Your fingers go numb from fiddling with the lock. You'll need to try again." |
| King's RansomThe metal door of the cell where the Knights of the Round Table are held. Values 0, 1, 2, 3, 4, 5. A hair clip (Telekinetic Grab it from the guard) or a lockpick from one of the knights. | 4 | ~10 | A wrong try says "That wasn't the correct combination of tumblers. Try again." |
The Secrets of the North chest keeps its code when it resets, and the Exiles door and the cathedral door change theirs. For the other locks the page starts again from a new code after a reset: tick the box if the same try gets the same marks as before, and your earlier tries count again.
How many guesses the solver needs
Played against every possible code. The Exiles door takes at most 5 guesses, the same worst case as Donald Knuth's method for the board game. A six-pin lock takes at most 6, and only 2 of its 46,656 codes need that many.
| Figure | Exiles door | 3 pins | 4 pins | 5 pins | 6 pins |
|---|---|---|---|---|---|
| Codes | 1,296 | 216 | 1,296 | 7,776 | 46,656 |
| First guess | Air, Air, Water, Water | 123 | 1234 | 12345 | 123456 |
| Most guesses | 5 | 4 | 4 | 5 | 6 |
| Average | 4.45 | 3.24 | 3.29 | 3.36 | 3.44 |
| Solved in 1 | 1 | 1 | 1 | 1 | 1 |
| Solved in 2 | 6 | 8 | 32 | 76 | 216 |
| Solved in 3 | 64 | 146 | 858 | 4,796 | 26,153 |
| Solved in 4 | 557 | 61 | 405 | 2,892 | 19,650 |
| Solved in 5 | 668 | 0 | 0 | 11 | 634 |
| Solved in 6 | 0 | 0 | 0 | 0 | 2 |
King's Ransom's lock has four tumblers with heights 0 to 5, so it plays like the four-pin locks. Raising each pin that is not green by one after every try opens any lockpicking lock in six tries or fewer, since each pin has six values, but it ignores the blue marks. The first pin guess counts upwards because unused numbers are all alike at the start; the same pattern in other numbers works just as well.
Every answer is exact. The page checks every possible code against every try you enter, so a misread mark is the one thing that can lead it wrong; when no code fits, it names the first try that rules them all out. Figures with a ~ are estimates. Checked against the OSRS Wiki on 9 November 2026.
How to use the solver
Pick your lock, set the slots to what you will try, and press Confirm in the game. Then copy what the lock showed: on a pin lock, tap each pin until its mark matches; on the Exiles door, count the green and red checks. Press Add this try and the page shows the best next guess, how many codes still fit and how many tries you have before the lock resets. Set the best guess fills the slots with it, so you only need to copy it into the game.
The best next guess is the one that leaves the fewest codes in the worst case, whatever the lock answers. When guesses tie, the page prefers one that could be the code itself, then the one that leaves the fewest codes on average. It is rarely the guess a person would pick: an early guess that cannot be the code often tells you more than one that might be.
How the locks mark a try
The cave door in The Fremennik Exiles works like the board game. Its code is four runes from six (air, water, earth, fire, astral and cosmic), a rune can be used more than once, and each try earns a green check for every rune in the right place and a red check for every other rune that is in the code but somewhere else. The checks are not tied to slots, so the door never says which rune earned which check.
The lockpicking locks mark each pin on its own. A green pin is right. A blue pin has a number that the code uses on another pin. A pin with neither is wrong (King's Ransom draws it red). Blue is counted: if the code has one 3 and you set two pins that are not green to 3, only the leftmost of them turns blue, and the other stays unmarked.
Other quest puzzles
The runedoku on Ali Morrisane's caskets in Rogue Trader is the other lock you solve rather than pick, and the Runedoku solver fills them in. The Optimal Quest Guide puts these quests in order for your account, and the quest XP rewards calculator lists what each one gives.
Update history
Every change to this calculator
- Calculator added