Vigenere Cipher

Encrypt or decrypt text using a keyword – a polyalphabetic step up from the simple Caesar shift.

Vigenere Cipher Encoder & Decoder

This tool shifts each letter of your text by an amount determined by a repeating keyword – forward to encrypt, backward to decrypt.
Type or paste your text in the "Input" field, enter a keyword, and the result appears in the "Output" field – live as you type.


Load an example

1. Cipher mode
2. Keyword
Letters only (A–Z). Non-letter characters are removed automatically.
3. Output options
Keeps uppercase and lowercase; off shifts everything to uppercase.
Off removes everything that is not a letter.
Ready to encrypt or decrypt text.


Overview

The Vigenere Cipher is a polyalphabetic substitution cipher that has been used in various forms since the 16th century. Unlike the Caesar cipher, which uses a single fixed shift for every letter, the Vigenere cipher applies a different shift to each letter based on a keyword. This makes the encoded text far harder to break with simple frequency analysis, because the same plaintext letter can appear as different ciphertext letters depending on its position in the message.

Here is how it works: the keyword is repeated over the plaintext so that each letter of the message has a corresponding keyword letter. Both letters are converted to numbers (A=0, B=1, ... Z=25), and the plaintext letter's value is shifted forward by the keyword letter's value. For example, if the plaintext letter is H (7) and the keyword letter is L (11), the result is S (18) because 7 + 11 = 18. To decrypt, the shift is simply reversed: subtract the keyword value instead of adding it.

Non-alphabetic characters like spaces, digits, punctuation are left untouched by default, so the structure of your message stays intact. The keyword itself should contain only letters; any numbers or symbols you type are stripped out automatically. Casing is preserved by default: an uppercase plaintext letter paired with a keyword letter produces an uppercase result, and lowercase stays lowercase.

This free tool runs entirely in your browser. Your text and keyword never leave your device, so you can safely use it for sensitive messages, classroom exercises, or puzzle-solving without worrying about where your data goes.


How to Use

1. Enter your text: Type or paste it into the Input textarea, click "Load an example", or upload a plain .txt file.

2. Enter a keyword: Type a word or phrase in the Keyword field. Only letters are used – everything else is removed automatically.

3. Choose Encrypt or Decrypt: Pick the cipher mode for the direction you want.

4. Read your result: The Output textarea updates automatically in Live mode, or press "Convert" to run it manually.

5. Save it: Use the Copy or Download icons to keep the result.


Features & Options

Encrypt / Decrypt: Encrypt shifts letters forward through the alphabet using the keyword; Decrypt reverses the shift. For example, encrypting HELLO with the keyword KEY produces RIJVS; decrypting RIJVS with the same keyword restores HELLO.

Keyword: Any string of letters. The keyword repeats cyclically to match the length of your text. A longer keyword produces a more complex pattern. Only letters A–Z are used; digits, spaces, and punctuation in the keyword are stripped automatically.

Preserve case: On by default, so Hello with keyword KEY produces Rijvs. Turn it off to shift everything to uppercase instead.

Keep spaces, digits & symbols: On by default, meaning only letters are shifted and everything else stays exactly as it was. Turn it off to strip punctuation and numbers from the output entirely.

Live mode: When on (the default), the Output updates as you type or change any option. Turn it off to convert only when you press the button.

Convert / Clear: "Convert" runs the cipher manually; "Clear Everything" resets all fields and options.

Copy / Download: Copy the encoded or decoded text to your clipboard, or save it as a .txt file.


Examples

Press a "Try it" button to load that example – it fills the Input, sets the keyword, and picks the right mode automatically.

Input (Encrypt, keyword: KEY)
HELLO WORLD
Output
RIJVS UYVJN
Input (Decrypt, keyword: KEY)
RIJVS UYVJN
Output
HELLO WORLD
Input (Encrypt, keyword: LEMON)
ATTACK AT DAWN
Output
LXFOPVEFRNHR
Input (Encrypt, keyword: SECRET)
Meet me at the corner
Output
Wtij ku fl ylv psbce
Input (Encrypt, keyword: CIPHER)
Send help now!
Output
Ibjpe mvfd zfc!
Input (Encrypt, keyword: BRAVO)
Flee at once, they are coming!
Output
Wxli js buef, iyen fmk jupip!

FAQs

FAQ 1: What is the difference between the Vigenere cipher and the Caesar cipher?
Answer: The Caesar cipher uses one fixed shift for every letter, so the same plaintext letter always becomes the same ciphertext letter. The Vigenere cipher uses a keyword to produce a different shift for each position, so the same plaintext letter can become multiple different ciphertext letters depending on where it appears. This makes Vigenere significantly harder to crack by simple frequency analysis.

FAQ 2: How do I choose a good keyword?
Answer: A strong keyword is long, random, and uses uncommon letter combinations. Short keywords like "KEY" repeat quickly and give attackers more patterns to work with. For casual use, any memorable word works fine. For serious encryption, use a long passphrase – but remember that the Vigenere cipher is a classical method and should not be relied on for real-world security.

FAQ 3: Does the keyword have to be a real word?
Answer: No. Any string of letters works – "XQZTML" encrypts just as well as "LEMON". The cipher only cares about the letter values, not whether they form a recognizable word. Random-letter keywords are actually harder to guess.

FAQ 4: What happens to spaces and punctuation?
Answer: By default, non-alphabetic characters are left untouched. Spaces, digits, commas, exclamation marks, and every other symbol pass through to the output unchanged. Only letters are shifted. You can turn off "Keep spaces, digits & symbols" to strip them from the output entirely.

FAQ 5: How do I decrypt a Vigenere-encoded message?
Answer: Switch to "Decrypt" mode and enter the same keyword that was used to encrypt. The cipher reverses the shift for each letter, restoring the original text. Without the keyword, breaking a Vigenere cipher requires advanced techniques like the Kasiski examination or frequency analysis of repeated key cycles.

FAQ 6: Is my text private?
Answer: Yes. The entire process runs in your browser with JavaScript. Your plaintext and keyword are never sent to or stored on any server.

TextToolz

The Ultimate Text Tools

TextToolz works seamlessly to let you convert and design your text. It is fast, reliable and secure. Trusted by thousands of users.