Everyday Systems April 7, 2026

How Do Locks Work?

A 7-minute read

A lock is a mechanical or electronic device that keeps a door, container, or vehicle secured until you present the correct key, code, or credential. The most common type, the pin tumbler lock, has been in use for over 150 years in nearly identical form.

You use a lock every day. Put the key in, turn it, open the door. Three seconds of muscle memory. But the mechanism inside that lock has been refined over 6,000 years and, in its most common form, has remained almost unchanged for 150 years.

The short answer

A lock prevents unauthorized access by requiring a physical object (a key), a code (a PIN), or a credential (a card or fingerprint) to release a latch or bolt. The most common mechanical lock is the pin tumbler lock, which uses a series of spring-loaded pins of different lengths. When the correct key is inserted, all pins align at a precise point called the shear line, allowing a metal plug inside the lock to rotate and open. Electronic locks replace the physical mechanism with an electrically controlled one.

The full picture

6,000 years of keeping things closed

Locks are older than recorded history. The earliest known example was found in the ruins of Dur-Sharrukin, an ancient Assyrian city built in the 8th century BC. Before that, basic principles of pin and latch mechanisms date to ancient Egypt around 2000 BC, where a wooden post on a door was secured by pins that a shaped wooden key could lift.

The Romans advanced lock technology significantly, introducing metal locks and the concept of wards: internal obstacles that allow only correctly shaped keys to enter. The warded lock, with its simple notched key, remained the dominant design in the Western world for centuries.

The modern era of lock design began in the late 18th century. Robert Barron patented the lever tumbler lock in 1778, requiring pins to be lifted to a precise height. Jeremiah Chubb improved on it in 1818 with a detector lock that showed whether someone had attempted to pick it. Joseph Bramah revealed his cylindrical lock in 1784 and issued a public challenge offering £200 to anyone who could pick it. The challenge stood for 67 years until American locksmith Alfred Charles Hobbs opened it at the Great Exhibition in 1851, after 51 hours of work spread over 16 days.

The pin tumbler lock: how it works

The pin tumbler lock, invented by Linus Yale Sr. in 1848 and refined by his son Linus Yale Jr. in 1861, is the dominant lock design today. It works through a simple mechanical principle that is worth understanding because it determines what your lock can and cannot do.

Inside the lock is a cylindrical plug that sits within an outer housing. When the plug is still, the lock is secured. When the plug rotates, the lock opens. The plug cannot rotate because a series of pins block it. Each pin chamber contains a key pin (which the key pushes up) and a driver pin (which a spring pushes down). Without the right key inserted, the pins sit at random positions straddling the boundary between the plug and the outer housing, called the shear line. The plug is physically blocked.

When you insert the correct key, the surface of the key lifts each key pin to a precise height. When every key pin is lifted exactly far enough, the gap between each key pin and its corresponding driver pin aligns perfectly with the shear line. The driver pins are now entirely in the outer housing, and the key pins are entirely in the plug. The plug can rotate freely, and the lock opens.

The key has notches cut at specific depths that correspond to the lengths of the key pins inside the lock. Cut one notch wrongly and one pin will not align. The lock will not open.

Other mechanical lock types

Not all locks work on the pin tumbler principle.

Warded locks use internal obstacles (wards) that the key must bypass. The key has slots cut in it that correspond to the wards. These locks are easy to make and inexpensive, but a well-designed skeleton key can open a wide variety of warded locks. They offer low security and are mostly found on old furniture or low-value applications.

Lever tumbler locks use a set of levers that must be lifted to a specific height. Lifting too far or too little prevents opening. Chubb detector locks used this principle and were considered high security in their time. Lever locks are still common in UK mortise deadlock applications and on some older padlocks.

Disc tumbler locks (also called Abloy locks) use rotating discs rather than pins. The key rotates the discs to align openings in each disc with a locking bar. These locks are very difficult to pick and are common in Scandinavia and industrial applications.

Combination locks use a series of rotating discs or cams with notches that must be aligned at the correct numbers. They require no key but are slow to open and vulnerable to being felt (by running fingers along the exterior dial) or to brute force manipulation of the combination.

Electronic and smart locks

Electronic locks replace the mechanical keyway with an electrically controlled mechanism. A motor drives the latch when the correct code, card, or biometric is presented. They cannot be picked in the traditional sense, which is a significant advantage.

Keycard locks are common in hotels and offices. The card encodes a pattern that the lock reads. Older magstripe cards are easy to clone. Modern RFID cards and smart cards are significantly harder to copy.

Remote keyless systems on cars use a radio transmitter in the key fob. The lock transmits a different code each time (a rolling code) to prevent replay attacks. Even so, relay attacks (amplifying the signal from a key inside a house to a car outside) have become a known vulnerability for keyless entry systems.

Smart locks connect to a phone or home network via Bluetooth, Wi-Fi, or Zigbee. They can be unlocked with an app, a PIN code, or a fingerprint. The convenience is genuine, but internet-connected locks introduce software vulnerabilities that mechanical locks do not have. A compromised Wi-Fi password can potentially expose a smart lock to unauthorized access.

What this means in real life

