Caesar Cipher
Caesar cipher encoder/decoder
About This Tool
The Caesar Cipher Decoder encrypts and decrypts messages using the classic Caesar cipher (shift cipher). Named after Julius Caesar, this simple substitution cipher shifts each letter by a fixed number of positions in the alphabet.
Enter text and a shift value to encode or decode. Use brute force mode to try all 26 possible shifts when you don't know the key.
How It Works
How to Use This Tool
Using the Caesar cipher is simple:
- Enter text - Type the message to encode or decode.
- Set shift value - Choose how many positions to shift (1-25).
- Choose direction - Encode (shift forward) or decode (shift backward).
- View result - See the transformed text instantly.
Formula
Caesar Cipher Formula
Encryption: E(x) = (x + n) mod 26
Decryption: D(x) = (x - n) mod 26
Where x = letter position (A=0, B=1, ... Z=25) and n = shift value (key).
Example (shift 3): A becomes D, B becomes E, C becomes F, ... X becomes A, Y becomes B, Z becomes C.
ROT13 = Caesar cipher with shift 13 (encoding and decoding are the same).
Examples
Examples
Example 1: Classic Caesar (Shift 3)
- Plain: "HELLO WORLD"
- Cipher: "KHOOR ZRUOG"
Example 2: ROT13
- Plain: "SECRET MESSAGE"
- Cipher: "FRPERG ZRFFNTR"
- Note: Apply ROT13 again to decode
Example 3: Brute Force
- Cipher: "KHOOR"
- Shift 1: JGNNQ
- Shift 2: IFMMP
- Shift 3: HELLO - Found!
Frequently Asked Questions
How does the Caesar cipher work?
The Caesar cipher shifts each letter by a fixed number of positions in the alphabet. With shift 3: A→D, B→E, C→F. "HELLO" becomes "KHOOR". To decrypt, shift in the opposite direction. The tool supports any shift value from 1 to 25.
How do I crack a Caesar cipher without knowing the shift?
Try all 25 possible shifts (brute force). Or use frequency analysis: E is the most common English letter (12.7%), followed by T (9.1%) and A (8.2%). Find the most frequent letter in the ciphertext and assume it maps to E.
What shift did Julius Caesar use?
Julius Caesar reportedly used a shift of 3 (A→D). This was effective in ancient times when most people were illiterate. Today it provides zero security but is useful for teaching cryptography fundamentals and simple text obfuscation.
What is ROT13 and how does it relate to the Caesar cipher?
ROT13 is a Caesar cipher with shift 13. Since the English alphabet has 26 letters, applying ROT13 twice returns the original text. "HELLO" → "URYYB" → "HELLO". ROT13 is used online to hide spoilers and puzzle answers.
How is the Caesar cipher different from modern encryption?
Caesar cipher uses a single shift value (25 possible keys). Modern AES-256 has 2^256 possible keys. Caesar is easily broken by brute force or frequency analysis. Modern ciphers use complex mathematical operations that resist all known attacks.
Disclaimer
Disclaimer: This tool is provided for educational and entertainment purposes only. The Caesar cipher is not secure and should never be used to protect sensitive information. All processing happens in your browser; no data is transmitted to any server. For actual data security needs, use modern encryption standards such as AES-256.
💡 Tips
Tips
- ROT13 (shift 13) is self-inverse: encode = decode
- Use brute force when you don't know the shift
- Numbers and special characters are not shifted
- Case is preserved (A becomes D, a becomes d)
- This cipher is easily broken - don't use for real security