Vigenère cipher

The Vigenère cipher shifts each letter by an amount taken from a keyword, so the same letter is not always replaced the same way. Enter your text and keyword, choose encode or decode, and pick the classic or autokey variant.

Mode
Key

Runs in your browser: nothing you enter is sent anywhere.

How to use it

  1. Type or paste your text and a keyword.
  2. Choose Encode or Decode, and the repeating or the autokey form of the key.
  3. Copy the result. To read a message, use Decode with the same key and the same variant that were used to write it.

How it works

With letters numbered A = 0 to Z = 25, encoding adds the key number to the text letter and takes the remainder after dividing by 26. Decoding subtracts it. In the classic form the key is repeated along the letters of the text. In the autokey form the key is the keyword followed by the plaintext letters.

Worked example

Take the text ATTACKATDAWN and the key LEMON. A plus L (11) is L, T plus E (4) is X, T plus M (12) is F, A plus O (14) is O, C plus N (13) is P, then the key repeats: K plus L is V, and so on, giving LXFOPVEFRNHR. Decoding that with the same key restores the text.

Tips

A longer keyword with no repeated letters hides the pattern better. For a single fixed shift without a keyword, use the Caesar cipher: it is the case of a one-letter key.

Frequently asked questions

How does the Vigenère cipher work?

Each key letter is a number from 0 (A) to 25 (Z). The first letter of the text is shifted by the first key number, the second by the second, and so on, going back to the start of the key when it runs out. With the key LEMON, the text ATTACKATDAWN becomes LXFOPVEFRNHR.

What is the autokey variant?

In the autokey cipher the keyword is used once and then the plaintext itself continues the key, so the key never repeats. With the key QUEENLY, ATTACKATDAWN becomes QNXEPVYTWTWP. To decode, the key stream grows from the letters already recovered.

What happens to spaces, digits and accented letters?

Only the 26 letters A to Z and a to z are changed, and their case is kept. Everything else is copied as it is and does not use up a key letter, so the key advances only on letters. Non-letters in the keyword are ignored.

Is the Vigenère cipher secure?

No. It was thought unbreakable for centuries, but repeating keys can be found by counting repeats in the ciphertext, and computers do it in moments. Use it for puzzles and teaching, never for real secrets.

More in Text

All tools in this category: Text ·Updated November 3, 2026

Privacy choices

Google Analytics shows us which tools are used and whether they work. It may set cookies. Your choice is kept in this browser.