Relic
Get Relic free

Vigenère Cipher Encoder and Decoder

Type a keyword and your text to encrypt or decrypt a Vigenère cipher. See the key lined up under every letter, and the full Vigenère table if you want to check it by hand.

Runs entirely in your browser. Nothing you type is uploaded.
Key used: LEMON
Your text
Encrypted
Encrypted text…
Decrypted
Decrypted text…
The key under each letter
Type some text and a keyword to see which key letter shifts which letter.

How the Vigenère cipher works

A Vigenère cipher is a set of Caesar shifts that take turns. Each letter of the keyword stands for a shift: A is 0, B is 1, and so on up to Z at 25. Write the keyword under your message, over and over, and shift each letter by the key letter under it. The same plain letter can come out differently depending on where it falls, which is what made the cipher so much harder to break than a Caesar cipher.

This tool follows the usual rules. Only the letters A to Z are changed, and capitals stay capitals. Spaces, digits and punctuation are copied across as they are, and they don’t use up a key letter. Anything in the keyword that isn’t a letter is ignored, so “lemon 42” works the same as LEMON. Decrypting is the same job in reverse: each letter shifts back by its key letter. You need the keyword to do that. Without it, see the last section below.

A worked example

The textbook example encrypts ATTACK AT DAWN with the key LEMON. Line the key up under the letters and add the two positions, wrapping past Z back to A:

Plain textATTACKATDAWN
Key, repeatedLEMONLEMONLE
Shift114121413114121413114
Cipher textLXFOPVEFRNHR

The first T sits under E (a shift of 4) and becomes X. The second T sits under M (a shift of 12): 19 plus 12 is 31, which wraps to 5, the letter F. So one word has the same letter turning into two different ones. The result is LXFOPV EF RNHR. Paste that into the box with the key LEMON and the Decrypted panel shows ATTACK AT DAWN again.

Who invented the Vigenère cipher?

The idea of switching alphabets with an agreed keyword appears in a 1553 booklet by Giovan Battista Bellaso. Blaise de Vigenère wrote about ciphers in a treatise published in 1586, and his name got attached to this one. For about three hundred years it had a reputation as the cipher nobody could crack.

The first published method for breaking it came from Friedrich Kasiski, a Prussian army officer, in his 1863 book. Charles Babbage had worked out a similar attack earlier, but he never published it.

Can you decode a Vigenère cipher without the key?

Often, yes, if the message is long enough. Kasiski’s trick is to look for chunks of letters that repeat in the cipher text. When the same word lines up with the same part of the key twice, it encrypts the same way, and the gap between the two copies is a multiple of the key length. Once you know the key is, say, 5 letters long, every 5th letter was shifted by the same amount. Each of those groups is a plain Caesar cipher, and you can solve it by checking which shift gives English-looking letter counts. This page doesn’t try to guess keys for you. Short messages rarely have enough repeats for the guess to be reliable.

A Vigenère cipher is fine for puzzles, escape rooms and classroom exercises. It won’t protect anything real. To lock text with a password, use Encrypt Text, which uses AES. For a tour of the other classic ciphers, read types of ciphers.

Frequently asked questions

How do I decode a Vigenère cipher?

Paste the cipher text, type the keyword, and read the Decrypted panel. Each letter is shifted back by the key letter above it, so the keyword has to be exactly right. One wrong key letter garbles every letter it lines up with, and you can spot the pattern in the key view.

What is the Vigenère table?

It is a 26 by 26 grid, also called the tabula recta. Each row is the alphabet shifted one more place than the row above. To encrypt by hand you find the key letter's row and the plain letter's column, and the cipher letter is where they cross. Press Show the Vigenère table to see it, with the rows for your key highlighted.

Can I decode a Vigenère cipher without the key?

Sometimes. Long messages usually can be broken by finding the key length from repeated chunks of cipher text, then solving each position as a Caesar cipher. This tool doesn't guess keys. It needs the keyword. If the puzzle hints at a word, try that first.

Does the key change spaces and punctuation?

No. Only the letters A to Z are shifted, and the key only moves forward on letters. Spaces, digits and punctuation are copied as they are. Letters in the keyword are all that count, so lemon, LEMON and Le Mon give the same result.

What is the difference between Vigenère and Caesar?

A Caesar cipher shifts every letter by the same amount. Vigenère changes the shift from letter to letter using a keyword. A Vigenère cipher with a one-letter key is just a Caesar cipher: the key D is a shift of 3.

More free tools
Caesar Cipher
caesar cipher
Atbash Cipher
atbash cipher
ROT13
rot13
Encrypt Text
encrypt text online
Morse Code Translator
morse code translator
Binary Translator
binary translator
All tools