Reference

The Vigenere Cipher Explained

The Vigenere cipher improves on Caesar by using a keyword so that each letter is shifted by a different amount. Repeat the keyword across the message, and shift each letter by the position of the matching key letter. For centuries it was called the indecipherable cipher.

Written and maintained by the CipherPad team at FusionStudios. Last updated 15 October 2026.

Want to try it? Open the Vigenere Cipher translator and encode or decode your own text in your browser.

How the Vigenère cipher works, step by step

Encrypt GLOBEX with the keyword KEY. Each letter gets its own Caesar shift, chosen by the keyword letter above it, with A counted as 0.

  1. Repeat the keyword under the message

    Write KEY under GLOBEX letter by letter and start again when it runs out: GLOBEX over KEYKEY.

  2. Turn each key letter into a shift

    A key letter shifts by its position in the alphabet: K = 10, E = 4 and Y = 24.

  3. Read the answer from the tabula recta

    The tabula recta (the Vigenère square) has one row per key letter, each the alphabet started at that letter. Row K reads KLMNOPQRSTUVWXYZABCDEFGHIJ. Find G in the top alphabet and look down to row K: it gives Q.

  4. Or add and wrap with mod 26

    The square is a shortcut for one sum per letter: G 6 + 10 = 16 (Q), L 11 + 4 = 15 (P), O 14 + 24 = 38, mod 26 = 12 (M), B 1 + 10 = 11 (L), E 4 + 4 = 8 (I) and X 23 + 24 = 47, mod 26 = 21 (V). The ciphertext is QPMLIV.

  5. Decode by subtracting

    To decrypt, repeat the same keyword over the ciphertext and subtract each shift instead of adding it, adding 26 to anything below 0. QPMLIV with KEY gives GLOBEX again.

How the keyword works

Write the keyword repeatedly above the message. Each key letter gives a shift: A means shift 0, B means 1, and so on. Shift each message letter by its key letter's value, wrapping around the alphabet.

Because the shift changes from letter to letter, the same plaintext letter can encrypt to different ciphertext letters. That hides the letter-frequency patterns that give a simple Caesar cipher away.

Why it was finally broken

The weakness is that the keyword repeats. If an attacker finds the key length, they can split the message into several simple Caesar ciphers and solve each with frequency analysis.

Charles Babbage and Friedrich Kasiski worked out how to find the key length in the 19th century by spotting repeated patterns in the ciphertext. A key as long as the message, never reused, is the one version that is truly unbreakable.

Frequently asked questions

Why is the Vigenere cipher stronger than Caesar? #

It uses a keyword so the shift changes for every letter, which hides the letter-frequency clues that let people crack a single fixed Caesar shift.

How was the Vigenere cipher cracked? #

By finding the length of the repeating keyword. Once the key length is known, the message splits into several Caesar ciphers that each fall to frequency analysis.

Keep exploring

Reference this tool

Mention this page in homework, a write-up or an article with this line:

The Vigenere Cipher Explained on CipherPad, retrieved on the date of your visit, https://cipherpad.dev/learn/vigenere-cipher-explained

The text on this page is licensed CC BY 4.0: you may share and adapt it, also commercially, as long as you credit CipherPad and link to the page.