Interactive Enigma machine simulator with authentic WWII rotor configurations. Encrypt and decrypt messages, configure plugboard and reflector settings.
This is a working model of the three–rotor Wehrmacht Enigma I. You choose which three rotors go in the machine and in what order, set each rotor's start position and ring setting, pick a reflector, patch up to thirteen letter pairs on the plugboard, and type. Every keystroke steps the rotors first, then sends the signal through the plugboard, the three rotors right–to–left, the reflector, back through the rotors left–to–right, and out through the plugboard again. Everything runs in your browser — the machine is a few hundred lines of arithmetic, nothing is uploaded, and there is no server round trip to wait for.
The tool is deliberately narrow. It models Enigma I with rotors I–V and reflectors UKW–A, UKW–B and UKW–C. It does not model the four–rotor naval M4, rotors VI–VIII, the thin Beta/Gamma rotors, Umkehrwalze D, or the Enigma Uhr. It also does not attempt to break anything: there is no bombe, no crib dragging, no key search. If you came to encipher and decipher with known settings and watch exactly what the machine does, this is the right page. If you came to crack an unknown key, it is not.
An Enigma key in this simulator is four things, and the message only comes out right if all four match on both ends.
| Setting | German term | What it is here | Choices |
|---|---|---|---|
| Rotor selection and order | Walzenlage | Three of the five rotors, in a specific left–middle–right order | 60 |
| Start positions | Grundstellung | The letter showing in each of the three windows before you type | 17,576 |
| Ring settings | Ringstellung | Offset between each rotor's wiring and its letter ring, 01–26 | 17,576 |
| Reflector | Umkehrwalze | UKW–A, UKW–B or UKW–C | 3 |
| Plugboard pairs | Steckerbrett | Letter swaps applied before and after the rotors | up to 13 pairs |
Where do the counts come from? Rotor order is 5 × 4 × 3 = 60 ordered choices from a set of five. Positions and ring settings are each 263 = 17,576. The plugboard with the ten leads the Wehrmacht typically issued is 26! ÷ (6! × 10! × 210) = 150,738,274,937,250 — you choose which 20 of the 26 letters get plugged, pair them up, and divide out the orderings that describe the same wiring. Multiply rotor order by positions by the ten–lead plugboard and you get 60 × 17,576 × 150,738,274,937,250 = 158,962,555,217,826,360,000, the familiar figure of roughly 1.59 × 1020.
Ring settings are normally left out of that headline number, and it is worth knowing why. Advancing a ring setting by one and advancing the matching start position by one produces the same substitution — the two changes cancel. What a ring setting genuinely changes is where in the message the turnovers fall, because the notch travels with the letter ring. So it is not an independent multiplier on the alphabet mapping; it is a control over the stepping schedule. That is also why getting the ring settings wrong gives you plausible–looking output that suddenly diverges partway through a message rather than being garbage from the first letter.
The right rotor advances one place on every keypress, before the letter is enciphered. When a rotor reaches its notch letter, it carries the rotor to its left on the following keypress — an odometer. The notch letters in this simulator are the historical ones, and the Configuration tab prints the notch for whichever rotor you have selected:
| Rotor | Turnover notch | Mnemonic |
|---|---|---|
| I | Q | Royal |
| II | E | Flags |
| III | V | Wave |
| IV | J | Kings |
| V | Z | Above |
The mnemonic is the traditional one: "Royal Flags Wave Kings Above" — rotor I steps the next rotor when it moves from Q to R, rotor II from E to F, rotor III from V to W, rotor IV from J to K, rotor V from Z to A.
The famous quirk is the middle rotor's double step. A real Enigma's stepping is driven by pawls, and the pawl that pushes the middle rotor also engages the middle rotor's own notch — so once the middle rotor is sitting on its notch, it drags itself forward on the next keypress at the same time as it carries the left rotor. The result is that the middle rotor moves on two consecutive keypresses and one letter of its cycle is skipped.
You can watch it happen. Load rotors I, II, III (left to right), all ring settings 01, and set the windows to A D U. Type five letters with Show encryption steps on, and the window readings recorded per keystroke are:
| Keypress | Windows after stepping | What moved |
|---|---|---|
| 1 | A D V | right rotor only |
| 2 | A E W | right was on its notch V, so the middle rotor stepped D → E |
| 3 | B F X | middle is now on its own notch E, so it steps again (E → F) and carries the left rotor A → B |
| 4 | B F Y | right rotor only |
| 5 | B F Z | right rotor only |
The middle rotor went D, E, F on consecutive keypresses instead of dwelling on E for 26 letters. Any simulator that gets this wrong will match a genuine machine for a while and then silently drift — which is exactly the failure mode people hit when a decipherment starts clean and turns to noise around 26 characters in.
The reflector is wired as a set of thirteen fixed pairs, and each of UKW–A, UKW–B and UKW–C in this tool is a genuine involution with no letter wired to itself. The current enters the rotor stack, hits the reflector, comes back through the same three rotors in the opposite direction, and lights a lamp. Because the reflector never returns a letter to the contact it arrived on, and every other stage is a reversible one–to–one mapping, the lit lamp can never be the key you pressed.
This is not a subtlety; it is the flaw. It gives the whole machine its convenient property — encipherment and decipherment are the same operation, so an operator with the right settings just types the ciphertext and reads the plaintext — and it hands a cryptanalyst a free test. If you suspect a stretch of ciphertext contains a particular German phrase, you can slide that guess along the ciphertext and instantly discard every alignment where any letter of the guess sits above the same letter in the ciphertext. Those alignments are impossible, no key search required. Cribs like predictable weather reports and stereotyped message openings, combined with this one constraint, are what made a mechanised search practical. The Polish Cipher Bureau broke Enigma traffic in the 1930s and passed the work to Britain and France; at Bletchley Park, Alan Turing and Gordon Welchman built the bombe around exactly this style of contradiction test.
You can confirm the property on this page in about ten seconds: clear the plugboard, type the alphabet ABCDEFGHIJKLMNOPQRSTUVWXYZ, and check the output against the input character by character. No position will match, at any rotor setting, with any reflector, with or without plugboard leads.
Set rotors I (left), II (middle), III (right), all ring settings 01, all windows on A, reflector UKW–B, plugboard empty. This is the canonical smoke test for an Enigma implementation.
AAAAAAAAAA and the output is BDZGOWCXLT.HELLOWORLD and the output is ILBDAAMTAZ.A A A, type ILBDAAMTAZ, and you get HELLOWORLD back. That round trip is the whole point of the reflector.Two follow-ups that show how sensitive the key is. First, change only the right rotor's ring setting from 01 to 02, leave everything else alone, and AAAAA now produces UBDZG instead of BDZGO. One ring notch, on one rotor, and every letter changes. Second, change only the reflector: with everything else at the same default settings, AAAAA gives BDZGO on UKW–B, SSKWS on UKW–A and PJBUZ on UKW–C. If your decipherment is complete nonsense from the very first character, a wrong reflector or a wrong rotor order is far more likely than a wrong ring setting.
If you have a set of settings and a ciphertext, the order to enter them matters less than getting all of them in before you type. Work through it like this:
The input is normalised before anything else happens: it is upper–cased and every character that is not A–Z is discarded. Spaces, digits and punctuation simply vanish rather than passing through, which matches operating practice — German procedure spelled numbers out and used letter groups such as X for full stops — but it does mean the output is one unbroken run of letters with no word breaks to help you. Read it in five–letter groups the way the original messages were transmitted.
Three buttons load a complete configuration: a simple all–A test case, and two labelled with historical flavour. Treat them as convenient starting configurations for experimenting, not as authenticated key–sheet entries — and note that the naval one is a three–rotor setup on this three–rotor machine, not the four–rotor M4 the Kriegsmarine used on Atlantic traffic. Loading a preset overwrites your current rotors, rings, reflector, plugboard and message.
Enigma is comprehensively broken and has been for eighty years. A modern laptop recovers a full key from a moderate amount of ciphertext, and the double–step schedule, the no–letter–maps–to–itself property and the reciprocal plugboard all narrow the search enormously. Use this to learn the machine, to check a puzzle answer, or to reproduce a historical message. Do not use it to protect anything. If you want to see how a genuinely unbreakable classical scheme differs, the one-time-pad tool on this site is the honest comparison — not because it is more elaborate, but because it is the only one with a proof.