Caesar Cipher Tool

Encode or decode a Caesar cipher with any shift — the 2,000-year-old letter-shift cipher — right in your browser. A classic puzzle tool, not real security.

Security Tools Free No upload Instant

Loading Caesar Cipher Tool…

Your browser is preparing the tool. It runs 100% locally.

Quick Answer

Pick a shift and type text, and the tool moves each letter that many places along the alphabet — the Caesar cipher, named after Julius Caesar, who used a shift of three. To decode, use the opposite shift (or 26 minus your shift). Letters wrap around the alphabet and non-letters are left alone. It is a fun puzzle and teaching cipher, but with only 25 possible shifts it offers no real security. It runs entirely in your browser.

What the Caesar Cipher Tool Does

This tool applies a Caesar cipher: each letter is shifted by the number you choose, wrapping from Z back to A. Set a positive shift to encode and the matching negative shift to decode, with everything that is not a letter left unchanged.

It is the go-to for puzzles, escape-room clues, classroom demonstrations and casual word games — anywhere you want a recognisable, easily reversible scramble rather than genuine protection.

How It Works

Each letter is converted to its position in the alphabet, the shift is added (wrapping around with modulo 26), and it is turned back into a letter. A shift of 3 turns A into D and Z into C; case is kept and non-letters pass through. The tool normalises the shift, so a negative or large number still maps into the 0 to 25 range.

Decoding is just the reverse shift. If you encoded with a shift of 3, decode with a shift of minus 3 — or equivalently 23, since 26 minus 3 is 23. ROT13 is the special case where the shift is 13, which makes encoding and decoding identical.

Data source & conversion logic

  1. Read the shift. Take the shift you set and normalise it into the 0 to 25 range.
  2. Shift each letter. Move every letter that many places along its case's alphabet, wrapping past Z.
  3. Leave the rest alone. Pass numbers, spaces and punctuation through unchanged.
  4. Return the result. Output the shifted text — use the opposite shift to decode.

Caesar shift

for each letter: new = (position − base + shift) mod 26 + base (base is A for capitals, a for lowercase; non-letters unchanged) to decode: use the negative shift, or 26 minus the shift
Worked example
Hello World, shift 3 → Khoor Zruog · decode with shift 23 → Hello World

Julius Caesar used a shift of 3. There are only 25 useful shifts, so every possibility can be tried in moments — which is why it is a puzzle, not a safeguard.

Standards & references

  • Caesar cipher — One of the earliest known substitution ciphers, attributed to Julius Caesar, who shifted letters by three to obscure military messages. It shifts the whole alphabet by a fixed amount.
  • Only 25 keys — There are just 25 non-zero shifts, so an attacker can simply try them all (a brute-force attack) or use letter-frequency analysis to crack a Caesar cipher almost instantly.
  • ROT13 — The Caesar cipher with a shift of 13. Because 13 is half of 26, encoding and decoding are the same operation — the basis of the separate ROT13 tool.

Accuracy & Limitations

The shift is applied exactly and standardly, so the output matches any correct Caesar implementation and decoding with the opposite shift always restores the original.

It affects only the 26 basic Latin letters. Numbers, punctuation and spaces are unchanged, and accented or non-Latin characters pass through, so the structure of the message — word lengths and spacing — remains visible.

It provides no meaningful security. With only 25 possible shifts, the cipher is broken by trying every shift or by frequency analysis in seconds. Treat any Caesar-encoded text as readable by anyone who cares to look.

The shift is normalised, so negative and large values behave sensibly (a shift of minus 3 equals 23, and 29 equals 3). That makes encoding and decoding symmetric, but it also means the key space stays tiny.

Real-World Use Cases

Puzzles and games

Create or solve a shift-cipher clue for an escape room or quiz.

Teaching cryptography

Demonstrate substitution, keys and brute force with a simple cipher.

Casual obfuscation

Lightly scramble text where security does not matter.

Decoding a known shift

Reverse a Caesar message when you know or guess the shift.

When to use it — and when not to

Good for

  • Puzzles, clues and word games
  • Teaching how ciphers and keys work
  • Casual, reversible scrambling
  • Decoding a Caesar message

Not the best choice for

  • Protecting private or sensitive text
  • Passwords or real messages
  • Anything needing genuine security
  • Hiding numbers (digits are unchanged)

The Caesar cipher is for fun and learning. For real confidentiality, use modern encryption with a key. For the shift-13 special case, use the ROT13 tool, which decodes itself.

Frequently Asked Questions

How do I decode a Caesar cipher?
Apply the opposite shift. If it was encoded with a shift of 3, decode with minus 3 — or equivalently 23, since 26 minus 3 is 23. If you do not know the shift, try all 25.
What shift did Julius Caesar use?
Three. He shifted each letter three places to obscure his military correspondence, which is why a shift of 3 is the classic default.
Is the Caesar cipher secure?
No. There are only 25 possible shifts, so it can be brute-forced in seconds, and letter-frequency analysis cracks it just as fast. It is a puzzle and teaching cipher, not real security.
How many possible keys are there?
Twenty-five useful shifts (a shift of 0 or 26 leaves the text unchanged). That tiny key space is exactly why the cipher is so easy to break.
What is the difference between this and ROT13?
ROT13 is a Caesar cipher fixed at a shift of 13, which makes it its own inverse. This tool lets you choose any shift, so you must decode with the matching opposite shift.
What happens to numbers and punctuation?
They are left unchanged. Only the 26 letters are shifted, so digits, spaces and symbols appear exactly as in the input.
Can I use a negative or large shift?
Yes. The shift is normalised into the 0 to 25 range, so a shift of minus 3 behaves as 23 and a shift of 29 behaves as 3. The result is always a valid Caesar shift.
How would someone crack my Caesar cipher?
By brute force — trying all 25 shifts and reading which one makes sense — or by frequency analysis, matching the most common letters to typical language patterns. Both take only moments.
Does it preserve capital letters?
Yes. Case is kept, so capitals stay capital and lowercase stays lowercase after the shift.
Is my text uploaded anywhere?
No. The cipher runs entirely in your browser. Nothing is sent to a server, though since the cipher is not secure this matters less than for real encryption.
Why is it called a substitution cipher?
Because each letter is substituted by another according to a fixed rule — here, shifting by a set amount. The alphabet is simply relabelled, which is what makes frequency analysis effective against it.
Can I combine Caesar with other methods?
You can layer it with other steps, but stacking simple ciphers does not create real security. For genuine protection, use modern encryption rather than combining classical ciphers.

References

Shifts each letter by the amount you choose; honest that the Caesar cipher has only 25 possible shifts and is broken in seconds, so it is for puzzles and learning, not secrecy.

PopularHot

Password Generator

Password Generator computed locally with Web Crypto — your secrets never leave the page.

SecurityOpen Tool
Popular

Password Strength Checker

Use Password Strength Checker for stronger security hygiene — private, instant and free.

SecurityOpen Tool
Popular

Random Number Generator

Random Number Generator computed locally with Web Crypto — your secrets never leave the page.

SecurityOpen Tool
Trending

SHA-256 Hash Generator

SHA-256 Hash Generator computed locally with Web Crypto — your secrets never leave the page.

SecurityOpen Tool
Trending

Passphrase Generator

Passphrase Generator computed locally with Web Crypto — your secrets never leave the page.

SecurityOpen Tool

MD5 Hash Generator

Use MD5 Hash Generator for stronger security hygiene — private, instant and free.

SecurityOpen Tool

Ready to try the Caesar Cipher Tool?

It is free, private and runs entirely in your browser — no sign-up, no uploads, no limits.