Caesar Cipher

Encrypt and decrypt text with a shifting Caesar cipher.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

The Caesar cipher is one of the oldest known encryption methods, named after Julius Caesar, who used a shift of 3 to protect military messages. It is a substitution cipher: every letter is replaced by another letter a fixed number of places further along the alphabet. This tool lets you encrypt or decrypt text with any shift from 0 to 25, instantly and entirely in your browser. It is ideal for puzzles, escape-room clues, classroom demonstrations and casual obfuscation.

How it works

Each letter is mapped onto the 26-letter alphabet as a number (A = 0 … Z = 25). The cipher adds the shift to that number, then wraps around using modulo 26:

encrypted = (letter index + shift) mod 26

Decryption subtracts the shift instead of adding it. The tool normalises the shift with ((shift % 26) + 26) % 26 so negative or large values still behave correctly, and it preserves letter case — uppercase stays uppercase, lowercase stays lowercase. Anything that is not a letter (digits, spaces, punctuation) is left exactly as typed.

Example

Encrypt HELLO with a shift of 3:

LetterIndex+ shift 3mod 26Result
H71010K
E477H
L111414O
L111414O
O141717R

The output is KHOOR. To recover the original, set the mode to Decrypt with the same shift of 3, and KHOOR becomes HELLO again.

Everything runs locally in your browser — your text is never uploaded.

Ad placeholder (rectangle)