Caesar Cipher

Encrypt, decrypt, or brute-force a Caesar or ROT13 cipher.

The Caesar cipher shifts each letter a fixed number of places along the alphabet, as Julius Caesar reputedly did. This tool encrypts, decrypts, does ROT13, and can try all 25 shifts at once to crack a message. Good for puzzles and teaching, and no use at all for real secrets.

How to use it

  1. Type your text.
  2. Choose encrypt, decrypt or try all shifts.
  3. Set the shift, such as 3 or 13.
  4. Copy the result.

When it helps

  • Solving puzzles and escape-room clues.
  • Teaching basic cryptography.
  • Hiding spoilers with ROT13.
  • Decoding a message with an unknown shift.

Good to know

  • ROT13 is a shift of 13, so applying it twice returns the original.
  • Only letters change; numbers and punctuation stay.
  • With just 25 possible shifts, it's trivially breakable.

How the shift works

Each letter moves forward a fixed number of places, wrapping from Z back to A. With a shift of 3, A becomes D and X becomes A. Decryption shifts backwards. Only letters change, and capitals stay capitals.

ROT13 is the special case of shift 13, which is its own inverse, since the alphabet has 26 letters.

Worked example: cracking a message

You find the message KHOOR ZRUOG. Choose Try all shifts and scan the 25 lines. At shift 3 it reads HELLO WORLD. With only 25 possibilities, brute force is instant.

Frequency analysis gives a faster way for longer text: the most common letter likely stands for E.

History and use

Julius Caesar reportedly used a shift of three to send military messages, and his nephew Augustus used a shift of one. Today ROT13 is used online to hide spoilers and punchlines so that readers must choose to decode them.

It's an excellent first cipher for learning concepts such as keys and brute force.

Going further

Stronger classical ciphers include the Vigenère cipher, which uses a keyword, and the substitution cipher with a scrambled alphabet. Modern encryption such as AES is of a different order of strength.

Try the Vigenère Cipher tool next to see how a changing shift makes frequency analysis harder.

Making puzzles with it

Use a Caesar cipher to make a treasure hunt or an escape room: hide a clue as shifted text and give players a cipher wheel or the shift number on a separate clue. Choose a shift that isn't 13, since many people know ROT13.

Add punctuation and spaces unchanged, so words stay recognisable and puzzles are solvable.

Cipher wheel and mental tricks

A cipher wheel is two concentric alphabets that rotate against each other, useful for hand encoding. For ROT13, memorise that A to M map onto N to Z. With a shift of 1, you can often decode in your head by moving each letter back by one.

Try encoding your own name with several shifts to see the patterns.

Questions

How do I crack an unknown shift?

Use try all shifts and look for the readable line.

Does it keep capitals?

Yes.