Caesar Cipher Decoder
: Encode and decode the Caesar shift cipher and ROT13 with any shift, or crack a message whose shift is unknown: all 26 shifts ranked by how English they read, the best one in fullOptions
Caesar Cipher Decoder
Encode a message with the Caesar cipher, decode one when you know the shift, or crack it when you do not: the page tries all 26 shifts and ranks them by how much each reads like English, with the best guess in full. ROT13 is shift 13. It works as a Caesar cipher translator for puzzles, escape rooms, geocaches and homework, and it runs in your browser.
How to encode and decode a Caesar cipher
- Type or paste into
Text, or load a.txtfile. TheExamplesgive a message, a cipher text with shift 3 and a ROT13 line. - Pick the
Direction:Encodeshifts each letter forward,Decodeshifts it back, andCrack (unknown shift)tries every shift for you. - Set the
Shift, 1 to 25. 3 is the shift Julius Caesar used; theROT13button sets 13, where encoding and decoding are the same thing. - Read the result, with the plain and shifted alphabets under it.
Swapturns the result into the input and flips Encode and Decode, so you can check a message reads back. - Under
Options,Shift digits toomoves 0 to 9 as well,Letter casekeeps or changes the case, andSpaces and punctuationkeeps them, removes them, or writes the letters in classic groups of five.
Example
Shift 3 moves each letter three places on, so H becomes K and W wraps round to Z. Decoding shifts them back: Hello, World!
Hello, World!Khoor, Zruog!Details
- The Caesar cipher is a shift cipher, also called a rotation cipher: every letter is replaced by the letter a fixed number of places further on in the alphabet, wrapping from Z back to A. With shift 3, A becomes D and the whole cipher alphabet is DEFGHIJKLMNOPQRSTUVWXYZABC. Suetonius wrote that Julius Caesar used it for his private letters. It is the simplest substitution cipher and a common first lesson in cryptography.
- ROT13 is the Caesar cipher with shift 13, half of 26, so the same step encodes and decodes: Hello becomes Uryyb and back again. It is used to hide spoilers and puzzle answers in plain sight, not to keep anything secret.
- Cracking a Caesar cipher. There are only 25 real shifts, so the cipher falls to brute force: Crack decodes the text with every shift, 0 (as typed) to 25, and ranks them. A shift that gives common English words (the, and, you, meet) ranks first; ties are settled by letter fit (the
Fitcolumn), how closely the letter counts of the whole text match English letter frequencies (about 100 for English, far lower for a wrong shift). Even a single word can work:Khoorcracks as shift 3, Hello. The table lists every shift with the start of its text and a copy button, so you can pick another if the top one is not it. - Encoding and decoding. Upper and lower case letters keep their case unless you change it, and spaces, punctuation and letters outside A to Z (é, ß, Greek, emoji) are kept as typed, so
Hello, World!isKhoor, Zruog!. Turn onShift digits tooto move digits by the same shift mod 10: Room 42 becomes Urrp 75. Remove spaces, or write groups of five as telegraph and puzzle ciphers do: Attack at dawn becomes DWWDF NDWGD ZQ. - Decode takes the shift the text was encoded with. Decoding with shift 3 is the same as encoding with shift 23, so a "left shift" or "negative shift" of 3 is Decode with 3.
- Long texts: letter counts for the ranking are taken once for the whole text, and the word check reads the first 20,000 characters of each shift, so even a book-length cipher text is ranked in well under a second. Nothing you type leaves the page.
Limits
- Letters A to Z only, and digits if turned on. Accented letters and other alphabets are kept as typed, not shifted; the notes say how many.
- The ranking knows English. A Caesar cipher of another language still gets every shift in the table, but the best guess may be wrong; read the rows.
- One shift for the whole text. A Vigenère cipher (a keyword of shifts), Atbash or a general substitution cipher will not crack here; the notes say when no shift stands out.
- A very short cipher text (a word or two) can read as English at more than one shift; the page says when it is not sure.
FAQ
How do I decode a Caesar cipher without the key?
Choose Crack (unknown shift) and paste the text. Every shift is tried and ranked by common English words and letter frequencies; the best one is shown in full, and the shift it used is in the title.
What is the shift in a Caesar cipher?
How many places each letter moves. Caesar used 3: A to D, B to E, Z to C. Any shift from 1 to 25 works; 26 brings every letter back to itself. Encoding Hello, World! with 3 gives Khoor, Zruog!.
Is ROT13 a Caesar cipher?
Yes, ROT13 is the Caesar cipher with a shift of 13. Because 13 is half the alphabet, running it twice gives the original text back. Press ROT13 to set it.
Is the Caesar cipher secure?
No. With only 25 possible shifts anyone can try them all in seconds, as this page does. Use it for puzzles and teaching; to protect real data use a modern cipher such as AES.
Does it shift numbers?
Not by default: the classical cipher only moves letters. Turn on Shift digits too to move 0 to 9 by the same shift, wrapping from 9 to 0.
Runs entirely in your browser. Nothing is uploaded.