Developer tools

Caesar Cipher

Caesar Cipher Encoder and Decoder

Encode and decode a Caesar cipher with any shift, or crack it by trying all 25.

About this tool

About Caesar Cipher

The Caesar cipher shifts every letter a fixed number of places along the alphabet. Julius Caesar is said to have used a shift of 3, turning A into D and HELLO into KHOOR, and it is still the first cipher taught in classrooms, escape rooms and puzzle hunts. Set the Shift from 1 to 25 and choose Encode to shift forward or Decode to shift back; capitals stay capitals, and punctuation, spaces and accented letters are kept as they are. Tick Shift digits too to rotate 0–9 by the same amount. If you have a message but not the key, tick Try all 25 shifts: every possible decoding is listed and the one whose letter frequencies are closest to English is highlighted, which usually finds the answer in one look for any sentence of reasonable length. Shift 13 is ROT13, and the same page also handles ROT18 and ROT47. Nothing you type is sent anywhere.

Built and maintained by Abhi JainUpdated

How to Use the Caesar Cipher

  1. 1

    Enter the message

    Type or paste the text into the left pane.

  2. 2

    Set Shift and Direction

    Choose the Shift (3 is the classic) and pick Encode or Decode.

  3. 3

    Crack an unknown shift

    Tick Try all 25 shifts to see every decoding, with the most English-looking one highlighted, then copy the answer.

Caesar Cipher: questions and answers

How does the Caesar cipher work?

Each letter is replaced by the letter a fixed number of positions later in the alphabet, wrapping from Z back to A. With a shift of 3, A becomes D, X becomes A, and HELLO becomes KHOOR. Decoding shifts back by the same amount.

How do I decode a Caesar cipher without the key?

There are only 25 possible shifts, so try them all. Tick Try all 25 shifts and the tool lists every decoding, highlighting the one whose letter frequencies best match English.

What is the formula for the Caesar cipher?

With letters numbered A = 0 to Z = 25, encryption is E(x) = (x + n) mod 26 and decryption is D(x) = (x − n) mod 26, where n is the shift.

Is ROT13 a Caesar cipher?

Yes, it is the Caesar cipher with shift 13. Because 13 is half of 26, encoding twice returns the original, so ROT13 needs no separate decode step.

Is the Caesar cipher secure?

No. With only 25 keys it can be broken by hand in minutes. It is useful for puzzles and teaching, not for protecting anything.

More ROT13 Encoder presets