Caesar Cipher

Shifts each letter a chosen number of places through the alphabet — the cipher Julius Caesar reportedly used with a shift of three. It is the simplest substitution cipher there is, which makes it perfect for teaching and puzzles and useless for secrecy.

Live demo · real result from this tool
Direction

Encoded

Phhw ph dw wkh rog eulgjh dw qrrq.

Processed on your device — nothing is uploaded.

How to use Caesar Cipher

  1. Enter your text.
  2. Choose the shift — 3 for the classical Caesar, 13 for ROT13.
  3. To decode, apply the opposite shift, or 26 minus the original.
  4. If you do not know the shift, try each one and read for sense.
  5. Only A–Z and a–z shift; digits, punctuation, spaces and other scripts pass through unchanged.
  6. A shift of 13 is self-inverse: encoding twice returns the original.
  7. A shift of 26 (or 0) changes nothing.

How it works, and the one thing to remember

Pick a shift from 1 to 25. Each letter moves that many places, wrapping from Z back to A. Case is preserved and non-letters pass through untouched. Decoding is the same operation with the negative shift, so a message encoded with 5 is decoded with 21 — or with −5, which is the same thing. A shift of 13 is ROT13, the special case where encoding and decoding are identical because 13 is half of 26.

Why it falls immediately

There are only 25 possible keys, so brute force means trying all of them and reading which one makes sense — a second by hand, instantaneous by computer. Even without brute force, frequency analysis breaks it: E is the most common letter in English by a wide margin, so whichever letter appears most in the ciphertext is almost certainly E shifted, and the key follows from one observation. Al-Kindi described this attack in the ninth century, which makes the Caesar cipher securely broken for roughly 1,200 years.

Its place in the history of cryptography

The Caesar cipher is the ancestor of every substitution cipher, and the whole subsequent history is a response to its weaknesses. The Vigenère cipher uses a different shift per letter driven by a keyword, defeating simple frequency analysis for three centuries until Kasiski broke it in 1863. The Enigma machine is a mechanised substitution cipher whose wiring changed with every keypress. The modern descendant is the one-time pad: a random shift per character, never reused, which is the only cipher with a mathematical proof of unbreakability — and is impractical precisely because the key must be as long as the message.

What it is genuinely good for

Teaching, where it makes keys, ciphertext and cryptanalysis concrete in ten minutes. Puzzle hunts, escape rooms and capture-the-flag challenges, where a shifted string is a standard first layer. Spoiler hiding, usually as ROT13. Geocaching hints, which are conventionally ROT13 so you can choose whether to read them. It is a game, and an excellent one; it is not a security control.

Frequently asked questions

What is the Caesar cipher?
A substitution cipher where each letter is shifted N positions in the alphabet. ROT13 is Caesar shift 13.
How do I decrypt a Caesar cipher without the key?
Tick Also list all 25 shifts and read down the list for the line that makes sense; it takes seconds. For longer text, frequency analysis is faster: find the most common letter, assume it is E, and the shift is the distance between them.
What shift did Caesar actually use?
Three, according to Suetonius, so A became D. His nephew Augustus reportedly used a shift of one, without wrapping — he wrote AA for Z, which is an odd variant that would not survive a modern implementation.
Is the Caesar cipher secure?
No. With 25 possible keys it falls to brute force instantly, and to frequency analysis on any text of reasonable length. It has been broken since the ninth century. Use it for puzzles and teaching, never for anything you need kept private.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close