Open the 3D lab
Machine 37 · HOME

Door
lock

A key is a ruler with five heights cut into it. When every pin gap lands on the same line, to within a fraction of a millimetre, the plug is free to turn.

TitleHow a door lock (pin tumbler) worksDwg no.FIG. 37
DrawnTestIt3DUpdatedRevC
ScaleNTSReading8 minModelLive 3D
FIG. 37 · live model · drag to turn Door lock (pin tumbler) 3D model, paused
5pin stacks in the cylinder
±0.15 mmhow close each gap must sit (0.006 in)
13 mmplug diameter (0.51 in)
0.5 mmbetween cut depths (0.02 in)
25 mmdeadbolt throw (1 in)
The short answer

How does a pin tumbler lock work?

A pin tumbler lock opens when the right key lifts five spring-loaded pin stacks so that every gap between a key pin and the driver pin above it lands on the shear line, the seam between the turning plug and the fixed shell. Nothing then crosses the seam, so the plug turns and throws the bolt.

Bow to bolt

Every part between your fingers and the door frame

Every one is labelled in the 3D lab. Turn the model to find them.

Exploded view of the parts of a door lock (pin tumbler)
Illustration of the main parts. Find each one moving in the 3D lab.
  1. Key, five cuts
  2. Brass key pins
  3. Steel driver pins
  4. Springs
  5. Shear line
  6. Plug
  7. Shell
  8. Keyway
  9. Retaining clip
  10. Cam tailpiece
  11. Deadbolt
  12. Strike plate
One key visit

Slide. Align. Throw. Out.

A few seconds in real life: slide in, line up, turn, take out.

Door lock (pin tumbler) in 3D: insert
01

Insert

slide

The key slides 26 mm into the keyway. Each key pin rides up the tip ramp and over the cuts, so the five pin stacks bob up and down against their springs.

Door lock (pin tumbler) in 3D: line up
02

Line up

align

With the key against its shoulder, every key pin sits in its own cut. The right key puts all five gaps between key pins and drivers on the shear line, the seam between plug and shell.

Door lock (pin tumbler) in 3D: turn
03

Turn

throw

Nothing crosses the seam now, so the plug turns. The drivers stay up in the shell, and the tailpiece swings a lever that slides the deadbolt 25 mm (1 in) into the strike.

Door lock (pin tumbler) in 3D: back and out
04

Back and out

out

Turning back pulls the bolt in and lines the plug bores up with the chambers again. As the key comes out, the springs push the drivers down across the seam and the plug is held.

Inside the cylinder

Five gaps, one line

About 8 minutes of reading.

How does a key open a lock?

You get home late with shopping in one hand and find the front door key by feel. It slides in, turns, and the deadbolt clunks. Inside the cylinder, though, five tiny pins have just lined up to within a fraction of a millimetre.

A lock cylinder has two main parts. The shell is fixed in the door. Inside it sits the plug, a brass cylinder 13 mm (0.51 in) across with the keyway cut through it, and the plug is the bit that turns. Drilled down through shell and plug is a row of holes, 4 mm (0.16 in) apart in our model, and each one holds a stack of three things. At the bottom, resting on the key, a brass key pin. Above it a steel driver pin, 5 mm long. On top, a small spring pressing both of them down.

With no key in, the springs push every driver part way down into the plug. A driver that's half in the plug and half in the shell is a little steel bolt across the joint. Five of them, and the plug is pinned five times over.

The key's job is to lift each stack by exactly the right height. The key pins come in different lengths (5.5 to 7.5 mm in our model) and each cut on the key has a different depth. A deep cut lets a long key pin sit low. A shallow cut holds a short one up high. Match them and the top of the key pin stops right at the shear line, the thin seam where plug meets shell. The driver is then wholly in the shell and the key pin wholly in the plug. Do that for all five at once and nothing crosses the seam, so the plug turns.

Out the back of the plug, a flat tailpiece swings a lever that pushes the bolt 25 mm (1 in) into the strike plate on the frame. Turn back and the bolt comes in. Pull the key out and the springs shove the drivers back across the seam, and the plug is held again.

Why won't a worn key or a bad copy turn?

A key that has lived on your keyring for ten years looks fine, but next to a new one its edge is lower and softer. Every time it goes in, all five pins drag along its top edge, so a little brass rubs off. The part near the tip gets the most of it, because every pin rides over it, while the first cut by the bow only ever meets one pin.

A lower edge means a lower key pin. Its top drops below the shear line and the driver above follows it down into the plug. How much is too much? In our model a gap counts as set if it's within 0.15 mm (0.006 in) of the line, a bit more than the thickness of a sheet of printer paper. (Real locks vary with the maker, roughly 0.05-0.2 mm.)

Drag the Key wear slider on the model above and watch the order they fail in. Pin 5, nearest the tip, goes first, just past 0.15 mm. Pin 4 follows at about 0.19 mm, pin 3 at 0.25 and pin 2 at about 0.38. At the end of the slider, 0.50 mm (0.020 in), only pin 1 still sets. The plug rocks 1.5° (the slack between pins and their holes) and stops dead.

