Home › Developer Tools › Vigenère Cipher

Vigenère Cipher

Encrypt or decrypt text with the Vigenère cipher, its Autokey and Beaufort variants, and trace every letter on the tabula recta. No key? The built-in solver estimates it from the ciphertext, all in your browser.

Last updated:

Key used: LEMON (5 letters)

Key stream alignment

Each letter is shifted by the key letter under it (A = 0, B = 1 … Z = 25). Click a column to see it on the tabula recta.

Show tabula recta (Vigenère square)

Row = key letter, column = plaintext letter, cell = ciphertext letter.

No key? Crack the cipher

For standard Vigenère text in English, paste at least ~100 letters of ciphertext above. The tool estimates the key length (Kasiski examination + index of coincidence) and each key letter (frequency analysis).

Advertisement

How to use the Vigenère Cipher

  1. Choose Encrypt or Decrypt and the cipher variant (standard Vigenère is the default).
  2. Enter the key, for example LEMON. Only letters count; everything else in the key is ignored.
  3. Type or paste your text. The result updates instantly; press Encrypt text or Decrypt text to confirm, then Copy result.
  4. Study the alignment: click any letter column to see the matching row and column on the tabula recta.
  5. No key? Paste the ciphertext, switch to Decrypt and press Analyze ciphertext & find key, then Use this key on the best guess.

The Vigenère formula

Number the letters A = 0 to Z = 25. For the i-th letter of the message P and the key K of length m:

  • Encrypt: Ci = (Pi + Ki mod m) mod 26
  • Decrypt: Pi = (Ci − Ki mod m) mod 26
  • Beaufort: Ci = (Ki mod m − Pi) mod 26, the same in both directions

Worked example: ATTACK AT DAWN with key LEMON

PlaintextATTACKATDAWN
KeyLEMONLEMONLE
Shift114121413114121413114
CiphertextLXFOPVEFRNHR

Notice that the two A's at positions 1 and 4 become different letters (L and O). That is what makes Vigenère polyalphabetic and hides simple letter frequencies, unlike the Caesar cipher, which uses one shift for every letter.

How the key cracker works

  1. Index of coincidence (IoC): the probability that two random letters of a text are the same. English text scores about 0.066; uniformly random letters score 1/26 ≈ 0.038. When the ciphertext is split into columns using the correct key length, every column is a Caesar shift of English, so the average column IoC jumps up to the English value.
  2. Kasiski examination: repeated three-letter sequences in the ciphertext are often the same plaintext encrypted with the same part of the key. Their distances tend to be multiples of the key length, so the most common factors are reported as a second opinion.
  3. Chi-squared test: for each column the tool tries all 26 shifts and keeps the one whose letter counts are closest to normal English frequencies (E 12.7%, T 9.1%, A 8.2%, O 7.5% …). The 26 shifts give the key letters.

Short ciphertexts, non-English plaintext or keys almost as long as the message make statistics unreliable. A key as long as the message that is truly random and never reused is a one-time pad, which cannot be broken at all.

Frequently asked questions

How does the Vigenère cipher work?

Each letter of the message is shifted by the value of the key letter beneath it (A = 0, B = 1 … Z = 25), and the key repeats for the whole message. With key LEMON, the first letter moves 11 places, the second 4, the third 12 and so on, so ATTACKATDAWN becomes LXFOPVEFRNHR.

How do I decode a Vigenère cipher without the key?

Paste the ciphertext, select Decrypt and press Analyze ciphertext & find key. The tool finds the most likely key length with the index of coincidence and Kasiski examination, then solves each key letter as a Caesar shift with chi-squared frequency analysis. It works best on 100+ letters of English text with a key that is much shorter than the message.

Do spaces and punctuation use up key letters?

No. Like most textbook and puzzle implementations, only letters A–Z are encrypted and advance the key; spaces, digits, punctuation and accented letters pass through unchanged. Choose Letters only or Groups of 5 if you want to hide word boundaries.

What is the Autokey cipher?

Autokey, also described by Vigenère, starts with the keyword and then continues the key stream with the plaintext itself, so the key never repeats. With key QUEENLY, ATTACKATDAWN encrypts to QNXEPVYTWTWP. It defeats the Kasiski test, which is why the solver here targets the standard repeating-key cipher.

