Skip to content

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

Encrypted text
Dwwdfn dw gdzq

The message decoded with every shift

ShiftText
1Zsszbj zs czvm
2Yrryai yr byul
3Xqqxzh xq axtk
4Wppwyg wp zwsj
5Voovxf vo yvri
6Unnuwe un xuqh
7Tmmtvd tm wtpg
8Sllsuc sl vsof
9Rkkrtb rk urne
10Qjjqsa qj tqmd
11Piiprz pi splc
12Ohhoqy oh rokb
13Nggnpx ng qnja
14Mffmow mf pmiz
15Leelnv le olhy
16Kddkmu kd nkgx
17Jccjlt jc mjfw
18Ibbiks ib liev
19Haahjr ha khdu
20Gzzgiq gz jgct
21Fyyfhp fy ifbs
22Exxego ex hear
23Dwwdfn dw gdzq
24Cvvcem cv fcyp
25Buubdl 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

All text, code and network calculators · All calculators

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.

☕ Like this tool?

Buy me a coffee to support development

☕ Support UnitGenie

If this tool has been helpful, consider buying me a coffee to support development and keep it free for everyone!