%3C/text%3E%3C/svg%3E">
💻
💻 Tech & IT

Vigenère Cipher Tool

Results update as you type.

Your numbers

Understanding the Vigenère cipher tool — concept and principle

The Vigenère cipher, the classic polyalphabetic cipher, encrypts each letter with a different Caesar shift taken from a repeating key word. People use it to study cryptographic history, solve puzzles and see why repeating keys are dangerous.

Vigenère cipher with the key LEMONATTACK AT DAWN with the repeating key LEMONLEMONLE becomes LXFOPV EF RNHR; spaces do not use key letters.A repeating key gives each letter its own shiftTextKeyShift=AL11LTE4XTM12FAO14OCN13PKL11VAE4ETM12FDO14RAN13NWL11HNE4R3rd letter: T + M = 19 + 12 = 3131 − 26 = 5 → FThe 2nd and 3rd letters are both T,yet they become X and F
Each key letter is a Caesar shift (L = 11, E = 4 …), so ATTACK AT DAWN becomes LXFOPV EF RNHR.

How it is calculated

Number letters A = 0 … Z = 25. Write the key under the letters of the message, repeating it as often as needed, and let k_i be the key letter under the i-th letter of the message.

The tool removes anything that is not A–Z from the key (an empty key becomes "A", which means no shift), ignores case in the key, and advances the key position only on letters, so spaces and punctuation in the text are copied unchanged and do not use up key letters. Choose Encrypt or Decrypt in the Mode field; the single Result row shows the output, so to decode, paste the ciphertext and choose Decrypt.

The principle

Each key letter selects one of 26 Caesar alphabets. Because the same plaintext letter can turn into different ciphertext letters depending on its position, the simple letter frequencies that break a Caesar cipher are flattened out. The weakness is the repetition: letters that are a key length apart are encrypted with the same shift. Once the key length is found (Kasiski examination or the index of coincidence), the message splits into several Caesar ciphers that are each easy to solve. A key that is truly random, as long as the message and never reused is the one-time pad, which is unbreakable in principle.

Worked example

  1. Inputs: text "ATTACK AT DAWN", key "LEMON" (shifts 11, 4, 12, 14, 13).
  2. Key aligned to the letters only: ATTACK AT DAWN / LEMONL EM ONLE.
  3. A + L = 0 + 11 = 11 → L; T + E = 19 + 4 = 23 → X; T + M = 19 + 12 = 31 mod 26 = 5 → F; A + O = 14 → O; C + N = 15 → P; K + L = 21 → V.
  4. Continuing the same way gives LXFOPV EF RNHR.
  5. With the default mode Encrypt, the Result row shows LXFOPV EF RNHR and the Mode row says encrypted with the key. Enter LXFOPV EF RNHR and choose Decrypt to get ATTACK AT DAWN back.

How to read the result

A longer, non-repeating key makes the ciphertext harder to analyse, but any repeated key eventually leaks patterns in a long message.

Common mistakes

Keep in mind: Vigenère has been publicly breakable since the 19th century. Use it only for learning or games, never to protect real data.

Frequently asked questions

Who invented the Vigenère cipher?

It was described by Giovan Battista Bellaso in 1553 and later misattributed to Blaise de Vigenère, who published a stronger autokey variant.

How is the cipher broken?

Find the key length with the Kasiski test or the index of coincidence, then solve each column as a Caesar cipher using letter frequencies.

Is a key as long as the message secure?

Only if it is truly random and never reused; that is the one-time pad. A long readable text as the key can still be attacked.

Sources: David Kahn, The Codebreakers, Scribner, 1996 · Simon Singh, The Code Book, Fourth Estate, 1999

Checked 8 Nov 2026. Standard formulas and RFC/IEEE definitions, computed locally in your browser — nothing you type is sent anywhere.

💻 All tech & IT tools →🌍 Calculators by country →