2 min read
How the Caesar and Vigenère Ciphers Work
Learn how classic substitution ciphers — Caesar, ROT13, Atbash, and Vigenère — encode text, and how to crack a Caesar cipher.
The Caesar Cipher and ROT13
The Caesar cipher, named for Julius Caesar, shifts every letter a fixed number of places down the alphabet. With a shift of 3, A becomes D, B becomes E, and so on, wrapping around so X, Y, Z become A, B, C. To decode, you shift back by the same amount.
ROT13 is simply a Caesar cipher with a shift of 13. Because the alphabet has 26 letters, shifting by 13 twice returns you to the start — so the same operation both encodes and decodes, which is why ROT13 is popular for hiding spoilers online.
Atbash and Vigenère
Atbash reverses the alphabet: A maps to Z, B to Y, C to X, and so on. It's its own inverse, so encoding and decoding are the same step. It's one of the oldest known ciphers, originally used for the Hebrew alphabet.
The Vigenère cipher is much stronger. Instead of one fixed shift, it uses a keyword, and each letter of the message is shifted by the corresponding letter of the repeated keyword. Because the shift changes from letter to letter, simple frequency analysis doesn't crack it the way it cracks a Caesar cipher.
Cracking a Caesar Cipher
A Caesar cipher has only 25 possible shifts, so if you intercept one without knowing the key, you can just try them all — this is called brute force. Decode the text with every shift from 1 to 25 and look for the version that reads as real words.
The cipher tool does this for you, listing all 25 decodings at once so you can spot the readable one instantly. It's a reminder that these classic ciphers are for puzzles and learning, not real security — modern encryption is what protects genuine secrets.
Frequently asked questions
How do I decode a Caesar cipher?
Shift each letter back by the same number used to encode it. If you don't know the shift, try all 25 possibilities and pick the one that reads as normal text — the cipher tool shows all 25 at once.
Is ROT13 secure?
No. ROT13 is a Caesar cipher with a fixed shift of 13 and provides no real security. It's used to lightly obscure text like spoilers, not to protect anything sensitive.
Why is the Vigenère cipher harder to break than Caesar?
Because it uses a repeating keyword, each letter can be shifted by a different amount, so the same plaintext letter doesn't always map to the same ciphertext letter. That defeats the simple frequency analysis that cracks a single-shift Caesar cipher.
Tools mentioned in this guide
Cipher Encoder & Decoder
Encode and decode Caesar, ROT13, Atbash, and Vigenère ciphers, with brute-force Caesar cracking.
Text Tools
Morse Code Translator
Translate text to Morse code and back — and play it as audio.
Text Tools
Binary Translator
Convert text to binary and back, plus a decimal/hex/binary/octal converter.
Developer Tools
Hash Generator
Generate SHA-1, SHA-256, SHA-384, and SHA-512 hashes from any text, live.
Developer Tools
Keep reading