Enigma Machine Simulator

Type a letter. Watch the rotors decide.

  • Stepping rotors in 3D
  • Signal path shown
  • Works offline
A dark metal cipher machine with its lid open, showing three rotor wheels and a row of knobs, on a wooden desk beside a brass lamp.

The guide

The Enigma could never encipher a letter as itself, and that convenience broke it

A reflector let one machine both encipher and decipher on the same settings. It also meant no key could ever light its own lamp, and codebreakers built machines around that guarantee.

  • 17,576 window positions of three rotors, 26 x 26 x 26
  • 13 wires in the reflector, joining the 26 contacts in pairs
  • 150,738,274,937,250 ways to place ten plugboard cables
  • 1.07 x 10^23 settings of a five-rotor Enigma I with ten cables
  • 210 Bombes built in Britain, approximately, to find Enigma keys during the war
Read the full guide Fold the guide 7 min · 17 sources

Press A on an Enigma and any lamp may light except A. Press A again and a different lamp answers. The machine goes thousands of letters without repeating itself, and under no setting at all will it show you the key you pressed.

That last habit looks like strength. A cipher that sometimes left a letter unchanged would seem careless. In fact the rule was the other face of a convenience, and the convenience was real: the same machine, set the same way, both enciphers and deciphers. One operator typed plain text and wrote down the lamps. Another typed those lamps and read the plain text back. There was no switch and no second mode. How the Enigma was built is largely the story of that bargain. How it was broken is the story of what the bargain gave away.

A circuit that crosses the machine twice

The Enigma I was developed for the German Army between 1927 and 1929 and introduced in 1930. Electrically it is a battery, 26 keys, 26 lamps and a maze between them. Pressing a key sends current to the plugboard at the front, then to a fixed entry wheel, then through three rotors, each with 26 contacts on either face joined by 26 wires in scrambled order. At the far left sits the reflector, where 13 wires join the 26 contacts in pairs. It turns the current around and sends it back through the same three rotors by a different route, through the plugboard once more, and into a lamp.

Because the reflector joins contacts in pairs, the path from A to W is also the path from W to A. That is the whole of reciprocity. And because no wire joins a contact to itself, the current can never return the way it came.

The mechanical half is simpler than it sounds. Before the contact closes, the key lifts three pawls, and the right-hand rotor always advances one twenty-sixth of a turn. So the maze is rebuilt before each letter passes through it, and the letters left showing in the windows are the ones the last lamp was made with. Three rotors give 26 x 26 x 26 = 17,576 combinations of window letters. The machine walks through nearly all of them before its pattern repeats.

Rings, windows and the step that happens twice

Two settings are easy to confuse. The letter in each window is the start position. The ring setting is something else: each rotor’s alphabet ring, which carries the letters and the turnover notch, can be turned against the wiring core and locked in any of 26 places. Move the ring and the same window letter sits over different wires. The turnover still happens at the same visible letter, because the notch travels with the ring. Rotor I always carries its neighbor along as its own window goes from Q to R, rotor II from E to F, rotor III from V to W.

The tool above makes this concrete. Press Reset, which fits rotors I, II and III with reflector B, rings at A 01 and windows at AAA. Clear the message and press A five times. The lamps answer B, D, Z, G, O. Now move all three rings to B 02, clear, and repeat from AAA: the same five presses give E, W, T, Y, X. Nothing in the windows changed, yet every letter did. The first press also shows the order of events. The right window already reads B when the lamp lights, and the path table shows rotor III using its wire from B to D rather than the one from A to B.

Then there is the oddity. Set the windows to A D U and press any key four times. The windows read ADV, AEW, BFX, BFY. The middle rotor moved on two presses running, from D to E and at once from E to F. David Hamer traced the cause to the pawls: the lever that drives the left rotor does so by dropping into the middle rotor’s notch, and while it sits there it pushes the middle rotor as well. A car’s odometer does no such thing. The effect on security is small, a cycle slightly shorter than 17,576, but a simulator that steps like an odometer soon falls out of step with the real machine.

A very large number that protected very little

Count the settings as a codebreaker must, with the wiring known. Three rotors chosen from five and placed in order give 60 arrangements. The windows give 17,576 starts. The rings on the middle and right rotors matter and the left ring does not, which adds a factor of 676. Then comes the plugboard. Ten cables can be placed in 150,738,274,937,250 ways, a figure the tool displays once ten are plugged in. Multiply it all out: 60 x 17,576 x 676 x 150,738,274,937,250 is 107,458,687,327,250,619,360,000, about 1.07 x 10^23. Wikipedia’s count leaves the rings out and gives 158,962,555,217,826,360,000, which is this figure divided by 676.

Nearly all of that number is plugboard. Eleven cables would have offered more arrangements than ten, 205,552,193,096,250 of them, yet German procedure generally called for ten.

A large key space is not the same thing as a strong cipher. The plugboard does not move while a message is typed, so for all its combinations it is one fixed swap of letters, applied on the way in and again on the way out. The Crypto Museum’s analysis calls it little more than a static substitution. The ring setting only shifts where a turnover falls. What really changes from letter to letter is the rotor stack, and there the count is 60 times 17,576, about a million.

