Caesar cipher

Shift every letter by a fixed number of places, any shift, encrypt and decrypt, with the letter table.

How it works

Suetonius reports that Julius Caesar wrote confidential letters with every letter moved three places along the alphabet, so that A became D. Any shift $k$ works the same way: number the letters A = 0 to Z = 25, then

$$E(x) = (x + k) \bmod 26, \qquad D(y) = (y - k) \bmod 26.$$

Decrypting with shift $k$ is the same as encrypting with shift $26 - k$, and a shift of 13 (ROT13) undoes itself.

There are only 25 useful keys, so trying them all breaks the cipher in seconds; the right one is the only shift that gives readable text. Even without trying, the most frequent cipher letter usually stands for E. The Caesar cipher is still the first example in every course because each later cipher repairs one of its weaknesses.

Everything is calculated in your browser. Nothing you type leaves your device.