Caesar Cipher
Encode and decode text using the famous Caesar shift cipher. Choose any shift value from 1-25 or use ROT13.
How the Caesar Cipher Works
The Caesar cipher is a substitution cipher where each letter is replaced by a letter a fixed number of positions down the alphabet. Named after Julius Caesar, who used it with a shift of 3 to communicate with his generals.
The Algorithm:
- Choose a shift value (1-25)
- For each letter, find its position in the alphabet (A=0, B=1, ...)
- Add the shift value to the position
- If the result is greater than 25, wrap around (mod 26)
- Convert back to a letter
Example with Shift = 3:
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
"HELLO" becomes "KHOOR"
Common Shift Values
| Shift | Example | Note |
|---|---|---|
| 1 | HAL → IBM | Famous computer reference |
| 3 | HELLO → KHOOR | Caesar's original shift |
| 13 | HELLO → URYYB | ROT13 - most popular |
| 25 | HELLO → GDKKN | Maximum shift |
ROT13 - The Self-Inverse Cipher
ROT13 ("rotate by 13 places") is the most famous variant of the Caesar cipher. Since 13 is half of 26 (the number of letters), applying ROT13 twice returns the original text.
HELLO → URYYB → HELLO
ROT13 is commonly used on the internet to hide spoilers, puzzle solutions, and offensive content while still making it easy for those who want to read it.
History of the Caesar Cipher
According to the Roman historian Suetonius, Julius Caesar used this cipher with a shift of 3 to protect messages of military significance. It was effective at the time because most of Caesar's enemies were illiterate.
Caesar's nephew Augustus also used a similar cipher, but with a shift of 1 (A→B). The cipher remained in use for centuries and inspired more complex encryption methods.
Today, the Caesar cipher is primarily used for educational purposes and simple puzzles. It forms the foundation for understanding more advanced cryptographic concepts.
Frequently Asked Questions
Tool Features
Custom Shift Values
Choose any shift from 1 to 25, or use preset ROT13.
Brute Force Decoder
Try all 25 shifts to decode unknown ciphertexts.
Privacy Focused
All processing happens in your browser. No data sent to servers.
Free Forever
No registration, no limits, completely free to use.