Enigma Machine Simulator

Free & private · Powered by @gykh/enigma

A working Enigma I / M3, the cipher machine of the German armed forces in WWII. Choose rotors, rings and plugboard, then type on the keyboard and watch the rotors turn and the lamps light. Everything runs in your browser; nothing is uploaded.

Machine settings

Rotor
Left
Middle
Right
Ring Window
A
A
A

Letter pairs separated by spaces. Each letter can be used once.

Lampboard & keyboard

Click the keys or type on your own keyboard. Windows above step on every press.

Typed
Lit

Encrypt / decrypt textFrom windows AAA

Enigma is reciprocal: the same settings encrypt and decrypt. Case, spaces and punctuation pass through without turning the rotors.

More free tools

How the Enigma machine works

Every key press first turns the rotors, then sends a current through the plugboard, the three rotors right to left, the reflector, back through the rotors left to right and the plugboard again, where it lights a lamp. Because the rotors move on every press, the same key lights a different lamp each time: AAAAA → BDZGO with rotors I II III at AAA.

The right rotor turns on every press. When it passes its notch it kicks the middle rotor, and the middle rotor kicks the left one. Set the windows to ADU and press three keys to see the famous double step: ADV → AEW → BFX.

How to decrypt an Enigma message

  1. Set up the machine exactly as the sender did: rotor order, reflector, ring settings and plugboard (the day's key sheet).
  2. Turn the windows to the starting position (the message key).
  3. Type the ciphertext. The lamps spell the plaintext. Press 1941 message above to load a real Operation Barbarossa signal from 7 July 1941, already set to its message key BLA.

Use it in your code

Everything on this page is available as a free, MIT-licensed, zero-dependency npm package with TypeScript types.

npm install @gykh/enigma

import { encryptString, Enigma } from "@gykh/enigma";
encryptString("AAAAA"); // "BDZGO"

const machine = new Enigma({ positions: "ADU" });
machine.press("A"); machine.positions; // "ADV"

Star it on GitHub · View on npm · Watch the 49s video

Frequently asked questions

Why can a letter never encrypt to itself?

The reflector always sends the current back along a different wire, so a key can never light its own lamp. Codebreakers at Bletchley Park used this flaw to rule out guesses of where a known word (a crib) sat in a message.

What do the ring settings do?

The ring (Ringstellung) rotates a rotor's wiring relative to its letters and notch. It changes the output without changing what you see in the windows, which is why operators needed both the rings and the start positions.

Which machines does this simulate?

The three-rotor Enigma I used by the army and air force, and the navy's M3: rotors I to VIII and reflectors UKW-A, B and C. Its output matches the historical machines letter for letter.

Is my text sent to a server?

No. The whole machine runs locally in your browser. Want to send someone your encrypted message with a short, tidy link? Shorten it with MiniFyn.

Copied to clipboard!