BYTETOOLS

How to Encode and Decode a Vigenère Cipher Online

To use the Vigenère cipher, choose Encode or Decode, enter a keyword made of letters, and type your message — the tool shifts each letter by the matching keyword letter and shows the repeating key aligned beneath your text. To read an encoded message back, switch to Decode and enter the exact same keyword. Everything is computed locally in your browser, so your message and key are never uploaded.

Unlike a Caesar cipher's single fixed shift, Vigenère uses a keyword to vary the shift letter by letter, which is why it stayed unbroken for centuries. Here is how to run it end to end.

Step-by-step: encoding a message

  1. Select Encode. This tells the tool to add the keyword shifts to your plaintext.
  2. Enter a keyword of letters only, for example LEMON. Longer, less predictable keywords are stronger.
  3. Type or paste your message. The output updates as you go.
  4. Read the key-alignment view below, which lays the repeating keyword under each letter so you can see exactly which shift applied where.
  5. Copy the ciphertext to your clipboard to share it.

Step-by-step: decoding a message

Decoding mirrors the process. Switch the mode to Decode, enter the identical keyword used to encrypt, and paste the ciphertext. The tool subtracts each keyword shift to recover the original letters. Without the correct keyword the message cannot be read, which is the whole point of the cipher.

A worked example

RowValue
PlaintextATTACKATDAWN
Keyword (repeated)LEMONLEMONLE
CiphertextLXFOPVEFRNHR

Notice how the two As in the plaintext do not become the same ciphertext letter — because a different keyword letter sits beneath each, one A shifts by L and another by E. That varying shift is what makes Vigenère a polyalphabetic cipher, and it is exactly what the key-alignment view is designed to reveal.

How spaces and punctuation are handled

This tool leaves spaces, digits and punctuation unchanged and does not advance the keyword on them, so the key stays aligned only to the letters. Case is preserved too. Because non-letters do not consume a keyword position, encoding and decoding remain perfectly reversible — encode then decode with the same key and you get your original text back exactly.

Private and in your browser

All computation runs locally in your browser with JavaScript. Your message and keyword never leave your device, are never logged, and the tool keeps working offline once loaded. That makes it safe for classroom demos, puzzle-making and experimentation without trusting a server.

Try the Vigenère Cipher Encoder & Decoder — free and 100% in your browser.

FAQ

What keyword should I use to start?

Any word of letters works, but a longer keyword with no obvious repetition is stronger because the shift pattern repeats less often. Avoid a single letter, which collapses the cipher to a plain Caesar shift.

Why do identical letters encode differently?

Each position uses the keyword letter above it, and the keyword repeats across the message. So the same plaintext letter at two positions is shifted by different amounts, producing different ciphertext letters — the hallmark of a polyalphabetic cipher.

I decoded and got gibberish — what went wrong?

Almost always a keyword mismatch. Confirm you are using the exact keyword that encrypted the message, with the same spelling, and that you are in Decode mode. A single wrong letter throws off every shift.

Does the tool change my punctuation?

No. Spaces, digits and punctuation pass through unchanged and do not advance the key, so only the letters are transformed and the process stays fully reversible.

Related free tools

Built by ByteVancer

ByteTools is a free product of ByteVancer, a software and web development studio building web apps, SaaS and custom software. If you need real cryptography built into a product rather than a teaching cipher, explore how ByteVancer can help.