What is a Caesar cipher?
A Caesar cipher is one of the oldest and simplest ways of disguising a message: every letter is replaced by the letter a fixed number of positions further along the alphabet. With a shift of 3, A becomes D, B becomes E, and "HELLO" becomes "KHOOR".
ROT13, its best-known variant, is still used on forums and in newsgroups to hide spoilers and puzzle answers so readers have to choose to reveal them. Teachers use these ciphers to introduce cryptography, and they turn up constantly in escape rooms, geocaching puzzles and capture-the-flag challenges. This tool encodes and decodes all four classic variants instantly.
How to use the Caesar Cipher
1.Choose a cipher
ROT13 for spoilers, Caesar for a custom shift, ROT47 to include digits and symbols, or Atbash.
2.Set the shift and direction
For Caesar only: the number of places, and whether to encode or decode.
3.Type the message
The result updates as you type. Capitals, spaces and punctuation are kept.
Example: a meeting message
"Meet me at the old bridge at noon." with each cipher:
- ROT13
- Zrrg zr ng gur byq oevqtr ng abba.
- Caesar, shift 3
- Phhw ph dw wkh rog eulgjh dw qrrq.
- Decoding Phhw with shift 3
- Meet
Running the ROT13 output through ROT13 again gives back the original sentence.
Four ciphers, all reversible
A Caesar cipher moves each letter a fixed number of places along the alphabet, wrapping from Z back to A; Julius Caesar reportedly used a shift of 3. ROT13 is the special case of 13, which is its own inverse: applying it twice gives the original, so encode and decode are the same step.
ROT47 rotates all 94 visible ASCII characters, so digits and symbols are scrambled too. Atbash mirrors the alphabet, A to Z and B to Y. None of these is secure, since each can be broken in seconds; use them for puzzles and hiding spoilers, not secrets.
Frequently asked questions
How do I decode a Caesar cipher without the shift?
Try each shift from 1 to 25; only one gives readable text. In English, the most common letter in the ciphertext usually stands for E.
Why is ROT13 the same both ways?
The alphabet has 26 letters and 13 is half of that, so shifting twice brings every letter back to where it started.
Does it change numbers?
ROT13, Caesar and Atbash leave digits alone. ROT47 changes digits and symbols too.
Is a Caesar cipher secure?
No. There are only 25 possible shifts. Use real encryption for anything private.
Related tools
Morse Code Translator
Translate text to Morse code and Morse code back to text.
Text to Binary Converter
Convert text to binary, hex, octal or decimal bytes, and back.
Hash Generator: MD5, SHA-1, SHA-256
MD5, SHA-1 and SHA-256 hashes of text or files, with checksum compare.
Base64 Encoder & Decoder
Base64 and Base64url for text (UTF-8) and files.
URL Encoder & Decoder
Percent-encode or decode URLs and query values, and see a URL's parts.
JWT Decoder
Decode a JSON Web Token's header and payload and check its expiry.
More Developer tools
JSON & data
CSV tools
Network & system
Web & API
Git & releases
Encoding & security
Text & code
- Regex tester
- Text diff checker
- Cron expression explainer
- Lorem ipsum generator
- Markdown previewer
- Slug generator
- Strip HTML tags
- Unicode character inspector
- URL parser
- Markdown TOC generator
- cURL converter
- Whitespace visualizer
- Markdown link extractor
- Regex escape
- Regex match extractor
- Split text by regex
- HTML, CSS and JS playground
- Mock data generator
- Keyboard event tester
- ASCII table