Vigenère Cipher

Encode and decode Vigenère, autokey and Beaufort ciphers, with key-length analysis for breaking one.

The Vigenère Cipher runs entirely in your browser. Your text and key are processed on your device and never uploaded.

Built and maintained by Udit Agarwal

Try the Caesar cipher

About Vigenère Cipher

Vigenère repeats a keyword across a message and shifts each letter by its matching key letter, which gives one plaintext letter many possible ciphertext letters and defeats the frequency analysis that breaks a plain Caesar shift. It held up for three centuries and was called le chiffre indéchiffrable for most of them. This tool runs it in both directions, keeps case and punctuation intact, and offers the two variants that come up most often: autokey, which extends the key with the plaintext so it never repeats, and Beaufort, which subtracts instead of adding and so is its own inverse. For a ciphertext with no key, index-of-coincidence analysis suggests likely key lengths.

Features

  • Encode and decode with any keyword, case and punctuation preserved
  • Autokey and Beaufort variants alongside the classic cipher
  • Key-length analysis from the index of coincidence of each column
  • Letter frequency breakdown of the text
  • Optional grouping into blocks of five, the classical telegraph convention
  • Shows the keystream actually applied to the message
  • The full 26-row Vigenère tableau for working by hand

How to use the Vigenère Cipher

  1. Paste the text and enter a keyword
  2. Pick encode or decode, and a variant if you need one
  3. Read the result, with the keystream shown beneath it
  4. For an unknown key, switch to decode and check the suggested key lengths

Example

Input

ATTACKATDAWN with the key LEMON

Output

LXFOPVEFRNHR

The textbook example: each letter shifted by the key letter repeating above it.

Common errors & troubleshooting

  • Decoding gives readable text at the start and gibberish after. — The key is right but the variant is wrong. Classic Vigenère repeats the key, while autokey continues it with the plaintext, so the two agree only for the first few letters.
  • The result does not match another tool's output. — Check how non-letters are treated. Here punctuation is passed through and does not consume a key letter, which is the usual convention — some implementations advance the key on every character.
  • The key-length analysis suggests a multiple of the real length. — That is expected. Columns at twice the key length are just as consistent, so the shortest strong candidate is usually the answer.
  • Beaufort decoding seems to do nothing different from encoding. — It should not. Beaufort is its own inverse, so running it twice returns the original text and the direction selector makes no difference.

Frequently asked questions

How does the Vigenère cipher work?
The keyword is repeated along the message, and each letter is shifted forward by the alphabet position of the key letter above it. A key letter of B shifts by one, C by two, and so on, wrapping at Z.
Can a Vigenère cipher be broken without the key?
Yes. Once the key length is known — from repeated patterns or from index of coincidence — the ciphertext splits into columns, each of which is a plain Caesar shift open to frequency analysis. Kasiski published the method in 1863.
What is the index of coincidence used for here?
It measures how often two letters picked at random from the text match. English sits near 0.067 and random text near 0.038, so the candidate key length whose columns score highest is very likely the real one.
How is the autokey variant different?
Instead of repeating the keyword, it continues the key with the plaintext itself. The key never repeats, which removes the periodic structure that Kasiski examination relies on and makes the cipher considerably harder.
Is the Vigenère cipher secure today?
Not at all. It falls to a few lines of analysis and is a puzzle or a teaching example, not protection. Anything that has to stay private needs modern authenticated encryption such as AES-GCM.

Related tools

Guides

More Encode / Decode tools

  • QR Code Reader — Scan a QR code from an image, a screenshot or your camera and see what is inside — links, Wi-Fi, contacts and payments.
  • QR Code with Logo — Put your logo in a QR code and restyle its colours, shapes and frame, with a live check that it still scans.
  • UPI QR Code Generator — Make a UPI payment QR code from a UPI ID with an optional amount and note, and print a Scan to pay card.
  • vCard QR Code Generator — Turn contact details into a QR code phones can save in a tap, as vCard 3.0, 4.0 or MECARD, with a .vcf download.
  • WhatsApp QR Code Generator — Create a wa.me chat link and QR code from a phone number and an optional first message.
  • Bulk QR Code Generator — Turn a list or a CSV into up to 500 QR codes as a ZIP of PNG or SVG files, or a printable labelled sheet.
  • Unzip Files Online — Open a ZIP archive in your browser, preview files and extract one or all of them without uploading anything.
  • Base64 Encode / Decode — UTF-8 safe Base64 encoding and decoding.
  • URL Encode / Decode — Encode and decode URL components.
  • HTML Escape / Unescape — Escape and unescape HTML special characters and entities.
  • Number Base Converter — Convert integers between binary, octal, decimal and hex.
  • QR Code Generator — Generate a QR code from text or a URL; download as PNG or SVG.

See all Encode / Decode tools (31) · All tools