Home / Encoding tools / Caesar cipher

Caesar Cipher

Encrypt or decrypt a message by shifting every letter along the alphabet. Pick a shift from 1 to 25 and see the result as you type.

What is the Caesar cipher?

The Caesar cipher is one of the oldest and simplest ciphers. Each letter is replaced by the letter a fixed number of places further along the alphabet. With a shift of 3, A becomes D, B becomes E and Z wraps around to C. It is named after Julius Caesar, who is said to have used a shift of 3 to protect his messages.

HELLO with a shift of 3 becomes KHOOR

How to use the tool

  1. Type or paste your message.
  2. Choose Encrypt to shift forward, or Decrypt to shift back.
  3. Set the shift with the number box or the slider.

The mapping table shows exactly which letter turns into which, so you can also work by hand.

The details

  • Only the letters A to Z change. Numbers, spaces and punctuation stay as they are.
  • Capital and lowercase letters keep their case.
  • A shift of 26 returns the original text, so useful shifts are 1 to 25.
  • To decrypt, shift back by the same amount, or shift forward by 26 minus the key.

How secure is it?

Not at all by modern standards. There are only 25 possible keys, so anyone can try them all in seconds. It is best for puzzles, games and learning how ciphers work.

Do not know the shift? Use the Caesar cipher decoder, which tries all 25. To build a puzzle, see the generator. A shift of 13 is special, so see ROT13. The Caesar cipher guide covers the history and how it is broken.

Frequently asked questions

How do I decrypt a Caesar cipher?

Choose Decrypt and enter the shift that was used. If you do not know it, the decoder page tries every shift for you.

What shift did Julius Caesar use?

Historical accounts say he used a shift of 3.

Does it change numbers and punctuation?

No. Only letters are shifted. Everything else stays the same.

Why is a shift of 26 the same as no shift?

The alphabet has 26 letters, so shifting by 26 brings every letter back to where it started.