How a master lock uses spacer pins and two shear gaps per stack, so one master key opens several locks that each have their own key.
A master key opens many locks, while each lock's own key opens only that one. This lock has been cut in half so you can see inside. Drag anywhere to turn it around.
This is a pin tumbler lock, the kind found on many front doors.
The plug in the middle turns to open the lock. Five stacks of tiny pins stand in its way, pushed down by springs. Each stack crosses the shear line, the thin gap between the plug and its case, so the plug cannot turn.
The whole cylinder is only about 26 millimetres long.
Each notch on a key lifts one pin stack to an exact height. With the right key, every stack splits right at the shear line. Nothing crosses the gap any more, so the plug turns.
This key is wrong in just one notch. That stack is lifted one step too high, so a pin still crosses the shear line. The plug stays locked, shown here in red.
Here is the trick. Each stack in this lock has an extra thin pin, called a master pin or spacer, shown in gold. A spacer adds a second gap to its stack, so each stack can now split at two different heights.
Spacers are the same width as the other pins, just much shorter.
The master key is cut to different depths. It lifts each stack so the lower gap, under the spacer, lands on the shear line instead. The spacers ride up with the top pins and the plug turns again.
Try each key and watch which gap lands on the shear line. A building can be set up this way: every door has its own key, and one master key fits them all.
A grand master key goes one level higher and opens several master groups.
Because each stack has two gaps, a key can use either height in every notch. This mixed key borrows from both keys, and it works too. With five stacks, 2 × 2 × 2 × 2 × 2 = 32 different keys open this lock.
That is why locksmiths plan master key systems carefully: more gaps mean more ways in.