How this instrument works
The Vigenère cipher strengthens the simple idea behind the Caesar cipher by using more than one shift. Instead of moving every letter forward by the same fixed amount, you pick a keyword, and each letter of that keyword sets the shift for one letter of your message. LEMON, for instance, gives shifts of 11, 4, 12, 14, and 13 (the alphabet positions of L, E, M, O, N), and once you reach the end of the keyword it simply repeats from the start for the rest of the message.
Because the shift changes from letter to letter, the same plaintext letter usually encrypts to different ciphertext letters depending on where it falls against the repeating keyword — a big improvement over the Caesar cipher, where every A always becomes the same letter. For centuries this earned the Vigenère cipher the nickname "le chiffre indéchiffrable," French for "the indecipherable cipher," until Friedrich Kasiski published a general method for breaking it in 1863 (Charles Babbage had privately broken a related cipher even earlier). It's a good teaching tool for how polyalphabetic ciphers work, not a way to protect anything that actually matters today.
This instrument's keyword only advances across the letters of your text — spaces, digits, and punctuation pass through unchanged and don't consume a keyword position, so "Hello, World!" and a keyword of KEY still line the keyword up correctly against just the ten actual letters (H, e, l, l, o, W, o, r, l, d). Encrypting uses Ci = (Pi + Ki) mod 26 letter by letter; decrypting runs the same relationship in reverse, Pi = (Ci - Ki) mod 26, using the identical keyword.
- Type or paste your text into the Text field — letters, spaces, and punctuation are all accepted.
- Enter a Keyword made of letters (case doesn't matter; non-letter characters in the keyword are ignored).
- Choose Encrypt to turn plaintext into ciphertext, or Decrypt to recover plaintext from ciphertext.
- Read Result for the output. Non-letter characters in your text stay exactly where they are and don't shift.
- To decrypt a message someone else sent you, switch Mode to Decrypt and enter the same keyword they used to encrypt it.
Worked example — ATTACKATDAWN encrypted with keyword LEMON
This is the textbook example used to teach the Vigenère cipher. The keyword LEMON repeats across the 12 letters of ATTACKATDAWN as LEMONLEMONLE, then each plaintext letter's position is added to the matching keyword letter's position, mod 26: A(0)+L(11)=11->L, T(19)+E(4)=23->X, T(19)+M(12)=31 mod26=5->F, A(0)+O(14)=14->O, C(2)+N(13)=15->P, K(10)+L(11)=21->V, A(0)+E(4)=4->E, T(19)+M(12)=31 mod26=5->F, D(3)+O(14)=17->R, A(0)+N(13)=13->N, W(22)+L(11)=33 mod26=7->H, N(13)+E(4)=17->R. ATTACKATDAWN encrypts to LXFOPVEFRNHR.
Decrypting reverses the same arithmetic with the same keyword: switch Mode to Decrypt, enter LXFOPVEFRNHR with keyword LEMON, and each step subtracts instead of adds (for example L(11)-L(11)=0->A), recovering ATTACKATDAWN exactly.
Punctuation and spaces make this more realistic. Encrypting "Hello, World!" with the short keyword KEY only advances the keyword across the message's ten actual letters — the comma, space, and exclamation point are skipped entirely and reprinted as-is. The result is "Rijvs, Uyvjn!": notice the punctuation and word break land in the exact same places as the original, because only letters consume a keyword position.
Questions
How is the Vigenère cipher different from the Caesar cipher?
The Caesar cipher shifts every letter of your message by the same fixed amount, giving only 26 possible keys total. The Vigenère cipher instead repeats a keyword across the message, so the shift changes from letter to letter depending on which keyword letter lines up with it — the same input letter can encrypt to different output letters in different places. If you only need a single fixed shift, this site's Caesar Cipher Shifter is the simpler, faster tool for that.
Does punctuation or spacing mess up the keyword alignment?
No. Non-letter characters — spaces, digits, punctuation — pass straight through unchanged and are skipped when advancing through the keyword, so they never desynchronize the shift pattern. Only the letters of your message consume keyword positions, which is why encrypting the same sentence with and without spaces produces letter-for-letter identical results once you strip the punctuation back out.
Is the Vigenère cipher secure enough to protect real information?
No. It was considered unbreakable for roughly three centuries, but Friedrich Kasiski published a general attack against it in 1863 by finding repeated patterns in the ciphertext to work out the keyword's length, after which the cipher reduces to a set of ordinary Caesar shifts that fall to frequency analysis. Modern computers automate that same attack in moments. Use this tool for puzzles, historical study, or learning how polyalphabetic ciphers work — not for anything that actually needs to stay secret.
Does the keyword's case or length matter?
Case doesn't matter — LEMON, lemon, and LeMoN all produce identical results, since the keyword is compared by alphabet position regardless of case. Length does matter: a keyword as long as the message never repeats and is much harder to break, while a short keyword (like a 3-letter word repeated across a long paragraph) repeats often and is easier to crack with pattern-based attacks.
What happens if my keyword contains numbers or symbols?
Only letters in the keyword are used; any digits, spaces, or punctuation you type into the keyword field are ignored when building the repeating key sequence. If you enter a keyword with no letters at all, there's nothing left to shift with, so type a keyword made of at least one letter.
Can I recover my original text if I forget which mode I used?
Yes, as long as you still have the keyword. Encrypting and decrypting use the exact same keyword and the same letter-by-letter alignment, just adding versus subtracting the keyword shift, so running your ciphertext back through with Mode set to Decrypt and the identical keyword always recovers the original text.