Classic Ciphers — Vigenère, Atbash, ROT47, Rail Fence & Affine
Encode and decode classic ciphers online: Vigenère, Beaufort, Atbash, ROT47, rail fence (zigzag) and affine. For puzzles, escape rooms and learning cryptography.
🔒 Runs entirely in your browser — nothing is uploadedSix classic ciphers in one place
Before computers, secret messages relied on pen-and-paper ciphers. They are still popular today for puzzles, geocaching, escape rooms, treasure hunts, CTF challenges and teaching the basics of cryptography. This tool encodes and decodes six of the best-known ones and updates the result as you type, so you can experiment with keys and see how each method transforms the text.
Vigenère shifts each letter by a different amount taken from a repeating keyword. For centuries it was called "le chiffre indéchiffrable" because simple frequency analysis does not break it directly. Beaufort is a close relative that subtracts the plaintext from the key instead of adding; it is reciprocal, so the same operation encrypts and decrypts. Atbash, originally used for the Hebrew alphabet, mirrors the alphabet so A becomes Z and B becomes Y. ROT47 rotates every printable ASCII character by 47 places, scrambling digits and punctuation as well as letters.
Rail fence is a transposition cipher: instead of replacing letters it rearranges them, writing the message in a zigzag across several "rails" and reading each rail in turn. Affine maps each letter x to (a·x + b) mod 26; the multiplier a must be coprime with 26, which is why the selector only offers valid values.
Tips for puzzles and learning
Letter case is preserved and characters outside A–Z (except in ROT47 and rail fence) are left in place, which keeps word boundaries visible. In Vigenère and Beaufort, only letters advance the key. Use "Use result as input" to check that a message decodes back to the original. If you are trying to crack an unknown cipher, the Letter Frequency tool shows the index of coincidence, which helps tell a Vigenère cipher from a simple substitution.
These ciphers are fun but not secure. Everything runs in your browser and nothing is uploaded.
How to use
- Choose a cipherSelect Vigenère, Beaufort, Atbash, ROT47, rail fence or affine.
- Set the keyEnter a keyword, the number of rails, or the a and b values, depending on the cipher.
- Encode or decodeType your message and pick the direction; self-inverse ciphers need no direction.
- Copy the resultCopy it, or feed it back in to check that it decodes.