Vigenère Cipher Encoder/Decoder (Keyword Cipher)

Encode and decode messages with the Vigenère cipher entirely in your browser, using a keyword to shift each letter by a different amount. Encrypt and decrypt with the same keyword and inspect the transformation letter by letter. All processing happens locally in your browser.

What Is the Vigenère Cipher (Keyword Cipher)?

The Vigenère Cipher (ヴィジュネル暗号) is a polyalphabetic substitution cipher that shifts each letter of the plaintext by a different amount, determined letter-by-letter from a keyword. Unlike the Caesar cipher, which shifts an entire message by one fixed amount, the Vigenère cipher repeats the keyword to match the length of the plaintext and uses the numeric value of each keyword letter (A=0, B=1, and so on) to shift the corresponding plaintext letter. This tool supports both "encrypt" (turning plaintext into ciphertext with a keyword) and "decrypt" (recovering the plaintext from ciphertext with the same keyword), and shows the transformation one letter at a time so you can follow exactly how each shift is applied.

As long as the same keyword is used, encryption and decryption are mirror images of the same operation — only the direction of input and output changes. Everything runs locally in your browser, so the plaintext, ciphertext, and keyword you type are never sent anywhere. That makes this tool equally useful for studying how the cipher works and for testing a real message exchange.

How to Use the Vigenère Cipher Encoder/Decoder

  1. Choose a mode Select "Encrypt" to turn plaintext into ciphertext, or "Decrypt" to turn ciphertext back into plaintext.
  2. Enter your text Type the plaintext (for encryption) or ciphertext (for decryption) into the input field. Non-letter characters pass through unchanged.
  3. Enter the keyword Provide a keyword made only of letters. Encryption and decryption must use the exact same keyword.
  4. Run it and check the result Click "Run" to see the transformed text in the result field, and use the breakdown table to inspect the shift applied to each letter.
  5. Try the reverse direction Use "Reuse result as input" to move your encrypted output straight into decrypt mode and confirm the round trip works.

Tips for getting more out of it

  • The Vigenère cipher was once called "le chiffre indéchiffrable" (the indecipherable cipher), resisting practical cryptanalysis for roughly 300 years.
  • Because the keyword repeats, a shorter keyword means the same shift pattern repeats sooner, giving cryptanalysts more clues. Longer keywords are generally more secure.
  • Spaces, punctuation, and digits pass through unchanged without consuming a keyword position, so adding line breaks or spaces doesn't change the underlying encryption pattern.
  • Encryption and decryption are symmetric operations that use the same keyword. Use the "Reuse result as input" button to immediately try decrypting what you just encrypted.
  • The case of each letter (upper/lower) is preserved in the output exactly as typed, even though the shift calculation itself works on alphabet positions internally.

When the Vigenère Cipher Comes in Handy

Learning and practicing cryptography

Whether in a course or on your own, you can work through a real polyalphabetic cipher letter by letter instead of just reading about the theory.

Building practice material for the Kasiski examination

Generate ciphertext from a plaintext and keyword of your choosing, then use it as an exercise for estimating the repeating period and recovering the key.

Creating puzzle or escape-room ciphers

Produce a hint text that is a step harder to crack than a Caesar cipher, without spending much time hand-crafting the shifts yourself.

Recreating historical cipher systems

Reproduce, step by step, the same encryption method historically associated with 19th-century military and diplomatic communication.

Vigenère Cipher Terminology

Keyword cipher
A general term for ciphers that repeat a fixed keyword to determine the shift applied to each letter. Longer, less predictable keywords generally make the cipher harder to break.
Polyalphabetic substitution
A cipher that uses more than one substitution alphabet for a single plaintext alphabet. The Vigenère cipher effectively switches between as many Caesar ciphers as there are letters in the keyword.
Vigenère square (tabula recta)
A 26×26 grid listing every possible shift pattern, historically used to encrypt and decrypt by hand. Rows correspond to keyword letters and columns to plaintext letters.
Known-plaintext attack
A cryptanalysis technique that recovers the key by assuming part of the corresponding plaintext is already known. Predictable openings, such as standard greetings, often provide this kind of clue.
Cipher strength
A measure of how resistant a cipher is to being broken. For the Vigenère cipher, strength depends heavily on the length and unpredictability of the keyword — short, repeated keywords introduce a detectable periodicity that weakens it.
One-time pad
A cipher that uses a random, single-use key exactly as long as the plaintext. If the Vigenère cipher's keyword is replaced with such a key, it becomes theoretically unbreakable.

Frequently Asked Questions

In 1863, Prussian army officer Friedrich Kasiski published the "Kasiski examination," a method that estimates the keyword length from the distances between repeated substrings in the ciphertext, enabling systematic cryptanalysis for the first time. When part of the plaintext is already known, a known-plaintext attack can also recover the keyword.

The Caesar cipher applies a single fixed shift to the entire message, while the Vigenère cipher uses the numeric value of each keyword letter to apply a different, repeating shift to every letter. This defeats simple frequency analysis, which is exactly what breaks the Caesar cipher so easily.

It has long been credited to the French diplomat Blaise de Vigenère, but the same core method was actually published earlier, in 1553, by the Italian cryptologist Giovan Battista Bellaso. Vigenère himself is now believed to have devised a different, related cipher that only later became associated with his name.

It looks for identical substrings that repeat within the ciphertext and takes the greatest common divisor of the distances between them to estimate the keyword length. Once the length is known, each keyword position can be attacked separately with ordinary frequency analysis, effectively reducing the problem to several simple Caesar ciphers.

No, any string of letters works regardless of meaning. In practice, though, real words were often chosen for memorability, and that very predictability sometimes gave cryptanalysts, including those using the Kasiski examination, an extra edge.
Tool-kun

Side Note — How the Kasiski Examination Broke an "Unbreakable" Cipher

The Vigenère cipher bears the name of the 16th-century French diplomat Blaise de Vigenère, but he probably wasn't its true inventor. In 1553, the Italian cryptologist Giovan Battista Bellaso had already published essentially the same method of shifting each letter by an amount determined by a repeating keyword. Vigenère himself later became associated with a different cipher through his 16th-century writings, and the misattribution only solidified in the 19th century — a classic case of credit going to the wrong person in the history of science.

Where the Caesar cipher uses one single fixed shift, and the mechanical Enigma machine changes its shift with every rotor step, the Vigenère cipher achieves a different shift for every letter by cycling through an easy-to-remember keyword. A message encrypted with a single Caesar shift falls quickly to basic frequency analysis, but the Vigenère cipher flattens the apparent letter-frequency distribution, which is why it was known as "le chiffre indéchiffrable" (the indecipherable cipher) and remained in practical use well into the mid-19th century.

That reputation ended when Prussian army officer Friedrich Kasiski published his "Kasiski examination" in 1863. By measuring the distances between repeated substrings in a ciphertext, he showed how to estimate the keyword length; once the length is known, each position can be attacked with the same frequency analysis used against a simple Caesar cipher. This turned roughly three centuries of practical security into a systematically breakable scheme, marking a genuine turning point in the history of cryptanalysis.

Interestingly, if the keyword were as long as the plaintext itself and used only once, the Vigenère cipher would be mathematically equivalent to the theoretically unbreakable "one-time pad." The real-world weakness came from reusing short keywords, a lesson about key management that still shapes modern cryptographic design today.