Vigenère Cipher
Encode and decode Vigenère cipher text with any keyword, including the autokey variant and a live key stream.
Puzzle toy — no real security. Runs locally in your browser.
Vigenère square (tabula recta)
Row = key letter, column = message letter, cell = ciphertext letter. Encoding
A with key L reads row L, column A →
L.
| Key letter | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| A | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z |
| B | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A |
| C | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B |
| D | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C |
| E | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D |
| F | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E |
| G | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E | F |
| H | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E | F | G |
| I | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E | F | G | H |
| J | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E | F | G | H | I |
| K | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E | F | G | H | I | J |
| L | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E | F | G | H | I | J | K |
| M | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L |
| N | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L | M |
| O | O | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L | M | N |
| P | P | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O |
| Q | Q | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P |
| R | R | S | T | U | V | W | X | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q |
| S | S | T | U | V | W | X | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R |
| T | T | U | V | W | X | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S |
| U | U | V | W | X | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T |
| V | V | W | X | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U |
| W | W | X | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V |
| X | X | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W |
| Y | Y | Z | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X |
| Z | Z | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y |
How it works
The Vigenère cipher is a polyalphabetic substitution cipher: each letter of the message is
shifted by the letter of a repeating keyword, where A shifts by 0,
B by 1 and so on up to Z by 25. Encoding uses
C = (P + K) mod 26 and decoding uses P = (C − K + 26) mod 26.
That is why the classic textbook example ATTACKATDAWN with the key
LEMON becomes LXFOPVEFRNHR. Spaces, digits and punctuation are
passed through untouched and do not consume a key letter, so the key stream stays
aligned to the letters alone.
Switch Key mode to Autokey for Vigenère's own stronger variant,
where the keyword is used as a primer and the message itself supplies the rest of the key
stream — ATTACKATDAWN with the primer QUEENLY encodes to
QNXEPVYTWTWP. Choose Groups of 5 letters to get the traditional
telegraph-style blocks. Only the 26 letters A–Z are enciphered; accents and other scripts
pass through unchanged. Remember that this is a puzzle cipher — a keyword shorter than the
message leaks a repeating pattern, and modern cryptanalysis breaks it trivially.
Puzzle & teaching toy. The Vigenère cipher is a 16th-century classical cipher and offers no real security — it is broken in seconds by Kasiski examination or index-of-coincidence analysis. Use it for puzzles, escape rooms and CTFs, never for anything you need to keep private. Everything runs locally in your browser; nothing you type is uploaded.
Frequently asked questions
How does the Vigenère cipher work?
Each letter of your message is shifted by the matching letter of a repeating keyword, where A shifts by 0, B by 1 and so on to Z by 25. Encoding is C = (P + K) mod 26 and decoding is P = (C − K + 26) mod 26. That is why ATTACKATDAWN with the key LEMON becomes LXFOPVEFRNHR. Spaces, digits and punctuation pass through untouched and do not consume a key letter.
What is the difference between a repeating key and autokey?
A repeating key simply cycles the keyword over and over, which leaks a periodic pattern that Kasiski examination can spot. In Vigenère's own autokey variant the keyword is only a primer: after it runs out, the message itself supplies the rest of the key stream, so no pattern repeats. With the primer QUEENLY, ATTACKATDAWN encodes to QNXEPVYTWTWP. Pick the mode with the Key mode dropdown.
Is the Vigenère cipher secure?
No. It is a 16th-century puzzle and teaching cipher with no real security — index-of-coincidence and Kasiski analysis recover the key length and then the key in seconds, even by hand. Use it for puzzles, escape rooms, CTFs and classroom demos, never to protect anything private. This tool runs entirely in your browser, so nothing you type is uploaded, but the cipher itself is a toy.