What is a Caesar cipher?
A Caesar cipher is one of the oldest encryption techniques. Each letter is replaced by the letter a fixed number of positions further along the alphabet, wrapping from Z back to A. With a shift of 3, A → D and HELLO → KHOOR.
It is named after Julius Caesar, who used a shift of 3 to protect his private letters. Numbers, spaces and punctuation stay unchanged.
How to decode a Caesar cipher
- Know the shift? Choose Decrypt, set the shift, and paste the message.
- No key? Paste it anyway. The Cryptanalysis Cracker shows all 25 shifts; pick the line that reads as normal text.
- ROT13? Press ROT13. The same shift both encodes and decodes.
Use it in your code
Everything on this page is available as a free, MIT-licensed, zero-dependency npm package with TypeScript types.
npm install @gykh/caesar-cipher
import { encryptString, crack } from "@gykh/caesar-cipher";
encryptString("Hello", 3); // "Khoor"
Frequently asked questions
What is ROT13?
ROT13 is a Caesar cipher with a shift of 13. The alphabet has 26 letters, so applying ROT13 twice returns the original text. It is popular for hiding spoilers and puzzle answers.
Is the Caesar cipher secure?
No. With only 25 possible keys it can be broken in seconds, as the cracker above shows. Use it for puzzles, escape rooms, geocaching, teaching and games, never for real secrets.
Is my text sent to a server?
No. All encryption, decryption and cracking runs locally in your browser. Challenge links carry only the encrypted text, inside the link itself.
How do I share a secret message?
Encrypt your text, press Share as a challenge, and send the link. Your friend sees only the scrambled text and has to crack it. To get a short, tidy link and see how many people opened it, shorten it with MiniFyn.