Caesar Cipher Decoder: Encrypt & Decrypt Any Shift
Encode or decode text with the Caesar cipher using any shift value from 1 to 25. Auto-detect mode uses letter-frequency analysis to crack an unknown shift and rank all 25 possibilities by likelihood. ROT13 is available as a one-click preset. Works on any alphabet text — non-letter characters pass through unchanged.
Full shift range 1–25 with a slider and direct numeric input so you can set any Caesar shift precisely.
Auto-detect mode runs frequency analysis against English letter frequencies and ranks all 25 possible decryptions by match score, showing the most likely plaintext first.
ROT13 preset (shift 13) encodes and decodes in one click — ROT13 is its own inverse so the same button works for both directions.
Non-letter characters — spaces, numbers, punctuation — pass through unchanged, preserving the structure of the original message.
Case-preserving: uppercase letters shift within A–Z and lowercase within a–z, so the capitalization pattern of the original is maintained.
Side-by-side display shows all 25 decryptions at once in auto-detect mode so you can scan for the correct one without clicking through each shift individually.
How to Use
Paste or type your text in the input box
Set the shift value using the slider or type a number (1–25)
Choose Encode or Decode — for a known shift, either direction works; Decode with shift N is the same as Encode with shift 26-N
Or click Auto-Detect to crack an unknown shift by frequency analysis — the most likely decryption appears at the top
Click Copy next to any result to copy it to your clipboard
Education
- Teaching classical cryptography concepts
- Demonstrating substitution cipher mechanics
- CS and maths homework on modular arithmetic
- History lessons on Roman military codes
Puzzles and CTFs
- Decoding Caesar-encrypted CTF flags
- Creating encoded treasure hunt clues
- Escape room puzzle design
- Solving cipher puzzles in games
Casual Encoding
- Sending lightly obfuscated messages to friends
- ROT13 for spoiler-hiding in online forums
- Encoding notes you do not want read at a glance
| Original Text | Result |
|---|---|
Hello World | Khoor Zruog (shift 3) |
ATTACKATDAWN | DWWDFNDWGDZQ (shift 3) |
Khoor Zruog | Hello World (decode shift 3) |
Hello | Uryyb (ROT13, shift 13) |
The Quick Brown Fox | Gur Dhvpx Oebja Sbk (ROT13) |
Education
- Khan Academy
- CS50
- Coursera cryptography courses
- High school and university CS curricula
Puzzle Communities
- CTFtime.org competitions
- r/puzzles
- Escape room platforms
- Geocaching puzzle caches
The auto-detect frequency analysis works best on English text of at least 20–30 characters. Very short ciphertexts (under 10 characters) do not contain enough letter distribution information for reliable frequency analysis — the top-ranked result may not be correct. For short messages, scan the full list of 25 decryptions manually.
ROT13 (shift 13) has a special property: applying it twice returns the original text because 13 + 13 = 26. This makes ROT13 its own inverse — you use the same function to encode and decode. It was widely used on Usenet in the 1980s and 1990s to hide spoilers and offensive content behind a trivial decode step, establishing the norm that predates modern content warnings.
The Caesar cipher is a special case of the Vigenère cipher with a single-character key. If you need stronger encoding than a single shift, the Vigenère cipher uses a keyword to apply different shifts to different character positions — it is much harder to crack by frequency analysis alone because the key length must be determined first.
When decoding a CTF challenge, always try ROT13 first (shift 13) — it is the most commonly used Caesar shift in beginner CTF challenges because of its historical significance and self-inverse property. If ROT13 fails, use auto-detect and scan the ranked list for a result that reads as coherent English.
Always specify the shift value when sharing a Caesar-encoded message — unlike ROT13, which is universally understood to be shift 13, an arbitrary shift of 7 or 19 requires the recipient to know the key to decode it, which is the intended behavior of the cipher.
For ROT13 specifically, use the one-click ROT13 preset rather than setting the slider to 13 manually — it is faster and labels the output clearly so the recipient knows to apply ROT13 to decode.
Do not use the Caesar cipher for anything requiring actual security — it is breakable in milliseconds by any computer. Use it for puzzles, games, teaching demonstrations, and casual obfuscation where the goal is a trivial barrier rather than genuine secrecy.
When using auto-detect on a ciphertext that contains many numbers, proper nouns, or technical terms, the frequency analysis may rank incorrect shifts highly because these elements skew the letter distribution away from standard English. In such cases, scan the full ranked list rather than trusting only the top result.
Frequently Asked Questions
Find answers to common questions about our tools and services.
Understanding Caesar Cipher Decoder
Julius Caesar described his cipher in a letter to Cicero around 50 BCE, making it one of the oldest documented encryption methods in history. Caesar used a shift of 3 — A encrypts to D, B to E, and so on. Suetonius, writing in the second century CE, recorded that Caesar also used a shift of 1 in some correspondence, suggesting that even in antiquity, varying the key was understood as a security measure.
The cipher works on modular arithmetic. Assign each letter a number: A=0, B=1, ..., Z=25. To encrypt with shift k, compute (letter + k) mod 26 and convert back to a letter. To decrypt, compute (letter - k + 26) mod 26. The +26 ensures the result is always positive when the shift subtraction would otherwise go negative. This is the same mathematics used in clock arithmetic — 11 o'clock plus 3 hours is 2 o'clock, not 14.
Frequency analysis as a cryptanalytic technique was first described by Al-Kindi, a 9th-century Arab mathematician, in his treatise 'A Manuscript on Deciphering Cryptographic Messages.' Al-Kindi observed that in any language, certain letters appear more frequently than others, and that this frequency pattern is preserved in a substitution cipher — the most common ciphertext letter likely corresponds to the most common plaintext letter. This insight made simple substitution ciphers obsolete as a security tool, even though they remained in educational and casual use.
ROT13 deserves its own history. The Internet Usenet system in the 1980s needed a simple way for users to hide spoilers and adult content behind a trivial barrier. ROT13 was chosen because shift 13 is the self-inverse on a 26-letter alphabet — applying it twice recovers the original, so the same function both hides and reveals. It was implemented in Usenet newsreader software as a menu option and became the first widespread use of any cipher in consumer software, predating SSL/TLS encryption by a decade.
In computer science education, the Caesar cipher is almost universally the first cipher taught, and for good reason. It introduces the concepts of plaintext, ciphertext, key, encryption function, and decryption function in the simplest possible form. The brute-force attack (try all 25 keys) introduces the concept of key space and why a small key space is insecure. Frequency analysis introduces probabilistic cryptanalysis. The Caesar cipher teaches more cryptography fundamentals per line of code than any other cipher.
In CTF (capture-the-flag) competitions, Caesar-encoded flags are among the most common beginner-level challenges. The flag is typically a string like 'CTF{uryybjbeyq}' where the content inside the braces is ROT13 or another Caesar shift. The challenge is recognizing the encoding and applying the correct shift. Auto-detect frequency analysis solves most of these instantly, but experienced CTF players also recognize ROT13 output by pattern — the character distribution of ROT13 English looks like English but with systematically wrong letters.