What is the Beaufort cipher?

Beaufort uses the same tabula recta but computes cipher = key − plaintext (mod 26) instead of adding. It is reciprocal: encrypting twice with the same key gives back the original, so encrypt and decrypt are the same operation.

Is the Vigenère cipher secure?

No. It was called le chiffre indéchiffrable for about 300 years, but it has been routinely broken since the 1860s. Use it for puzzles, escape rooms, geocaches and learning. For real secrets, use modern encryption such as AES.

Is my text sent anywhere?

No. Encryption, decryption and cracking run entirely in JavaScript in your browser; nothing is uploaded or logged.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

Caesar CipherEncode and decode Caesar shift ciphers and crack unknown shifts with a ranked brute force.Base64 Encoder DecoderEncode or decode Base64 text and files, and make data URIs.Hash GeneratorGenerate MD5, SHA-1, SHA-256 and SHA-512 hashes of text or files.Password GeneratorCreate strong passwords and passphrases.Bacon CipherEncode and decode Baconian A/B code (24 or 26 letters) and hide messages in letter case.Cryptogram PuzzleCrack a substitution cipher letter by letter to reveal a famous saying. Daily puzzle, hints, timer.Emoji CipherTurn secret messages into emoji with a shared key, then decode them back to text.Hidden Message EncoderHide a secret message inside normal text with invisible zero-width characters, and reveal it.MD5 Hash GeneratorGenerate MD5 hashes of text, lines or files and verify checksums.SHA-256 Hash GeneratorSHA-256 and HMAC-SHA256 hashes of text, lines or files, in hex or Base64.URL Encoder DecoderPercent-encode or decode URLs, query strings and form data.HTML Entity Encoder / DecoderEscape and unescape HTML entities, named or numeric.Bcrypt Hash Generator & CheckerCreate bcrypt password hashes and check a password against a hash.Binary TranslatorConvert text to binary, hex, octal and back.HMAC GeneratorGenerate and verify HMAC signatures with SHA-256, SHA-512, SHA-1 or MD5.CRC32 Checksum CalculatorCalculate CRC-32, CRC-32C, CRC-16 and Adler-32 checksums of text or large files.JWT DecoderDecode JSON Web Tokens, read the claims and expiry, and verify HS256 signatures.JWT GeneratorCreate and sign HS256, HS384 or HS512 JSON Web Tokens in your browser and verify them.Password Strength CheckerSee how strong a password really is, how long it takes to crack and how to improve it.Atbash CipherEncode and decode Atbash ciphers (A↔Z, B↔Y) in Latin or Hebrew, with a live letter mapping table.ASCII TableFull ASCII code chart 0–255 in decimal, hex, octal, binary and HTML, with search and copy.Unicode Character LookupFind Unicode characters by name or code point and copy them with UTF-8, HTML and code escapes.Punycode ConverterConvert international domain names, emails and URLs between Unicode and xn-- Punycode, in bulk.JSON Escape / UnescapeEscape text for a JSON string, unescape \n and \" back to text, or stringify a whole object.Binary to HexConvert binary to hex instantly with steps and signed mode.Hex to BinaryConvert hex to binary instantly with steps and signed mode.Binary CalculatorAdd, subtract, multiply, divide, AND, OR, XOR and shift binary numbers with decimal values.Hex CalculatorHexadecimal + − × ÷ and AND, OR, XOR, NOT, shifts with decimal and binary equivalents.Base32 Encoder / DecoderEncode and decode Base32 (RFC 4648), Base32hex, Crockford and z-base-32 from text, hex or files.Base58 Encoder / DecoderEncode and decode Base58 and Base58Check (Bitcoin alphabet) from text or hex, with checksum verification.Unicode Escape / UnescapeConvert text to \uXXXX, \u{...}, \x, &#...; or CSS escapes and decode them back.File Hash CheckerGet MD5, SHA-1, SHA-256 and SHA-512 checksums of files and verify them against a hash.TOTP GeneratorGenerate 2FA one-time codes from a secret key, create otpauth QR codes and verify codes.RSA Key GeneratorGenerate 2048, 3072 or 4096-bit RSA key pairs as PEM, PKCS#1, JWK or OpenSSH, locally.SSL Certificate DecoderDecode PEM SSL/X.509 certificates: subject, issuer, expiry, SANs, key and fingerprints.Argon2 Hash GeneratorHash passwords with Argon2id, Argon2i or Argon2d and verify them against an encoded hash.Base64 to PDFDecode a Base64 string to a PDF with preview and download, or encode a PDF to Base64.Bitwise CalculatorCalculate AND, OR, XOR, NOT and bit shifts at 8–64 bits with a bit grid and all bases.PGP Encrypt / DecryptEncrypt, decrypt, sign and verify PGP messages with your armored keys, entirely offline.PGP Key GeneratorGenerate an OpenPGP key pair (Curve25519, NIST ECC or RSA) with passphrase and expiry, offline.Quoted-Printable Encoder / DecoderEncode or decode quoted-printable email text (MIME) with UTF-8 and 76-character soft line breaks.Self-Signed Certificate GeneratorCreate a self-signed SSL certificate and key for localhost or dev servers, as PEM or PFX.SHA-1 Hash GeneratorSHA-1 and HMAC-SHA1 of text or files in hex or Base64, plus Git blob hashes and verify.SHA-512 Hash GeneratorSHA-512 and SHA-384 hashes of text or files in hex or Base64, HMAC and hash verification.SRI Hash GeneratorCreate Subresource Integrity hashes (sha256/384/512) and ready <script> or <link> tags.SSH Key GeneratorGenerate Ed25519 or RSA SSH key pairs in your browser: OpenSSH public key plus private key.String Escape / UnescapeEscape or unescape strings for JavaScript, Java, C#, Python, C, SQL, regex, CSV and shell.UTF-8 Encoder / DecoderConvert text to UTF-8 bytes in hex, decimal, binary, \x or % and decode bytes back to text.UUID Decoder & ValidatorDecode any UUID: version, variant, v1/v6/v7 timestamp and MAC node, plus bulk validation.Base64 to FileDecode Base64 or a data URI to a downloadable file; detects the real file type and previews it.File Encryption ToolEncrypt and decrypt any file with a password using AES-256-GCM, entirely in your browser.Passphrase GeneratorMake strong, memorable diceware passphrases from a 7,776-word list, with entropy in bits.CSR DecoderDecode a PEM certificate signing request: subject, SANs, key size, signature and CA readiness checks.Enigma Machine SimulatorEncrypt and decrypt with a virtual Enigma I, M3 or M4: rotors, rings, plugboard and lampboard.Hex Opacity CalculatorConvert opacity percent to a 2-digit HEX alpha code and full #RRGGBBAA color, with a 0-100% table.Pwned Password CheckerCheck if a password appeared in data breaches; only 5 characters of its SHA-1 hash are sent.RSA Encryption ToolEncrypt text with an RSA public key and decrypt it with the private key using RSA-OAEP in your browser.SAML DecoderDecode SAMLRequest and SAMLResponse messages to readable XML, attributes and validity times.SSL Certificate ConverterConvert SSL certificates and keys between PEM, DER, PFX/P12 and P7B in your browser.Checksum CalculatorCompute 8-bit sum, two's complement LRC, XOR/BCC, NMEA, Fletcher and Internet checksums of bytes.PBKDF2 Hash GeneratorDerive PBKDF2 keys from a password, salt and iteration count with SHA-1, SHA-256 or SHA-512.Protobuf DecoderDecode raw Protocol Buffers hex or Base64 without a schema, or add a .proto for field names.XML Escape / UnescapeEscape & < > " ' for XML text and attributes, unescape entities back, or wrap text in CDATA.Binary Search Tree VisualizerInsert, delete and find in BST, AVL and red-black trees with animated rotations and traversals.CSR GeneratorCreate a certificate signing request (CSR) and private key with SANs, RSA or ECDSA, in your browser.MongoDB ObjectId to TimestampDecode a MongoDB ObjectId to its creation date, or build ObjectIds from dates for range queries.
See all 65 Encoders, Hashes & Crypto →