How the missing letter was turned against the machine

The first break used pencil, paper and the theory of permutations. Until 15 September 1938, German operators set their rotors to a daily position and enciphered a three-letter message key twice, sending the six letters that resulted. Marian Rejewski, who joined the Polish Cipher Bureau in Warsaw in September 1932, saw that the first and fourth letters hid the same plain letter. Reciprocity told him more: each of the six unknown substitutions had to consist of swapped pairs and nothing else. From about 60 messages sent on one day’s key he could chain those facts into cycles. With German key tables supplied by French intelligence that December, his equations gave up the wiring of the rotors.

One guess was needed. The commercial machine wired its keys to the entry wheel in keyboard order. Rejewski supposed the Army had simply used the alphabet, tried it, and it worked.

The Polish Cipher Bureau then built what it needed to find each day’s key: replica machines, a cyclometer and a catalogue covering 6 x 17,576 = 105,456 rotor positions, Henryk Zygalski’s perforated sheets, and a device called the bomba. The Germans kept moving. A new reflector arrived in November 1937, and in December 1938 the set of rotors grew from three to five. On 25 and 26 July 1939, at Pyry near Warsaw, the Poles revealed their methods to their French and British colleagues and promised each a copy of the machine.

The first break into wartime Enigma traffic came on 17 January 1940. It was made by the Poles, by then working in France, with perforated sheets punched at Bletchley Park.

Changes in German procedure and the two extra rotors had by then made the bomba obsolete, so Alan Turing built his attack on something else: the crib, a stretch of plain text guessed to lie under a stretch of cipher. Here the kindness to operators became a gift to their enemies. A crib cannot sit anywhere that would make a letter stand for itself, so every such alignment is discarded before any machine runs. The Bombe then tested rotor orders and positions against what remained, and Gordon Welchman’s diagonal board cut the false stops sharply.

The first Bombe, named Victory, began work in March 1940. The British Tabulating Machine Company went on to build approximately 210 of them.

Three messages you can still read

Old messages make better tests than invented ones, and three are built into the tool. The oldest comes from a German Army instruction manual for the Enigma I, dated 1930, which prints a 90-letter test message together with its settings. Ralph Erskine found the example and Frode Weierud published it. With rotors II, I and III, rings 24, 13 and 22, six plug cables and the pre-war reflector A, the cipher text becomes a report of an enemy infantry column. Reflector A was the original, and it gave way to reflector B in November 1937. Its wiring was recovered by Philip Marks and Frode Weierud in 2000.

The second is an Army signal of July 1941. The youngest is the last transmission of the battleship Scharnhorst, sent on 26 December 1943 on a naval M3 with rotors III, VI and VIII. The two naval rotors carry two notches each, so the rotor to their left steps twice as often. The M4 Message Breaking Project turned to it on 27 May 2008 and announced the break the next day, in less than 24 hours, and the result matched a British decode from January 1944: steering for Tanafjord, position square AC 4992, speed 20 knots.

What the simulator cannot do should be said plainly. It models the three-rotor service machine, the Enigma I and the M3, and nothing else: not the four-rotor M4 that reached the U-boats in February 1942, not the gear-driven Enigma G, which has no double step, not the rewirable reflector D or the Luftwaffe’s Uhr switch. It does not carry out the indicator procedures, so a real intercept needs its message key worked out first. Its output keeps the operators’ conventions exactly as typed, with X for a space, Q for CH and numbers spelled out. And it breaks nothing. Without the full key it is as helpless as any other Enigma.

The lesson outlasts the machine. Enigma’s designers counted settings and found an enormous number. Its attackers counted structure instead: a reflector that ruled out one answer in 26 every time, a plugboard that never moved, and operators told to send every message key twice. The second kind of counting won.

Sources

Every source consulted for this guide. Links checked October 3, 2026.

  1. Enigma wiring Crypto Museum
  2. Enigma explained Crypto Museum
  3. Enigma I Crypto Museum
  4. Enigma M3 Crypto Museum
  5. Enigma: Actions Involved in the 'Double Stepping' of the Middle Rotor David H. Hamer, Cryptologia, 1997 (copy hosted by Crypto Museum)
  6. The Breaking of Enigma by the Polish Mathematicians Tony Sale, Codes and Ciphers
  7. Military Use of the Enigma Tony Sale, Codes and Ciphers
  8. Break of the "Scharnhorst" message Stefan Krah, M4 Project
  9. Enigma/Sample Messages Franklin Heath Ltd Wiki (Internet Archive copy)
  10. Enigma rotor details Wikipedia
  11. Enigma machine Wikipedia
  12. Cryptanalysis of the Enigma Wikipedia
  13. Marian Rejewski Wikipedia
  14. Bombe - Wikipedia Wikipedia
  15. Grill (cryptology) Wikipedia
  16. Solving the Enigma: History of the Cryptanalytic Bombe Jennifer Wilcox, Center for Cryptologic History, National Security Agency (Internet Archive copy)
  17. M4 Project Blog Stefan Krah, M4 Project