Ibn al-Jazarī › Miscellaneous devices › The 12-letter lock

Book of Knowledge · Category VI, Chapter 3 · 1206

The 12-letter lock: no key, no keyhole, just letters

A brass lock on the lid of a chest: four round windows, three letter dials in each, and a hidden plate that only slides when all twelve letters are right. Turn the dials in interactive 3D, cut the chest open to see the notches line up, then watch the film.

Updated 2026-10-18 · 6 min read · Interactive model + 4-minute film

3D reconstruction of al-Jazari's chest with a combination lock of four letter dials in its brass lid
Drag to orbit, scroll or pinch to zoom. Press “Set the letters”, then “Turn the key-knob”, or try “One letter wrong”.Open the 3D model full screen ↗

A chest locked by letters

In the last part of the Book of Knowledge, among doors, bolts and a protractor, al-Jazarī describes “a lock for locking a chest by means of 12 letters of the alphabet”. He made the chest himself, he says, and put the lock on its lid, in brass. The lid has four round holes; around each runs a ring of sixteen letters, chosen from the twenty-eight of the alphabet. (He does not say which sixteen; our model uses the first sixteen in abjad order.)

The chest with its brass lid, four letter dials and the key-knob in the middle
The chest and its lock: four holes, each with three dials, and the “earring” key-knob in the centre (sizes are our reconstruction).

Three dials in each hole

  1. Disc 1, as thick as the lid, sits in the hole. It has an almond-shaped pointer that reads the lid's letters, and a little bird's head to turn it by.
  2. Disc 2, smaller, sits on top, with a knob and its own almond that reads the letters on disc 1.
  3. A rod runs through the middle, with a third almond that reads the letters on disc 2.
Close-up of the letter dials of al-Jazari's combination lock: rings of Arabic letters and almond-shaped pointers
Each almond points at a letter on the ring beneath it: three letters per hole, twelve in all.

Hidden discs and the zigzag plate

Underneath, each dial is fixed to a hidden disc, and each hidden disc has a small triangular notch cut in its edge. Under the lid lies a brass plate, cut in two along a zigzag, with a triangular lug beside each stack of discs.

One lock taken apart: the three dials above the lid and the three notched hidden discs below
One lock taken apart: the dials above, the notched discs below (after Hill, Fig. 48.1).

How it opens, and why it won't

Set all three almonds of a hole on the right letters and the three notches line up opposite the lug. Do it at all four holes, then turn the “earring”, the key-knob in the middle of the lid: a cam with four teeth pushes the two halves of the plate apart, each lug slides into its line of notches, and two hooks at the side let go of the latch, so the lid can be lifted. To lock it, turn the earring back so the halves close on the latch, and spin the dials away. Now the lugs hit solid brass and the plate cannot move.

The underside of the lid, seen with the front of the chest cut away: stacks of discs and the triangular lugs
Seen from inside the chest (front cut away): the lugs beside the stacks of hidden discs.

Quick test: how many settings?

Each dial has sixteen letters, and each hole has three dials. How many different settings does one hole have?

Show the answer

4,096. Sixteen × sixteen × sixteen. And all four holes must be right at once: 16¹², about 281 trillion settings on paper.

A code you can change

Each hidden disc grips its dial with a single tooth set into one of sixteen nicks (the rod's disc uses a nail in one of sixteen holes). Take the lock apart, seat the tooth in a different nick, and the secret letters change. As Donald Hill points out, the locks could be reset to different combinations whenever desired.

The weak spot

Hill also spotted a weakness: the latch is hinged on the outside of the chest, so a thief with a crowbar could simply lever it open. A hinge inside the chest would have been better.

The chest open, its lid raised to show the plate and lock mechanisms on the underside
Open: the latch swung out and the lid raised, showing the plate and the four locks underneath.

The first combination lock?

You will often read that al-Jazarī invented the combination lock. He did not, and he says so himself: earlier craftsmen, he writes, made letter locks with two, four and six circles. A brass box in the Museum of Fine Arts, Boston, dated 1197 (593 AH), already has a four-dial lock with an eight-letter code; it is attributed to Muhammad ibn Hamid al-Asturlabi al-Isfahani, an astrolabe maker. What al-Jazarī gives us is something rarer: the full recipe, every disc, notch and lug written down.

Watch the film

Film: al-Jazari's 12-letter combination lock

Questions & answers

What is al-Jazari's combination lock?

Chapter 3 of Category VI of al-Jazarī's Book of Knowledge (1206) describes a brass lock he made for the lid of a chest, worked “by means of 12 letters of the alphabet”. The lid has four round holes; in each sit three nested letter dials, and below the lid a plate in two halves can only slide apart when all twelve dials show the right letters.

How does the lock work?

Each dial is fixed to a hidden disc under the lid, and each hidden disc has a triangular notch in its rim. When the three almond-shaped pointers of a hole sit on the right letters, the three notches line up. The plate under the lid carries a triangular lug beside each stack. Turning the key-knob (the “earring”) in the middle of the lid turns a cam with four teeth that pushes the two halves of the plate apart; the lugs slide into the notches and two hooks let go of the latch, so the lid can be lifted.

What happens if one letter is wrong?

That dial's notch is out of line, so the lug beside its stack hits solid brass and the half of the plate it is fixed to cannot move. The hooks stay in the latch and the lid stays shut.

How many combinations does it have?

Each dial has sixteen letters, so one hole has 16 × 16 × 16 = 4,096 settings, and all twelve dials together have 16¹², about 281 trillion, on paper.

Could the combination be changed?

Yes. Each hidden disc grips its dial by a tooth set into one of sixteen nicks (or, for the rod, a nail in one of sixteen holes). As Donald Hill notes, any of the locks could be taken apart and reset to a different combination whenever desired.

Did al-Jazari invent the combination lock?

No, and he says so himself: earlier craftsmen, he writes, made letter locks with four letters on four circles, two on two, and six on six. A brass box in the Museum of Fine Arts, Boston, dated 1197 (593 AH) and attributed to Muhammad ibn Hamid al-Asturlabi al-Isfahani, already has a four-dial lock with an eight-letter code. What al-Jazarī gives us is a complete written description.

Did the lock have a weakness?

Hill points out that the latch was hinged on the outside of the chest, so it would have been simple to force the chest open with a crowbar between the latch and the chest; a hinge inside the chest would have been better.

Sources

  • Ibn al-Razzāz al-Jazarī, Kitāb fī maʿrifat al-ḥiyal al-handasiyya (The Book of Knowledge of Ingenious Mechanical Devices), 1206, Category VI, Chapter 3. English translation and notes: Donald R. Hill, 1974, pp. 199–201 and 267–269.
  • Combination lock box, 1197 A.D./593 A.H., Museum of Fine Arts, Boston.
  • A. Golan, Al-Jazari Combination Lock and the Boxes from Isfahan.
  • The 3D model is a reconstruction from al-Jazarī's text and Hill's notes; the chest's size, the setting, the sixteen letters shown and the code are illustrative.

Next from the Book of Knowledge

Which machine should we open up next?

Clocks, automata, fountains and more are on their way. Tell us on YouTube which one you want next.