Caesar Cipher Encoder and Solver
Enter a message and a shift to encode or decode it. The table lists the message under every shift, which lets you crack a Caesar cipher by looking for the readable line.
Result
Dwwdfn dw gdzq
The message decoded with every shift
| Shift | Text |
|---|---|
| 1 | Zsszbj zs czvm |
| 2 | Yrryai yr byul |
| 3 | Xqqxzh xq axtk |
| 4 | Wppwyg wp zwsj |
| 5 | Voovxf vo yvri |
| 6 | Unnuwe un xuqh |
| 7 | Tmmtvd tm wtpg |
| 8 | Sllsuc sl vsof |
| 9 | Rkkrtb rk urne |
| 10 | Qjjqsa qj tqmd |
| 11 | Piiprz pi splc |
| 12 | Ohhoqy oh rokb |
| 13 | Nggnpx ng qnja |
| 14 | Mffmow mf pmiz |
| 15 | Leelnv le olhy |
| 16 | Kddkmu kd nkgx |
| 17 | Jccjlt jc mjfw |
| 18 | Ibbiks ib liev |
| 19 | Haahjr ha khdu |
| 20 | Gzzgiq gz jgct |
| 21 | Fyyfhp fy ifbs |
| 22 | Exxego ex hear |
| 23 | Dwwdfn dw gdzq |
| 24 | Cvvcem cv fcyp |
| 25 | Buubdl bu ebxo |
Formula
- Encrypt: E(x) = (x + k) mod 26
- Decrypt: D(x) = (x − k) mod 26
- x is the position of the letter from 0 to 25 and k is the shift
How the Caesar Cipher Encoder and Solver works
A Caesar cipher replaces each letter with the one a fixed number of places further along the alphabet, wrapping from Z back to A. With a shift of 3, A becomes D and Z becomes C. It is named after Julius Caesar, who used it for private letters.
There are only 25 useful keys, so the cipher is easy to break by trying them all. ROT13 is the special case with a shift of 13, where encoding and decoding are the same operation.
Worked example
With a shift of 3, "Attack at dawn" becomes "Dwwdfn dw gdzq". Each letter moves three places: A to D, t to w, c to f and k to n.
Frequently asked questions
How do I decode a Caesar cipher without the key?
Try every shift from 1 to 25 and look for the line that reads as real words. The table under the result does this for you.
What is ROT13?
A Caesar cipher with a shift of 13. Because the alphabet has 26 letters, applying it twice returns the original text.
Related calculators
- Morse Code TranslatorTranslate text to Morse code and Morse code back to text. Supports letters, numbers and punctuation in International Morse Code.
- Letter to Number Converter (A1Z26)Convert letters to their alphabet position numbers, where A is 1 and Z is 26, or convert numbers back to letters.
- Base64 Encoder and DecoderEncode text to Base64 or decode Base64 back to text, with full UTF-8 support and a URL-safe variant.
- Binary Translator: Text to BinaryConvert text to binary code and binary back to text. Uses 8-bit bytes with UTF-8, so it handles ASCII and every other character.
- Hex Translator: Text to HexadecimalConvert text to hexadecimal bytes and hex back to text using UTF-8. Useful for reading hex dumps and encoding strings.
- Text to ASCII and Unicode ConverterConvert text to ASCII codes and Unicode code points in decimal and hex, or turn a list of character codes back into text.
- Hex CalculatorAdd, subtract, multiply and divide hexadecimal, binary, octal or decimal numbers, and apply bitwise AND, OR and XOR. Results in all four bases.
- Chmod CalculatorBuild Unix file permissions by ticking read, write and execute for owner, group and others. Get the octal number, symbolic notation and chmod command.
- IEEE 754 Floating Point ConverterConvert a decimal number to its IEEE 754 single and double precision representation: sign, exponent and mantissa bits, hex value and the exact stored number.
- Subnet CalculatorCalculate the network address, broadcast address, host range, subnet mask and number of hosts for any IPv4 address and CIDR prefix.
Related unit converters
Calculations run in your browser and nothing you enter is sent to a server. Results are provided for general information. Check critical figures independently before relying on them.