Encode and decode a Caesar cipher

Shift letters by any number to hide or read a message. Nothing leaves your browser.

How it works

  1. Type or paste your message
  2. Set the shift and choose encode or decode
  3. Copy the result, or show all 25 shifts

What the shift does

A Caesar cipher moves every letter a fixed number of places along the alphabet and wraps from Z back to A. With a shift of 3, A becomes D, B becomes E and X becomes A. The shift can be any whole number from -25 to 25. A number outside that range is cut to the nearest end, so 99 is used as 25. A shift of 0 leaves the text as it is. A negative shift moves backwards, which is the same as a forward shift of 26 minus that number. Decode uses the opposite of the shift you set, so decoding with 3 undoes encoding with 3. Case is kept, so Hello with shift 3 gives Khoor.

What is and is not shifted

Only the 26 plain letters A to Z and a to z move. Everything else is copied unchanged: spaces, punctuation, line breaks, emoji, accented letters such as é and letters of other alphabets such as Greek or Chinese characters. The tool does not fold accents here, because the cipher is defined on the 26-letter alphabet. Digits stay as they are unless you turn on the option to shift digits. Then each digit from 0 to 9 moves by the shift modulo 10, so 7 with a shift of 3 becomes 0, and 5 with a shift of 13 becomes 8. Both settings apply the same way when decoding, so a round trip always returns your original text.

Show all 25 shifts

If you have a message and do not know the key, turn on Show all 25 shifts. The table lists shifts 1 to 25. Each row moves every letter back by that many places, which is the decoding of a message that was encoded with that shift. Each row shows the first 80 characters, with line breaks turned into spaces and three dots added when the text is longer. Scan down the list for the row that reads as normal words. That row number is the key. The table does not guess for you. With a short or unusual message more than one row can look plausible.

A toy cipher, not security

The Caesar cipher has only 25 useful keys, so anyone can try them all in seconds, as the table shows. Do not use it to protect a password, a note or anything private. It suits puzzles, escape rooms, geocaching clues and lessons about how ciphers work. Up to 200,000 characters are accepted. The work runs in your browser, the message is not uploaded and only your settings are saved on this device.

Frequently asked questions

How do I decode a Caesar cipher if I do not know the shift?

Turn on Show all 25 shifts and look for the row that reads as normal words. The shift number in that row is the key. A longer message, such as a full sentence, makes the right row obvious.

What is the difference between Caesar cipher and ROT13?

ROT13 is a Caesar cipher with a fixed shift of 13. Because the alphabet has 26 letters, applying it twice gives back the original, so the same step encodes and decodes. This page can do any shift, and the ROT13 page opens with 13 set.

Does it shift numbers and accented letters?

Digits only move if you turn on the digit option, by the shift modulo 10. Accented letters such as é and letters from other alphabets are never changed. Only A to Z and a to z move.

Is a Caesar cipher secure?

No. It has 25 possible keys and can be broken by hand in minutes. Use it for games and teaching, never for anything that has to stay private.

Why does a shift of -3 equal 23?

The alphabet wraps after 26 letters, so moving 3 back lands on the same letter as moving 23 forward. For example, D with shift -3 gives A, and D with shift 23 also gives A.