Enigma Machine
Simulate, encode, and decode with the German Enigma cipher machine of World War II. Choose the reflector, three rotors, their ring settings and start positions, and the plugboard, then type your message and watch the rotors step. Enigma is reciprocal: the same settings both encrypt and decrypt, so there is no separate decode mode. Everything runs in your browser.
Enigma is reciprocal: the same machine setup both encrypts and decrypts. To read a message, set the rotors, rings, positions, and plugboard to exactly the settings used to encrypt it, paste the ciphertext, and the result is the original plaintext. There is no separate decode button.
Reflector
Rotors
Left (slow)
Middle
Right (fast)
Ring settings
Start positions
Plugboard
The plugboard swaps letters in pairs before and after the rotors. Enter pairs such as AB CD EF; each letter can be used only once. Leave it empty for no swaps. Spaces and other characters are ignored.
Enter text above to see the Enigma result here.
How to use Enigma Machine
- 1
Choose the reflector and rotors
Select the reflector, B or C, and pick the three rotors from I to V for the left, middle, and right slots. The standard reference setup is reflector B with rotors I, II, and III.
- 2
Set the ring settings
Enter the three ring settings as letters, such as AAA. The ring setting, or Ringstellung, turns each rotor's wiring relative to its lettered ring and changes the result.
- 3
Set the start positions
Enter the three start positions as letters, such as AAA. These are where the rotors are turned to before you begin typing, shown in the rotor windows. To decode, use the same start positions that were used to encrypt.
- 4
Add plugboard pairs
Optionally enter plugboard pairs such as AB CD EF. Each pair swaps two letters before and after the rotors, and each letter can be used only once. Leave the field empty for no plugboard.
- 5
Type and read the result
Type or paste your message and the result appears instantly, with the rotor windows stepping in the live working. Because Enigma is reciprocal, the same settings encrypt and decrypt, so you can copy, download, or share a link that reopens the tool with your exact machine setup and text.
Understanding the Enigma Machine
What is the Enigma machine?
The Enigma machine is an electromechanical rotor cipher device invented by the German engineer Arthur Scherbius around 1918. It looks like a typewriter in a wooden box: a keyboard, a lampboard of 26 glowing letters above it, a set of rotating wheels called rotors, and a plugboard of cables at the front. Press a letter and an electrical current flows through the plugboard, across the rotors and a reflector, and back again to light up a different letter on the lampboard. That lit letter is the ciphertext. Each key press also turns the rotors, so the same plaintext letter is enciphered differently each time it appears, which is what makes Enigma a polyalphabetic cipher rather than a simple substitution.
Adopted and steadily improved by the German military, Enigma became the backbone of Nazi Germany's secret communications throughout World War II. The Germans believed it was unbreakable because of the staggering number of possible settings. They were wrong: Polish mathematicians led by Marian Rejewski reconstructed the machine and its wiring in the early 1930s, and their work was extended at Britain's Bletchley Park by Alan Turing, Gordon Welchman, and many others, whose codebreaking is widely held to have shortened the war. This tool recreates the standard three-rotor Enigma I used by the German Army and Air Force.
How the Enigma machine works
An Enigma setup has four working parts. The plugboard, or Steckerbrett, swaps pairs of letters with cables before and after the rotor stack. The rotors, or Walzen, are wheels wired so that each of the 26 input contacts connects to a scrambled output contact; this machine uses three at a time, chosen and ordered from a set of five. The reflector, or Umkehrwalze, sits at the far end and sends the current back through the rotors by a fixed pairing. The lampboard then shows the result. The signal therefore makes a round trip: plugboard, right rotor, middle rotor, left rotor, reflector, left rotor, middle rotor, right rotor, plugboard, and finally the lamp.
Three settings personalise the machine for a given day or message. The ring setting, or Ringstellung, rotates each rotor's wiring relative to its lettered ring. The start position, or Grundstellung, is where each rotor is turned to before you begin typing, shown through small windows. The plugboard pairs add a final layer of swaps. Before every single key press the rotors advance like an odometer, so the wiring the current passes through is never the same twice in a row. The live working below the tool shows the three rotor windows stepping for each letter of your message.
Worked example
Set the machine to its most commonly cited reference configuration: reflector B, rotors I, II, and III from left to right, all three ring settings on A, all three start positions on A, and an empty plugboard. Now type five A's. The first key press steps the right rotor, and the current traces its round trip to light the lamp B. Typing the remaining A's, with the rotor stepping each time, lights D, then Z, then G, then O. The plaintext AAAAA therefore enciphers to BDZGO, a classic test that confirms the rotors are wired correctly.
Because Enigma is reciprocal, decoding uses the very same settings. Return all three rotors to their A start positions, leave everything else unchanged, and type the ciphertext BDZGO. Out comes AAAAA, the original message. The identical setup recovered the text, which is why this tool has no separate decode mode: you simply restore the settings that were used to encrypt and type the ciphertext back in.
The reflector and reciprocity
The reflector is what makes Enigma reciprocal. Because it pairs the 26 wires symmetrically, the path the current takes from a key to a lamp is exactly reversible: if pressing A at a given rotor configuration lights G, then at that same configuration pressing G would light A. Since the rotor stepping depends only on the settings and the letter's position in the message, never on the letters themselves, decrypting is identical to encrypting once the machine is reset to the same start. One procedure, one setup, both directions.
The reflector also created Enigma's most famous flaw: a letter can never encrypt to itself. Because the current always comes back on a different wire from the one it left, A can become any letter except A. That sounds harmless, but it gave codebreakers a powerful tool. If they guessed that a stretch of plaintext, a crib, sat somewhere in a message, they could slide it along the ciphertext and instantly reject every position where a letter matched itself, dramatically narrowing the search. A design meant to add convenience handed the Allies a foothold.
Rotor stepping and the double step
The rotors turn like the wheels of an odometer, but with a twist. The right rotor steps on every key press. Each rotor has a turnover notch, and when a rotor steps past that notch it pushes the rotor to its left forward one place. So after the right rotor completes a full turn and reaches its notch, the middle rotor advances; after the middle rotor eventually reaches its notch, the left rotor advances. This is why the machine is slow to repeat: with three rotors the full cycle is thousands of letters long.
There is one well-known irregularity called the double step. Because of how the stepping levers engage, when the middle rotor sits at its own turnover position it advances on the next key press together with the left rotor, and it had also been advanced on the previous press by the right rotor, so it appears to move twice in quick succession. Any faithful Enigma simulator must reproduce this anomaly, and this tool does; you can watch it happen in the live working when the middle rotor is near its notch. Getting the stepping exactly right is essential, because even one wrong step would throw off every letter that follows.
How the Enigma code was broken
The first breakthrough came from Poland. In 1932 the mathematician Marian Rejewski, working with Jerzy Rozycki and Henryk Zygalski at the Polish Cipher Bureau, used permutation theory and a stolen list of settings to reconstruct the internal wiring of the military Enigma, an achievement long thought impossible. The Poles built electromechanical aids and read German traffic for years, then shared everything with Britain and France just before the war. That gift was the foundation on which Bletchley Park built.
At Bletchley Park, Alan Turing and Gordon Welchman designed the Bombe, a machine that rapidly tested huge numbers of rotor settings to find the day's key. Their attack leaned on the no-self-encryption flaw, on cribs of predictable plaintext such as weather reports and stock phrases, and on operator mistakes like reused or lazy message keys. As Germany added rotors and plugs the work grew harder, but the codebreaking never stopped. The intelligence it produced, code-named Ultra, is widely credited with shortening World War II and saving many lives, and it helped lay the groundwork for modern computing.
Is the Enigma cipher secure?
By the standards of its day Enigma was formidable, with roughly 159 quintillion possible settings once the rotor choice, ring settings, start positions, and ten plugboard cables are counted. But raw key count is not the same as security. Structural flaws, especially that no letter encrypts to itself, predictable message content, and human error let analysts with the right machines and methods recover the daily keys again and again. Against a modern computer, even a perfectly operated Enigma offers no protection at all.
Today the Enigma cipher is studied and enjoyed for what it teaches and for its extraordinary history. It is one of the best ways to understand rotor machines, polyalphabetic substitution, and how careful cryptanalysis defeats a cipher, and it appears constantly in museums, films, puzzles, and capture-the-flag challenges. To protect real information you should always rely on modern, well-tested algorithms such as AES instead.
Frequently asked questions
What is the Enigma machine?
How does the Enigma machine work?
How do I decode an Enigma message?
Can you show an Enigma example?
Why does Enigma have no separate decode button?
What are rotors, ring settings, and start positions?
What is the plugboard?
Why can a letter never encrypt to itself?
Who broke the Enigma code?
How secure was the Enigma cipher?
Is my text uploaded to a server?
Related tools
Keep going with these handy tools