Encode and decode with the Vigenère cipher
This tool applies the Vigenère cipher to your text with any key you choose, in either direction. It shows every step letter by letter in the Vigenère table, and it also works as a Vigenère decoder without the key, as long as the text is long enough.
The method is named after Blaise de Vigenère, a French diplomat of the 16th century, although similar systems had been described before him. For nearly three hundred years it had a reputation for being unbreakable.
How to use it
- Choose a direction: "Encode" or "Decode".
- Type your secret word into "Key (letters)".
- Type or paste the message into "Text": the "Result" appears straight away.
- Hover over a box in "Letter by letter": the "Vigenère table" highlights the key row, the plain-letter column and the cell where they cross.
- Click "Copy result". "Use result, reverse direction" lets you check that you get the original message back.
Upper and lower case are kept, and so are spaces, digits and punctuation. By default, "Key does not advance on spaces and punctuation" is ticked: only letters use up the key. Untick it if your puzzle moves the key on every character. Accented letters stay as they are unless you tick "Remove accents first".
How it works, with the table
Write the key under the message, repeating it as often as needed. Each message letter is shifted by the position of the key letter below it: A shifts by 0, B by 1, C by 2 and so on. So the two Ts in ATTACK below become X and F.
The classic test case is ATTACKATDAWN with the key LEMON, which gives LXFOPVEFRNHR. A plus L gives L, T plus E gives X, T plus M gives F, A plus O gives O, C plus N gives P, then the key starts again: K plus L gives V. In the table: row E, column T gives X. Decoding LXFOPVEFRNHR with LEMON brings back ATTACKATDAWN.
Why it was trusted, and how it is broken
A Caesar cipher gives itself away through letter frequencies: the most common English letter, E, always turns into the same letter. With Vigenère, that E is spread over several letters depending on the key, so the frequencies look flat.
In the 19th century, the Kasiski method changed that. When a group of letters repeats in the cipher text, it is often because the same plain-text group fell under the same part of the key. The gap between the two repeats is then a multiple of the key length.
The index of coincidence, developed in the 20th century, measures how likely it is to pick the same letter twice from a text. It is about 0.038 for random letters and about 0.066 for English. Split the message into columns for a guessed key length: when the guess is right, each column is a plain Caesar cipher and returns to the English value.
The "Find an unknown key" section does exactly this. It applies both methods, then gives the most likely key and a preview. On 400 letters of English encoded with KEY, it finds length 3 and the key. On short texts it warns you: under 40 letters it will not try.
Classroom and puzzle uses
The Vigenère cipher is a favourite in computing and maths lessons, cryptography clubs, puzzle hunts and escape rooms, where the key is often hidden somewhere in the room. To protect real data, use modern encryption such as AES.
Frequently asked questions
How do I decode a Vigenère cipher without the key?
Paste the cipher text, choose its language and click "Find the key". Aim for a few hundred letters.
Why is a long key harder to break?
Each column then holds fewer letters, and frequency analysis needs numbers to work. A truly random key as long as the message, never reused, cannot be broken at all.
Does the key have to be in capitals?
No. lemon, Lemon and LEMON give exactly the same result.