Caesar Cipher Encoder

The Caesar cipher shifts every letter by a fixed number, A becomes D under a +3 shift, B becomes E, and so on wrapping around from Z to A. Named after Julius Caesar, who allegedly used shift 3 for his private correspondence, it’s the simplest substitution cipher and still useful for puzzles, classroom demos, and the classic ROT13 usenet convention. Paste text, pick a shift, encode or decode.

How the Caesar cipher works

  1. 1

    Enter plaintext or ciphertext

    Any English text. Non-letters (numbers, punctuation, spaces) pass through unchanged. Case is preserved.

  2. 2

    Choose a shift value

    Any integer 1-25. Shift 13 is ROT13: its own inverse. Classical Caesar used 3.

  3. 3

    Pick direction

    Encode shifts forward; decode shifts backward. Decoding with shift K is equivalent to encoding with shift 26-K.

  4. 4

    Read the result

    Ciphertext (or decoded plaintext) appears instantly. Copy with one click.

How a Caesar shift looks

Shift of 3 applied to the alphabet:

Plain:      A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Cipher:     D E F G H I J K L M N O P Q R S T U V W X Y Z A B C

Example: HELLO with shift 3 → KHOOR. Decode KHOOR with shift 3 (or encode with shift 23) → HELLO.

ROT13: the self-inverse shift

ROT13 uses shift 13. Applied twice it returns the original text: HELLOURYYBHELLO. This made it ideal for hiding spoilers in 1980s Usenet posts: a single transform encoded and decoded, no key to remember.

Security (or the lack of it)

The Caesar cipher is broken by design against any modern analysis:

  • Brute force: only 25 possible shifts. Try all, pick the one that reads like English.
  • Frequency analysis: shifted text preserves letter frequencies. E is still the most common in English; whichever letter is most common in the ciphertext is likely the shifted version of E.
  • Known-plaintext: if you know even one original letter, you know the shift.

Don’t use it for anything you need to protect. It’s pedagogical, not practical.

Variants and extensions

  • ROT5: shifts only digits (0-9). Used alongside ROT13 in ROT18.
  • ROT47: shifts 94 printable ASCII characters; self-inverse like ROT13.
  • Vigenère: Caesar with a keyword so each position uses a different shift. Much harder to break.
  • Atbash: swap A↔Z, B↔Y, and so on. A fixed-shift relative to Hebrew historical use.

Classroom use

The Caesar cipher is a staple of first-week cryptography courses: it introduces modular arithmetic, substitution, frequency analysis and the concept of a key without requiring any heavy math. It’s also the solution to many CTF “beginner crypto” challenges.

Frequently Asked Questions

Suetonius reports Caesar used a shift of 3 for his correspondence. Augustus allegedly used shift 1 (A → B, B → C, Z → A or AA, depending on sources).

No. Classical Caesar is defined on the 26-letter Roman alphabet. Accented letters (é, ñ, ü) pass through unchanged. For multi-alphabet ciphers you need a modern substitution scheme.

Convenience. It hides text casually (spoilers, puzzle answers, mild profanity filters) while being trivial to decode. It was never meant as security, only as a light obfuscation.

Yes, easily. Try all 25 shifts and scan for readable English. Longer ciphertext (20+ characters) is effectively unambiguous; very short ciphertext may have multiple plausible shifts.

Related Tools