Caesar Cipher Online

Instantly encrypt or decrypt text with the classic shift cipher. Real‑time, client‑side, with brute‑force analysis.

Hello, World! Pangram Caesar cipher ROT13
Result
Khoor, Zruog!
? Brute‑force all shifts

Click below to see all possible rotations of your current message.

Understanding the Caesar Cipher

The Caesar cipher, named after Julius Caesar who used it in his private correspondence, is one of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plaintext is shifted a fixed number of places down the alphabet.

Mathematical representation:

Eₙ(x) = (x + n) mod 26    (encryption)

Dₙ(x) = (x - n) mod 26    (decryption)

where x is the numeric position of the letter (A=0, B=1, ..., Z=25) and n is the shift.

Historical Background

Julius Caesar used this cipher with a shift of 3 to communicate with his generals. At that time, it was considered secure because most enemies could not read Latin, let alone suspect an additional scrambling. Today it offers no security but remains an excellent educational tool.

ROT13 – A special case

ROT13 is a Caesar cipher with shift 13. It has the property that applying it twice returns the original text (because 13+13=26). It is often used in online forums to hide spoilers or offensive text.

How to use this tool

  • Type or paste your message in the Message box.
  • Choose the shift (1 to 25) using the slider or number input.
  • Select Encrypt or Decrypt mode.
  • The result updates instantly. Use the buttons to copy or swap.
  • Click Show all shifts to perform a brute‑force analysis – useful if you have an unknown shift.

Frequently Asked Questions

No, the Caesar cipher is extremely weak. With only 25 possible keys, it can be broken by brute force in seconds. It is used only for learning or hiding text from casual viewers.

When enabled, spaces, digits, punctuation, and special characters are left unchanged. Only letters A–Z and a–z are shifted. If disabled, those characters are removed from the output.

Shift 0 or 26 would return the original text (no encryption). For practical purposes, we limit the shift to 1–25.