A cheap copy fails the same way. The cutting machine traces the key you hand it, wear included, and adds its own small error. Copy a copy and those errors pile up, which is why the spare key from the drawer so often turns when your everyday one won't.

A wrong key misses by far more. Press Wrong key on the model. Its cuts read 4-5-3-3-7 against the right key's 4-2-6-3-5, so pin 2 sits 1.5 mm low, pin 3 sits 1.5 mm high and pin 5 a full millimetre low. Two of the five pins line up, and the plug won't budge.

Key won't turn in the front door lock? Check this first

If the key goes in but won't turn at all, the pins aren't lining up. If it turns fine with the door open and sticks with the door shut, the cylinder is innocent. The bolt is rubbing on the strike plate, usually because the door has dropped a little on its hinges or swollen in damp monsoon or summer weather.

For pin trouble, try the original key or the spare first. Grit in the keyway can also hold a pin off the line, and so can ice on a freezing morning in a northern US winter. Use a lubricant sold for lock cylinders (usually a dry graphite or PTFE type), put a little into the keyway and work the key in and out a few times. Skip cooking oil and grease. They hold dust and slowly gum up the springs.

Don't force it. Brass is soft, and a key wrenched with pliers can snap off inside the plug, which turns a small problem into a bigger bill. If a new key cut from the original still binds, or you're locked out, call a locksmith (or the landlord, if you rent).

Door lock cylinder types, from US deadbolts to Indian padlocks

The pins inside are much the same the world over. What changes is the body around them and how it moves the bolt.

Most American front doors have a deadbolt above the knob. Its round cylinder sits in a 54 mm (2 1/8 in) hole bored through the door, and the tailpiece passes through the bolt mechanism to a thumbturn on the inside. A quarter turn throws a 25 mm (1 in) bolt, which is the case our model shows.

In flats in India and across Europe you'll more often meet a euro profile cylinder in a mortise lock (a lock body set into a slot cut in the door edge). The cylinder is keyhole-shaped, round on top with a narrower foot, and held by one long screw through the door edge. The same pin stacks sit in the round part. A cam in the middle makes a full turn and drives the mortise lock's bolt, and on some locks you turn twice to throw it all the way.

The heavy padlock on a shop shutter, the one on a steel cupboard (almirah) and the lock on many older doors in Indian homes are usually lever locks, which work quite differently. Inside is a stack of flat plates, the levers, each with a window called a gate cut at its own height. A post on the bolt can't slide through until every gate is lifted into line with it. The key, a round shaft with a stepped bit at the end, turns a full circle. Each step lifts one lever by its own amount, and the bit then pushes the bolt along by itself.

When was the pin tumbler lock invented?

The idea is thousands of years old. Wooden pin locks were in use in ancient Egypt and Mesopotamia, often dated to around 4,000 years ago. A wooden bolt had holes in its top, loose wooden pins dropped into them from a block above, and a long wooden key with pegs on it was pushed into a hollow in the bolt to lift the pins clear. Same principle as your front door, pins lifted to a line.

The small modern version is mostly American. Linus Yale Sr. worked on pin tumbler locks in the 1840s, and his son, Linus Yale Jr., patented the compact cylinder with a small flat, notched key in the 1860s. Since then the materials and tolerances have tightened, and some cylinders add specially shaped pins to resist tampering. But a house key from the 1870s and one cut last week do the same job in the same way.

Slider readings

How much wear before a key stops working?

What happens as you drag the Key wear slider on the model. Wear is biggest at the tip, so the pins drop out from pin 5 back towards pin 1.

Key wearPins on the shear linePin that just failedWhat the plug does
0.00 mm (0.000 in)5 of 5NoneTurns 90°, bolt out 25 mm (1 in)
0.10 mm (0.004 in)5 of 5None, pin 5 is low but inside the bandStill turns
0.16 mm (0.006 in)4 of 5Pin 5Rocks 1.5° and stops
0.20 mm (0.008 in)3 of 5Pin 4Stuck
0.30 mm (0.012 in)2 of 5Pin 3Stuck
0.40 mm (0.016 in)1 of 5Pin 2Stuck
0.50 mm (0.020 in)1 of 5Only pin 1 leftStuck

In the model, pin 5 gets the full wear figure and pin 1 only a fifth of it. The ±0.15 mm (0.006 in) band is a teaching value; real locks range from about 0.05 to 0.2 mm.

Before you reach for pliers

If the key sticks

  • If a key sticks or only turns with jiggling, try the original key. A worn copy cut from a worn key is the usual reason.
  • Don't force a key that won't turn; it can snap in the plug. Use a lock lubricant made for cylinders (not cooking oil), or ask a locksmith.
  • Locked out? Call a locksmith or your landlord. This page shows how a key works, not how to get past a lock.
Two ways to lock

Pin tumbler vs lever lock

Your US deadbolt or euro cylinder is the first. The old brass padlock at your grandparents' house is probably the second.

Pin tumbler cylinder

