Vigenère Cipher Encoder and Decoder

Encrypt a message with a secret keyword, or decrypt one when you know the key. Each letter of the keyword shifts a different letter of your message, making this much harder to break than a simple Caesar shift.

Lxfopv ef rnhr

Only letters are changed and the key only advances on letters, the same as most textbooks and puzzle sites.

How the Vigenère cipher works

Write the keyword repeatedly under the message. Each keyword letter tells you how far to shift the letter above it: A shifts by 0, B by 1, C by 2 and so on up to Z, which shifts by 25. Here is the classic example with the keyword LEMON:

MessageATTACKATDAWN
KeyLEMONLEMONLE
CipherLXFOPVEFRNHR

A shifted by L (11) becomes L, T shifted by E (4) becomes X, and so on. To decrypt, shift each letter back by the same amount. Notice that the two Ts in ATTACK become different letters (X and F); this hides the letter patterns that make a Caesar cipher so easy to break.

Choosing a good key

  • Longer keys are much stronger. A key as long as the message, used only once, cannot be broken (this is called a one-time pad).
  • Avoid common words: codebreakers try dictionary words first.
  • Both people need the same key, so share it separately from the message.

History: the "indecipherable cipher"

For about three centuries the Vigenère cipher had a reputation as le chiffre indéchiffrable, the indecipherable cipher. Charles Babbage worked out how to break it in the 1850s but did not publish his method, and Friedrich Kasiski published a general attack in 1863. Variants were still used in the American Civil War and in early 20th-century military messages. Today it is a classic for puzzle hunts, escape rooms and anyone learning cryptography.

Frequently asked questions

How do I decrypt a Vigenère cipher?

Choose 'Decrypt', type the keyword that was used to encrypt the message and paste the ciphertext. Each letter is shifted back by the matching keyword letter.

What is the difference between Vigenère and Caesar?

A Caesar cipher shifts every letter by the same amount. A Vigenère cipher uses a keyword, so each letter gets a different shift depending on its position. In fact, a Vigenère cipher with a one-letter key is the same as a Caesar cipher.

Can a Vigenère cipher be cracked without the key?

Yes, especially if the message is long. Codebreakers find the key length by looking for repeated sequences (the Kasiski examination) or with statistics, then solve each position as a separate Caesar cipher.

What happens to spaces, numbers and punctuation?

They are left unchanged, and the keyword only moves forward on letters. Most puzzle books and websites use the same rule, so results match.

Who invented the Vigenère cipher?

It was first described by Giovan Battista Bellaso in 1553. It was later credited to the French diplomat Blaise de Vigenère, whose name stuck.

More free tools