Caesar Cipher Online — Adjustable Shift Encoder & Decoder

Encode or decode the classical Roman shift cipher with any shift from 1 to 25. Optional case preservation and non-letter passthrough. 100% in your browser.

What is the Caesar Cipher?

The Caesar cipher is one of the oldest and simplest encryption techniques: each letter of the plaintext is shifted by a fixed number of places down the alphabet. With shift 3, A becomes D, B becomes E, and Z wraps around to C. The shift value is the key; there are 25 useful shifts (a shift of 0 leaves text unchanged).

Named after Julius Caesar, who reportedly used a shift of 3 to encrypt military correspondence during the Gallic Wars (1st century BC), the cipher served Roman field commanders well — most adversaries could not read Latin, let alone perform a brute-force attack. Augustus is said to have used a shift of 1. The technique resurfaces throughout cryptographic history as a building block in more complex ciphers (like Vigenère) and as the canonical first example in every cryptography textbook.

How to use the Caesar cipher tool — 4 steps

  1. Paste your text. Drop plaintext or ciphertext into the Input panel. Click Load Sample to try a demo.
  2. Set the shift. Use the slider or number input to pick a shift between 1 and 25. Caesar's historical shift was 3.
  3. Choose Encode or Decode. Decode applies the inverse shift automatically. Toggle Preserve case and Passthrough non-letters as needed.
  4. Click Apply Caesar. Read the output and click Copy to grab it for puzzles, CTF write-ups, or coursework.

Sample input and output (shift 3)

Plaintext

Veni, vidi, vici.

Encoded (shift 3)

Yhql, ylgl, ylfl.

To recover the original, decode with the same shift of 3 (or, equivalently, encode with shift 23). Punctuation and case are preserved.

Adjustable Shift 1–25

Slide or type any shift value. The tool wraps modulo 26 so you can experiment with negative or large shifts safely.

Encode / Decode Toggle

Switch direction with one click. Decode applies the negative shift automatically — no mental arithmetic required.

Optional Normalisation

Choose whether to preserve case and whether to keep digits, punctuation, and whitespace, or strip them for cryptanalysis.

Common use cases

  • check_circleSolving classical-cipher puzzles in escape rooms and trivia
  • check_circleMild obfuscation for spoiler tags or hidden hints
  • check_circleCTF (capture-the-flag) warm-up challenges and crypto introductions
  • check_circleStudying classical cryptography history (Caesar, Augustus, Vigenère)
  • check_circleGeocaching coordinate hints and field-puzzle clues
  • check_circleTeaching modular arithmetic, key spaces, and frequency analysis
  • check_circleCreating practice ciphertexts for cryptanalysis exercises
  • check_circleEncoding lightweight Easter eggs in source code or game assets

Caesar cipher vs ROT13 vs modern encryption

PropertyCaesar (shift 1–25)ROT13AES-256-GCM
Key space251 (fixed)2256
Brute-force timeInstantInstantBeyond age of universe
Beats frequency analysisNoNoYes
AuthenticatedNoNoYes (GCM tag)
Secure?NoNoYes

Caesar and ROT13 ciphers are NOT secure. Treat them as obfuscation and a teaching aid only. For real confidentiality use AES-256-GCM, ChaCha20-Poly1305, or libsodium with a strong, properly managed key.

Need actual encryption?

The Caesar cipher is a historical curiosity — it offers no real protection. For passwords, tokens, or sensitive payloads use a modern authenticated cipher with a properly managed key.

Frequently Asked Questions

Is the Caesar cipher secure?

No. The Caesar cipher provides zero cryptographic security. With only 25 possible shifts, an attacker can try every key in microseconds. Frequency analysis breaks it even faster — the letter E is the most common in English, so whichever ciphertext letter appears most often is almost always the encrypted E. Use AES-256-GCM, ChaCha20-Poly1305, or another modern authenticated cipher for any real confidentiality need.

What shift did Julius Caesar use?

According to Suetonius, Caesar used a left shift of 3 for his military correspondence — A became D, B became E, and so on. Augustus reportedly used a shift of 1. Both ciphers were considered adequate at the time because most adversaries were illiterate or unfamiliar with the technique, not because the cipher was strong.

How do I decode a Caesar cipher without knowing the shift?

Brute force: try all 25 shifts and pick the one that produces readable English. Frequency analysis is the principled approach — count letter frequencies in the ciphertext and align the most frequent ciphertext letter with the expected E. The shift falls out immediately. There is no hard math required, which is exactly why the Caesar cipher is insecure.

What is the difference between Caesar cipher and ROT13?

ROT13 is a Caesar cipher with the shift hard-coded to 13. The general Caesar cipher accepts any shift between 1 and 25, so it has 25 possible keys instead of 1. Both are trivially breakable; the shift of 13 is special only because it makes the cipher self-inverse — applying it twice returns the original.

Why are there 25 valid shifts and not 26?

A shift of 0 (or 26, 52, …) maps every letter to itself, producing identical plaintext and ciphertext — which is not a cipher. So the meaningful key space is shifts 1 through 25. A shift of 26 wraps back to 0; a shift of -3 is the same as +23.

Does it preserve uppercase, digits, and punctuation?

By default, yes. The "Preserve case" option keeps uppercase letters uppercase and lowercase letters lowercase after the shift. The "Passthrough non-letters" option leaves digits, spaces, punctuation, and Unicode characters unchanged. Disable either if you want a normalised lowercase-only or letters-only output (common for classical cryptanalysis exercises).

Is my text uploaded to your servers?

No. The Caesar cipher transformation runs entirely in JavaScript inside your browser. Nothing leaves your device. Open DevTools → Network and click Apply — no requests fire.

Can a Caesar cipher protect a password?

Absolutely not. A password "encrypted" with a Caesar cipher can be recovered in milliseconds. For storing passwords use a slow KDF like Argon2id or bcrypt; for transmitting them use TLS; for encrypting payloads use AES-GCM with a properly managed key.

Caesar Cipher Online — Free Encoder & Decoder with Adjustable Shift