KeyFlat blade with cuts along its edge
What blocks itSpring-loaded pin stacks across the plug-shell seam
The key's jobLines up the pins; the plug and cam move the bolt
TurnA quarter turn (US deadbolt) or a full turn (euro cylinder)
InsideUsually 5 or 6 pin stacks
New keysA locksmith can rekey it, or you swap only the cylinder
Where you see itUS deadbolts and knobs, flats with mortise locks, most modern padlocks

Lever lock

KeyRound shaft with a stepped bit at the end
What blocks itFlat levers whose gates must line up with a post on the bolt
The key's jobLifts the levers, then pushes the bolt itself
TurnA full circle, sometimes two
InsideOften 3 to 7 levers
New keysHarder; often the whole lock is changed
Where you see itTraditional padlocks in India, steel cupboards, older doors, many British front doors

Counts are typical, not fixed. More pins or levers and better build quality matter more than which type you choose.

Keyring myths

What people get wrong about keys

In a pin tumbler lock the key doesn't push the bolt. It only sorts the pins; the plug, tailpiece and lever move the bolt. (In a lever lock the key does push the bolt itself.)

A copied key isn't an exact twin. The machine copies the wear on the key you hand it and adds its own small error, so a copy of a copy is often the one that sticks.

Almost right isn't close enough. In our model one cut 0.5 mm off, a single depth step, already leaves a pin 0.5 mm off the line, more than three times the 0.15 mm allowed.

Oil doesn't cure a sticky lock for long. Kitchen oil and grease catch dust; a lubricant sold for cylinders lasts much better.

Do the maths

How many different keys can a 5-pin lock have?

Each pin can sit at any of the system's depths, so the raw count is depths raised to the number of pins.

Cut depths in the system (example)8
Pin stacks5
Raw combinations, 8 × 8 × 8 × 8 × 832,768
Same 8 depths, 6 pins (8^6)262,144
10 depths, 5 pins (10^5)100,000
Step between depths in our model0.5 mm (0.02 in)

Real makers rule some of these out. Neighbouring cuts that differ too much leave a slope too steep for a pin to ride, so those keys aren't made, and very plain ones such as all cuts the same are often skipped. The usable number is lower, and with millions of doors, many keys share a bitting with someone else's lock in another town.

Lock words

Cylinder terms in plain English

Plug
The inner cylinder that holds the keyway and turns when the right key is in.
Shell
The fixed outer body of the cylinder, with the chambers that hold the driver pins and springs.
Shear line
The seam between plug and shell; every pin gap must sit on it before the plug can turn.
Key pin
The lower pin in each stack, usually brass, cut to a length that matches one cut on the right key.
Driver pin
The upper pin in each stack, pushed down by its spring to block the shear line when no key is in.
Bitting
The list of cut depths on a key, written as numbers such as 4-2-6-3-5, front cut first.
Tailpiece (cam)
The bar or lobe at the back of the plug that passes its turn on to the bolt mechanism.
Strike plate
The metal plate on the door frame with a hole the bolt slides into.
Euro profile cylinder
A keyhole-shaped cylinder held by one screw through the door edge, used in mortise locks in India and Europe.
At the front door

Questions people ask about door locks

Short, straight answers. Open one to read it.

How does a pin tumbler lock work?

Each pin hole holds a key pin, a driver pin and a spring. Without a key the drivers cross the seam between the plug and the shell and stop the plug turning. The right key lifts every key pin so its top sits exactly on that seam, the shear line, and then the plug turns and moves the bolt.

What is the shear line in a lock?

It's the thin seam between the plug, which turns, and the shell around it, which doesn't. A lock only opens when no pin crosses that seam, so the cut on the key has to stop the gap between each key pin and driver right on it, to within a fraction of a millimetre (roughly 0.05-0.2 mm in real locks).

Why does my key only turn after jiggling it?

Usually one pin is sitting just off the shear line, because the key is worn or the copy was cut slightly off, and jiggling happens to nudge it into place. Try the original key or a spare. If that turns cleanly, get a fresh copy cut from the original, not from the worn one.

Can I put oil in a sticky door lock?

Not kitchen oil or general grease, which trap dust and gum up the springs over time. Use a lubricant sold for lock cylinders, usually a dry graphite or PTFE type, and work the key in and out a few times. If the lock is still stiff, a locksmith can clean or replace the cylinder.

Is a lever lock better than a pin tumbler lock?

Neither type wins on its own. A well-made lever lock with more levers can be very good, and so can a quality cylinder, while cheap versions of both are weak. Look at the build quality and whether the lock carries a recognised security rating rather than at the type alone.

What's the difference between a deadbolt and a latch?

A latch has a slanted, spring-loaded tongue that clicks shut by itself when you close the door. A deadbolt has a square bolt with no spring, so it only moves when you turn the key or thumbturn, and it can't be pushed back by pressing on the bolt.

Should I change the locks after moving into a new home?

It's a good idea, since you don't know how many copies of the old key exist. A locksmith can rekey a pin tumbler cylinder by fitting new key pins to suit a new key, or you can swap just the cylinder, which on most doors is cheaper than replacing the whole lock.

Your turn

Tell us what to build next

Name a machine you have always wondered about. We build the most requested ones first.

We read every idea. The most asked-for machines get built first. See our privacy policy.