Caesar Cipher

Encode and decode with Caesar cipher (shift).

Security

About Caesar Cipher

The Caesar cipher is a substitution cipher where each letter in the plaintext is replaced by a letter a fixed number of positions down the alphabet. For example, with a shift of 3, "A" becomes "D", "B" becomes "E", and so on. The alphabet wraps around, so "X" with shift 3 becomes "A". To decrypt, simply apply the reverse shift (or equivalently, shift by 26 minus the encryption shift). Numbers, symbols, and spaces are left unchanged. Because there are only 26 possible shifts, the cipher can be broken trivially by trying all possibilities — a technique called brute-force attack. Despite its weakness, the Caesar cipher is widely taught as an introduction to cryptography and is a fun tool for puzzles and games. For real encryption needs, use modern algorithms like AES.

How to Use Caesar Cipher

  1. Enter or paste the Text you want to encrypt or decrypt.
  2. Set the Shift value (0–25). A shift of 13 is also known as ROT13.
  3. The Result updates instantly showing the shifted text.
  4. To decrypt, use the same shift value in the opposite direction (or shift by 26 minus the original shift).

Key Features

  • Encrypt and decrypt text with any shift from 0 to 25
  • Preserves case — uppercase stays uppercase, lowercase stays lowercase
  • Non-alphabetic characters (numbers, punctuation, spaces) are left unchanged
  • Instant real-time results as you type or adjust the shift
  • Browser-based processing — no data leaves your device
  • Educational companion to ROT13 Decoder (Caesar cipher with shift 13)

When to Use This Tool

  • Learning the basics of cryptography and substitution ciphers
  • Creating simple puzzles, escape-room clues, or classroom exercises
  • Decoding Caesar-cipher-encoded messages from challenges or CTF competitions
  • Demonstrating why simple ciphers are insecure compared to modern encryption

Technical Details

The tool processes each character individually: for letters A–Z and a–z, it converts to a 0–25 index, adds the shift modulo 26, and converts back. All other characters pass through unchanged. The key space is only 26 values, making brute-force trivial — a computer can try all 26 shifts in microseconds. The shift of 13 (ROT13) is special because applying it twice returns the original text, since 13 + 13 = 26. The implementation uses JavaScript character codes and runs entirely in the browser with no external dependencies.

Conclusion

The Caesar Cipher tool is a fun and educational way to explore the foundations of cryptography. While not suitable for real security, it provides instant text shifting with full privacy — perfect for learning, puzzles, and simple encoding tasks in your browser.

Frequently Asked Questions

What is a Caesar cipher?
Each letter is shifted by a fixed number (e.g., shift 3: A→D, B→E). Decoding uses the same shift in reverse. It is easy to break by trying all 26 shifts, so it is used for fun and education rather than real security.
Does it affect numbers or symbols?
No. Only A–Z and a–z are shifted. Numbers, punctuation, spaces, and special characters remain unchanged.
Is my text sent to a server?
No. Everything runs in your browser. Your text never leaves your device.
What is ROT13?
ROT13 is a Caesar cipher with a shift of 13. Since the English alphabet has 26 letters, applying ROT13 twice returns the original text. It is commonly used to obscure spoilers or puzzle answers online. Try our dedicated ROT13 Decoder tool.