Skip to content
PlayOwl
Everyday machines · #36

How do keys open locks?

A key's bumps and dips lift tiny pins to just the right height, and only then can the lock turn.

The big idea: Each pin in a lock is cut in two. The right key lifts every pin so its cut sits exactly on the line where the inner cylinder meets the outside. Then nothing blocks the cylinder and it can turn.

Start exploring
0 of 5 parts done
A friendly key slides into a cutaway lock and lifts its colorful pins to the shear line, How Things Work poster
1Watch it

What happens when you turn a key?

  1. A front door is locked. Its lock will open for one key and refuse almost every other key in the world. Let's look inside to see how.
  2. Inside, a row of springs pushes stacks of little pins down into the round inner part, called the plug. The pins poke across the gap, so the plug is stuck.
  3. As the key slides in, the pins ride up and down over its bumps and dips, like cars on a hilly road. When the key is all the way in, each pin stops at one height.
  4. The right key lifts every pin by just the right amount. Now the split in each pin lines up exactly on the line between the plug and the outside. Nothing crosses the line!
  5. Now the plug can turn. A little arm on its back end, called the cam, pulls the bolt back out of the door frame, and the door swings open.
  6. A different key has different bumps. Some pins go too high and some don't go high enough, so pins still cross the line and the plug won't turn.
2Look inside

Inside a pin-tumbler lock

This lock is sliced open so you can see inside. Tap each part. Some of them move when you find them!

  • Housing. The housing is the strong outer case of the lock. It is fixed to the door, and it holds the springs and the top pins.
  • Plug. The plug is the round part in the middle with the keyhole in it. When the right key is in, the plug can spin around inside the housing.
  • Springs. Little springs push the pins down all the time. When you pull the key out, they snap the pins back down so the lock is locked again.
  • Driver pins. Driver pins are the top pins. They are usually all the same length. Without the right key they poke down into the plug and block it.
  • Key pins. Key pins are the bottom pins that touch the key. Each one is a different length, so each needs a different cut in the key to line up.
  • Shear line. The shear line is the thin gap where the plug meets the housing. When the split in every pin sits right on this line, the plug can turn.
  • Key. A key's bumps and dips are called cuts. Each cut sits under one pin and lifts it by just the right amount.
  • Cam and bolt. A little arm on the back of the plug, called the cam, turns with the key. It pulls the bolt back out of the door frame.
3Try it

Cut a key to fit the pins

Change the depth of each cut on the key, or drag the notches. Watch where the split in each pin ends up. Then try to turn the key.

Experiment: What has to happen for the lock to turn?

  1. Make one cut very shallow. Where does that pin's split go?
  2. Make the same cut very deep. Where does it go now?
  3. Line up every pin, then press Turn the key.

What we found: A cut that is too shallow lifts a pin too high, and a cut that is too deep doesn't lift it enough. Either way a pin crosses the shear line and blocks the plug. Only when every split lines up can the lock turn.

Turn on JavaScript to try it yourself.

4Solve a challenge

Cut a key for a new lock

Look at the pins and cut a key that opens this lock. For 3 stars, open it on your first test.

5Go deeper

How a lock knows its key

A pin-tumbler lock has two main parts: an outer housing that is fixed to the door, and a round plug inside it that can turn. Holes run down through both, and each hole holds a little stack: a spring, a top pin called the driver pin, and a bottom pin called the key pin.

Without a key, the springs push the pins down so the driver pins poke into the plug. They act like little bolts that stop the plug from turning. The thin gap between the plug and the housing is called the shear line.

The key pins are all different lengths. A key's cuts are made at just the right depths so that, when the key is all the way in, the split between every key pin and driver pin sits exactly on the shear line. Then nothing crosses the line, and the plug can turn.

If even one cut is a little too deep or too shallow, one pin still crosses the line and the lock stays shut. That's why your key has its own pattern of bumps and dips, and why a friend's key won't open your door.

Key words

Plug
The rotating cylinder in the middle of the lock that holds the keyway.
Shear line
The thin gap where the plug meets the housing.
Key pin
A bottom pin that touches the key. Its length sets the cut depth needed.
Driver pin
A top pin, pushed down by a spring, that blocks the plug unless it is lifted fully into the housing.
Bitting
The pattern of cut depths on a key.
Cam
The part on the back of the plug that turns and moves the bolt.

Check your thinking

  1. What does the key lift inside a pin-tumbler lock?

    Show the answer

    Stacks of pins. Each cut lifts one stack of pins to the right height.

  2. Why won't a key with the wrong cuts turn?

    Show the answer

    At least one pin still crosses the shear line. A pin lifted too much or too little still blocks the plug.

  3. A key pin is extra long. What kind of cut does it need?

    Show the answer

    A deep cut. A long key pin already reaches high, so the key must lift it less: that means a deeper cut.

  4. What relocks the lock when you pull the key out?

    Show the answer

    The springs push the pins back down. The springs push the driver pins back across the shear line.

  5. With 10 possible depths and 5 pins, how many bittings are possible in theory?

    Show the answer

    100,000. Each pin has 10 choices, so 10 x 10 x 10 x 10 x 10 = 10 to the 5th power = 100,000.

  6. What turns the plug's spin into the bolt sliding back?

    Show the answer

    The cam. The cam on the back of the plug turns and pushes or pulls the bolt.