Caesar Cipher Shifter

Shift every letter in your message forward or backward by a chosen key to encrypt or decrypt classic Caesar cipher text.

Quick Facts

Formula
C = (P + shift) mod 26
Decryption reverses it: P = (C - shift) mod 26. Only A-Z/a-z shift; spaces, digits, and punctuation stay the same.
Origin
Named for Julius Caesar, who used a shift of 3
ROT13 (shift 13) is a special case that is its own inverse — apply it twice and you get the original text back.

Your Results

Calculated
Result text
-
Shifted message
Effective shift
-
Positions moved per letter
Letters shifted
-
Alphabetic chars / total chars
Alphabet check
-
Where "A" maps to

Ready

Enter a message, choose a shift amount, and press Calculate.

About the Caesar Cipher Shifter

A Caesar cipher is one of the oldest known substitution ciphers: every letter in a message is replaced by the letter a fixed number of positions further along the alphabet, wrapping back to "A" after "Z". This tool applies that shift to your text — or reverses it — using the standard formula C = (P + shift) mod 26 for encryption and P = (C - shift) mod 26 for decryption, where P and C are a letter's position in the alphabet (A = 0 through Z = 25).

How to get the best results

  • Only letters A-Z and a-z are shifted; spaces, digits, and punctuation are copied through unchanged
  • Letter case is preserved — an uppercase letter shifts to another uppercase letter, lowercase to lowercase
  • To reverse an encryption, switch the operation to Decrypt and re-enter the exact same shift key

Practical context

The Caesar cipher is a teaching and puzzle tool, not real security. With only 26 possible shifts, it can be broken instantly by trying every key, or almost as fast using English letter-frequency analysis. Use it for classroom demonstrations, escape-room clues, or light text obfuscation — never to protect information that actually needs to stay secret.

Frequently Asked Questions

What is the formula behind the Caesar cipher?
Encryption is C = (P + shift) mod 26, where P is a letter's position in the alphabet (A=0 ... Z=25) and shift is the key. Decryption reverses it: P = (C - shift) mod 26. Only letters A-Z (and a-z) are shifted; spaces, digits, and punctuation pass through unchanged, and letter case is preserved.
Is the Caesar cipher secure?
No. There are only 26 possible shifts, so a computer (or a patient human) can try every one in seconds. Even without brute force, English letter-frequency patterns make the key easy to guess. Treat the Caesar cipher as a teaching tool or puzzle mechanic, never as protection for real secrets — use modern encryption such as AES or TLS for that.
What is ROT13 and how does it relate to this?
ROT13 is the Caesar cipher with shift fixed at 13. Because 13 + 13 = 26, applying ROT13 twice returns the original text, so the same operation both encodes and decodes it. It is commonly used online to hide spoilers or puzzle answers from casual reading, not for real security.
Does this tool preserve spaces, numbers, and letter case?
Yes. Only alphabetic characters are shifted; spaces, digits, and punctuation are copied through unchanged, and uppercase letters stay uppercase while lowercase letters stay lowercase after shifting.