Caesar Cipher

Shift every letter in your message by 1 to 25 places to encode or decode a secret note. Numbers, spaces, and punctuation are preserved exactly.

3
Presets:

What is the Caesar Cipher?

The Caesar cipher is one of the oldest and simplest forms of encryption, named after Julius Caesar who used it to send private messages to his generals. The cipher works by shifting each letter of the alphabet by a fixed number of positions. With a shift of 3 (Caesar's traditional choice), the letter A becomes D, B becomes E, and so on. When you reach the end of the alphabet, you wrap around to the beginning — so X becomes A with a shift of 3. Decoding works the same way in reverse: you shift each letter backward by the same amount to recover the original message.

How to Use This Caesar Cipher Tool

  1. Pick a mode — choose Encode to scramble your message, or Decode to unscramble one you received.
  2. Set the shift amount — drag the slider or type a number from 1 to 25. Use a preset like ROT13 or the classical Caesar shift of 3.
  3. Type your message — paste or type into the message box. Letters will be shifted; numbers, spaces, and punctuation pass through unchanged.
  4. Click Convert — the result appears instantly in the output panel, where you can copy or download it.

Example

With a shift of 3, the message:

Hello, World!

encodes to:

Khoor, Zruog!

Notice how the comma, space, and exclamation mark are unchanged, and the original capitalization is preserved.

What is ROT13?

ROT13 is a special case of the Caesar cipher where the shift is exactly 13. Because the English alphabet has 26 letters, applying ROT13 twice returns the original text — encoding and decoding are the same operation. ROT13 has been used for decades on Usenet and forums to hide spoilers, punchlines, or potentially offensive text without truly hiding it from anyone willing to decode.

Common Use Cases

Frequently Asked Questions

Is the Caesar cipher secure?

No. The Caesar cipher has only 25 possible keys, so anyone can brute-force every shift in seconds. It is also vulnerable to letter-frequency analysis. Never use it to protect real secrets — use modern encryption like AES via a trusted password manager or messenger.

Why does the tool preserve case and punctuation?

Preserving case and non-letter characters is the standard behavior for the Caesar cipher and makes the encoded output much easier to work with in puzzles and word games. If you want fully uniform output, you can lowercase your input before encoding.

What is the difference between encoding and decoding?

Encoding shifts each letter forward by the chosen amount. Decoding shifts each letter backward by the same amount. With a shift of 13 (ROT13), encoding and decoding produce the same result.

Does this tool send my message to a server?

No. All shifting happens entirely in your browser using local JavaScript. Nothing is uploaded, logged, or stored.