The Caesar cipher is one of the oldest known ciphers. It works by shifting each letter in the message a fixed number of positions in the alphabet. It is named after Julius Caesar, who reportedly used a shift of 3 to communicate with his generals.
Imagine two rings of the alphabet, one inside the other. You rotate the inner ring by a certain number of positions — that is your key. To encrypt, find each letter on the outer ring and replace it with the letter lined up on the inner ring. To decrypt, do the reverse.
Each letter in the plaintext is replaced by a letter a fixed number of positions down the alphabet. With a shift of 3:
The formula is: ciphertext letter = (plaintext letter + shift) mod 26. The "mod 26" means we wrap around when we go past Z.
The Caesar cipher has only 26 possible keys (shifts 0 through 25). An attacker can simply try all 26 — this is called a brute-force attack. Click "Show All 26 Shifts" above to see exactly how easy this is.
Disclaimer: these pages are educational demos provided as-is, with no warranty of any kind. The author is not responsible for any consequences arising from their use.
Send comments and bug reports to chris@chrisspackman.com.
Version 0.1 — Last updated: 2026-02-21
This page is Copyright © 2025 – 2026
Chris Spackman <chris@chrisspackman.com>.
This web site developed entirely on GNU/Linux with Free / Open Source Software.
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.