The Caesar cipher is one of the oldest known encryption methods, named after Julius Caesar, who used a shift of 3 to protect military messages. It is a substitution cipher: every letter is replaced by another letter a fixed number of places further along the alphabet. This tool lets you encrypt or decrypt text with any shift from 0 to 25, instantly and entirely in your browser. It is ideal for puzzles, escape-room clues, classroom demonstrations and casual obfuscation.
How it works
Each letter is mapped onto the 26-letter alphabet as a number (A = 0 … Z = 25). The cipher adds the shift to that number, then wraps around using modulo 26:
encrypted = (letter index + shift) mod 26
Decryption subtracts the shift instead of adding it. The tool normalises the shift with ((shift % 26) + 26) % 26 so negative or large values still behave correctly, and it preserves letter case — uppercase stays uppercase, lowercase stays lowercase. Anything that is not a letter (digits, spaces, punctuation) is left exactly as typed.
Example
Encrypt HELLO with a shift of 3:
| Letter | Index | + shift 3 | mod 26 | Result |
|---|---|---|---|---|
| H | 7 | 10 | 10 | K |
| E | 4 | 7 | 7 | H |
| L | 11 | 14 | 14 | O |
| L | 11 | 14 | 14 | O |
| O | 14 | 17 | 17 | R |
The output is KHOOR. To recover the original, set the mode to Decrypt with the same shift of 3, and KHOOR becomes HELLO again.
Everything runs locally in your browser — your text is never uploaded.