Free Caesar cipher
Encrypt or decrypt text with a Caesar shift cipher — slide the shift from 0 to 25 (13 is ROT13), preserve case, and brute-force all 25 shifts to crack a message, updated live, as you type.
On this page13 sections
The Caesar cipher is for puzzles, ROT13 spoilers and teaching — not security. Never use it for real secrets. Nothing you type is stored or sent; everything runs in your browser.
Results are estimates. Consult a professional.
What is the Caesar cipher?
The Caesar cipher is the oldest and simplest substitution cipher: it replaces each letter of a message with the letter a fixed number of places further along the alphabet. That fixed number is the key, called the shift. It is named after Julius Caesar, who — according to the Roman historian Suetonius — protected his military correspondence by shifting each letter three places, turning A into D, B into E, and so on. The cipher wraps around the end of the alphabet, so X, Y and Z become A, B and C.
The tool above encrypts and decrypts text with any Caesar shift from 0 to 25, live as you type. Choose a direction, drag the shift slider, and paste your text: the output updates instantly. Letters keep their case (so Hello stays capitalised), and every non-letter — digits, spaces, punctuation — passes through untouched. You can also switch on the brute-force view to see all 25 possible decryptions at once, which is how you crack a Caesar message when you do not know the shift.
How the Caesar shift works (mod 26)
Number the alphabet from 0 to 25, so A = 0, B = 1, up to Z = 25. To encrypt a letter at position x with shift N, add N and wrap around using modular arithmetic — "mod 26" means take the remainder after dividing by 26, which is what makes Z roll over to A. To decrypt, subtract N instead.
What the Caesar cipher tool takes
The tool needs three things: your text, a shift amount, and a direction. Set those and the result appears immediately — there is no submit button.
- Text — the message to transform. Paste plaintext to encrypt, or ciphertext to decrypt. Only A–Z and a–z are shifted; everything else is copied through as-is.
- Shift amount (N) — a slider from 0 to 25. This is the cipher's key. A shift of 13 is the special ROT13 case described below.
- Direction — Encrypt adds the shift, Decrypt subtracts it. To read a message someone sent you, set the same shift they used and choose Decrypt.
- Brute force (optional) — turn this on to list all 25 decryptions at once, for when you have ciphertext but not the key.
Worked example: HELLO with a shift of 3
We will encrypt the word HELLO with a shift of 3 — the exact shift Julius Caesar used — and confirm it against the tool's default result.
Shift each letter forward by three
Move every letter three places along the alphabet: H → K, E → H, L → O, L → O, O → R. None of these reach past Z, so no wrap-around is needed here. The result is KHOOR.
Check it with the formula
Take the H: it is position 7, so E(7) = (7 + 3) mod 26 = 10, which is K. The O is position 14, so E(14) = (14 + 3) mod 26 = 17, which is R. Both agree with the letter-by-letter shift.
ROT13 — the self-inverse shift of 13
ROT13 is the Caesar cipher with a shift of exactly 13. Because the alphabet has 26 letters and 13 is half of 26, shifting forward 13 and shifting back 13 land on the same place: 13 + 13 = 26, which is 0 mod 26. That gives ROT13 a handy property — it is its own inverse. Applying ROT13 to text and then applying it again returns the original, so the same operation both scrambles and unscrambles.
For example, HELLO under ROT13 becomes URYYB, and URYYB under ROT13 becomes HELLO again. Because encrypting and decrypting are identical, ROT13 is widely used online to hide content that should not be read accidentally — spoilers, puzzle answers, and joke punchlines — without truly protecting it. In the tool, setting the shift to 13 produces the same output whether Encrypt or Decrypt is selected.
Breaking a Caesar cipher: all 25 shifts
Because a Caesar cipher has only 25 useful keys, you can crack any message without knowing the shift: simply try them all and read the one that makes sense. This is the brute-force attack. To see it, take the KHOOR we produced in the worked example, paste it into the tool, and switch on the brute-force view — it lists every decryption for you. Below is exactly what it shows for KHOOR.
| Shift | Decryption of KHOOR | Readable? |
|---|---|---|
| 1 | JGNNQ | No |
| 2 | IFMMP | No |
| 3 | HELLO | Yes — this is the plaintext |
| 4 | GDKKN | No |
| 5 | FCJJM | No |
| … | … (shifts 6–25 continue) | No |
Brute-force decryption of KHOOR. Only shift 3 produces a real word, so the original shift was 3. The tool lists all 25 rows; the first five are shown here.
For longer messages you do not even need to read each line — frequency analysis spots the right shift automatically by matching the most common ciphertext letter to E, the most common letter in English. Either way, a Caesar cipher falls in moments.
What the Caesar cipher is good for
The Caesar cipher survives today not as a security tool but as a teaching and convenience tool. Its simplicity is exactly the point.
- Puzzles and games — escape rooms, treasure hunts, cryptograms and geocaching clues use Caesar shifts because they are solvable with pencil and paper.
- Hiding spoilers (ROT13) — forums and review sites scramble plot twists and puzzle answers with ROT13 so readers reveal them only on purpose.
- Teaching cryptography — it is the standard first example for modular arithmetic, keys, encryption versus decryption, and why short key spaces fail.
- Light obfuscation — making a string non-obvious at a glance, where the goal is to deter casual reading rather than to keep a secret.
Why the Caesar cipher is not secure
This is the most important section on the page. The Caesar cipher must never be used to protect anything that actually needs to stay secret. It was breakable in Caesar's own time and is trivially breakable now.
- The key space is tiny. There are only 25 non-trivial shifts, so an attacker can try every one in seconds — exactly what the brute-force view above demonstrates.
- Frequency analysis breaks it instantly. The cipher does not hide letter patterns, so matching the commonest ciphertext letter to E reveals the shift even for long messages.
- The same letter always maps the same way. Every E becomes the same ciphertext letter, leaking the structure of the message.
Does this tool send my text anywhere?
No. The encryption and decryption run entirely in your browser with plain arithmetic. The text you type is never stored, logged, or sent to any server — there is no network request, because none is needed. The math is exact and self-contained, so the tool gives the same answer as any correct Caesar implementation and works the same offline.
Remember, though, that running text through this tool does not make it private — the Caesar cipher offers no real protection. Keeping the computation on your device protects your input here; it does not make the cipher's output safe to share as if it were encrypted.
Frequently asked questions about the free Caesar cipher
About this Caesar cipher tool
This Caesar cipher tool runs entirely in your browser — the text you type is never stored, logged, or sent to any server, and it works the same offline. It shifts each letter along the alphabet using modular arithmetic, preserves case, and leaves digits, spaces, and punctuation unchanged. Remember it is for puzzles, ROT13 spoilers, and teaching — not real security.
Looking for more developer utilities? Browse the rest of our dev tools, or see the full library on the all calculators page.