Caesar cipher
Encrypt or decrypt text with a Caesar cipher, choosing any shift from 1 to 25, or use ROT13 in one click. You can also list all 25 rotations to crack a message. Everything runs in your browser.
How to use it
- Type or paste your text in the box.
- Choose Encrypt or Decrypt in Action, or pick ROT13.
- Set the Shift (1 to 25). Use the same shift to decrypt that was used to encrypt.
- Tick Show all 25 rotations to look for a readable message when the shift is unknown.
Complete guide to the Caesar cipher and ROT13
What the Caesar cipher is
The Caesar cipher is one of the oldest known ciphers, named after Julius Caesar, who is said to have used a shift of three to protect military messages. Each letter is replaced by the letter a fixed number of places further along the alphabet. It is no longer a real way to protect information, but it is a classic for teaching cryptography, puzzle hunts, escape rooms, geocaching and spoiler-hiding on forums.
How the tool works
The alphabet is treated as a circle of 26 letters, so after Z you return to A. With a shift of 3, A becomes D, B becomes E and X becomes A. Upper and lower case are kept. Everything that is not one of the 26 letters A to Z stays unchanged: spaces, digits, punctuation and accented letters such as á or ã. To decrypt, the tool shifts back by the same amount, which is the same as shifting forward by 26 minus the shift.
Worked example
- Type
Attack at dawn! Olá, João.in Your text, choose Encrypt in Action and set Shift (1 to 25) to 3. The Result isDwwdfn dw gdzq! Roá, Mrãr.. Notice that the "á" and "ã" were not changed, and that "Olá" became "Roá". - Paste that result, choose Decrypt with the same shift of 3, and the original text comes back.
- Choose ROT13 (shortcut, same both ways) and type
Hello: the result isUryyb. Run ROT13 onUryyband you getHelloagain, because 13 + 13 = 26. - To break a message when you do not know the shift, paste
Khoor, choose Decrypt and tick Show all 25 rotations. In the All rotations table, only the row with shift 3 reads as a word:Hello.
Quick reference
| Shift | A becomes | Note |
|---|---|---|
| 3 | D | The classic Caesar shift |
| 13 | N | ROT13, its own inverse |
| 25 | Z | Same as shifting back by 1 |
| 26 | A | Not offered, it changes nothing |
Why it is not secure
There are only 25 possible shifts, so a person with pen and paper, or this very tool, can try them all in seconds. Letter frequencies also give it away: in English the most common letter is E, and the most common letter in the ciphertext points to the shift. Use the cipher for games and learning only, never for passwords, personal data or anything private.
Tips and common mistakes
- Use the same shift to decrypt that was used to encrypt. A shift outside 1 to 25, or a decimal number, shows an error message.
- Because accents are not shifted, text in Portuguese or Spanish stays partly readable. That is a feature of this tool, not of the cipher itself.
- ROT13 is also the way many forums hide spoilers. Applying it twice always restores the text.
- The all-rotations table is the quickest way to solve a puzzle: scan down for the line that makes sense.
Related tools
For other classic encodings try the Morse code translator, the text to binary converter or the text reverser. For encoding that handles any character use the Base64 encoder. Everything runs in your browser.
Questions
What is the Caesar cipher?
One of the oldest ciphers: each letter is replaced by the letter a fixed number of places further along the alphabet. With a shift of 3, A becomes D.
What is ROT13?
A Caesar cipher with a shift of 13. Since the alphabet has 26 letters, applying ROT13 twice gives back the original, so the same action encrypts and decrypts.
What happens to accents, numbers and punctuation?
They are kept unchanged. Only the letters A to Z (upper and lower case) are shifted, so accented letters such as é stay as they are.
Is the Caesar cipher secure?
No. There are only 25 possible shifts, so anyone can break it in seconds. Use it for puzzles, games and learning, never for real secrets.