Most people use pin tumbler cylinder locks on their front doors, typically in the euro cylinder format common throughout Europe or the US cylindrical format in North America. These locks can typically be defeated in under two minutes by someone with basic lock picking training, or in under a minute using lock bumping (tapping a specially cut bump key with a hammer).

This does not mean your front door lock is useless. Most burglars do not pick locks; they look for open windows or force doors through the frame. A lock primarily serves to keep honest people honest, to meet insurance requirements, and to slow down a determined attacker enough that they move on to an easier target.

However, if you want better protection, the most cost-effective upgrade is replacing a standard euro cylinder with an anti-snap cylinder that meets the TS007 3 Star or Sold Secure SS312 Diamond standard. These are designed to resist snapping, drilling, picking, and extraction, and they cost between £20 and £80 depending on brand. Most uPVC doors sold in the UK after around 2005 were fitted with locks meeting these standards, but millions of older doors still have vulnerable cylinders.

For a house with multiple occupants, a master key system lets a landlord or manager open every door while each tenant has a key that opens only their own. Master key systems add complexity to lock installation and management, and a poorly designed one can compromise the security of the entire building.

Why it matters

The lock on your front door is the primary barrier between your belongings and a stranger walking in. In practice, it does more than that. Insurance policies for home contents typically require that external doors have functional deadlocks or multi-point locking systems. Many rental agreements specify the type of lock that must be fitted. A landlord who does not install a compliant lock may be legally liable if a break-in occurs.

Understanding how locks work helps you make better security decisions. The euro cylinder lock on most uPVC doors in the UK can be snapped in under two minutes by someone with almost no skill, using a technique that takes seconds to learn. Replacing it with an anti-snap cylinder costs less than an hour of a locksmith’s time. The knowledge that this is necessary is not widely circulated, which means millions of homes have locks that are easier to defeat than they appear.

In commercial settings, lock security affects not just property but employee safety. A master key system that allows the manager to access every room also means that a lost key potentially compromises every room. Knowing how master keying works helps businesses weigh the convenience against the risk, and choose systems where the master key is kept secure and change keys are numbered rather than labelled with room names.

The same principles apply to electronic locks. An RFID card can be cloned in seconds using a device that costs under £20. A keypad code can be observed over someone’s shoulder or guessed from the wear pattern on frequently pressed digits. Knowing these vulnerabilities is not about paranoia. It is about matching the level of security to the value of what you are protecting.

Common misconceptions

A more expensive lock is always more secure. Not always. Many expensive locks use the same basic pin tumbler mechanism as inexpensive ones, with better aesthetics or more branding. What matters most is the cylinder design and whether it has anti-pick and anti-snap features.

Electronic locks are inherently more secure. They eliminate physical picking but introduce electronic vulnerabilities. A lock with a good mechanical cylinder and no electronic features can offer better long-term security than a budget smart lock with poor software security.

Locks are designed to be unpickable. Almost no commercial lock is truly unpickable. Locks are designed to be difficult enough to defeat that unauthorized entry takes significant time or skill, making it easier and safer for an attacker to try elsewhere.

The Yale name means quality. Linus Yale Jr.’s original 1861 design was genuinely innovative, but the Yale name is now licensed to many manufacturers and appears on locks ranging from high-security to budget. The design has also been widely copied. What matters is the specific cylinder and its certification, not the brand name on the outside.

Key terms

Shear line: The boundary between the lock plug and the outer housing where the pins must align for the lock to open. When all driver pins sit entirely in the outer housing and all key pins sit entirely in the plug, aligned at the shear line, the plug can rotate.

Key pin: The pin inside a lock that is pushed upward by the correct key. Different key pins are cut to different lengths, corresponding to the notches on the key.

Driver pin: The spring-loaded pin that sits above the key pin. Springs push driver pins downward toward the plug. When the correct key lifts the key pin to the shear line, the driver pin sits entirely in the outer housing.

Spacer pin (master wafer): An additional pin placed between the key pin and driver pin in a master-keyed lock. This creates a second shear point, allowing two different keys to open the same lock.

Cylinder (plug): The rotating part of the lock that contains the key pins. When all pins align at the shear line, the plug rotates to retract the latch or bolt.

Ward: An internal obstacle in a warded lock that prevents anything other than the correct key from entering. Wards are simple to bypass, which is why warded locks offer low security.

Anti-pick pin (spool pin, serrated pin): A modified driver or key pin with a narrow waist or groove machined into it. Spool pins and serrated pins catch in the lock cylinder if a picking tool is used, creating the false impression that a pin has been set correctly when it has not.

Bump key: A specially cut key that can be used to open pin tumbler locks by applying a sharp tap (bump) while applying turning pressure. The impact briefly creates a momentary gap at the shear line in all pin chambers simultaneously. Bump keys are inexpensive and easy to make, which is why anti-bump pin designs have been introduced in higher security locks.

Rekeying: The process of changing which key operates a lock, without replacing the entire lock. In pin tumbler cylinders, this is done by replacing the key pins with new pins of different lengths. Euro cylinders and most rim cylinders can be rekeyed in minutes with basic tools.