Caesar Cipher Encoder and Decoder

Encode and decode text with the Caesar cipher. Pick any shift, switch between encode and decode, and keep case, spaces, and punctuation intact.

Independently verified for accuracy

Calculator by Toolsloft ↗

Encode or decode text with the Caesar cipher, the shift substitution used since Roman times. Choose how many places to move each letter and whether you are scrambling a message or reading one back. It is a classic for puzzles, escape rooms, and teaching how substitution ciphers work.

How this is calculated

Each letter is shifted by the chosen amount through the 26-letter alphabet and wraps around at the ends, following the standard Caesar cipher definition. Decoding applies the same shift in reverse. The shift is taken modulo 26, letter case is preserved, and any character that is not an A to Z letter is left unchanged.

How to use

  1. Type or paste your text into the box.
  2. Set the shift amount and choose encode or decode.
  3. Copy the result from the output box.

Examples

  • Encode (shift 3): Hello, World! → Khoor, Zruog!
  • Decode (shift 3): Khoor, Zruog! → Hello, World!

FAQ

What shift does the classic Caesar cipher use?
Julius Caesar reportedly used a shift of 3, so A becomes D. This tool lets you set any shift from 0 to 25, and larger numbers wrap around because the alphabet has 26 letters.
How do I decode a message?
Switch the mode to decode and enter the same shift that was used to encode it. Decoding moves each letter back by that many places, which returns the original text.
Are numbers and punctuation changed?
No. Only the letters A to Z are shifted. Digits, spaces, and punctuation are left exactly as you typed them, and upper and lower case are both preserved.

Embed this calculator

Add this free calculator to your own site. Copy the code and paste it where you want it to appear.