Caesar Cipher Tool

Encode or decode a Caesar cipher, the 2,000-year-old letter-shift cipher, with any shift in your browser. It is a puzzle tool and offers no 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. This is 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. Your browser does all the work.

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.

People use it for puzzles, escape-room clues, classroom demonstrations and word games, where a scramble anyone can reverse is fine and protection does not matter.

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 the reverse shift. If you encoded with a shift of 3, decode with a shift of minus 3, or with 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 and anyone can try them all in moments, so treat it as a puzzle.

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 25 non-zero shifts, so an attacker can try them all (a brute-force attack) or use letter-frequency analysis to crack a Caesar cipher in moments.
  • ROT13: The Caesar cipher with a shift of 13. Because 13 is half of 26, encoding and decoding are the same operation. The separate ROT13 tool is built on this.

Accuracy and limits

The tool applies the standard shift, so its 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) stays visible.

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

The tool normalises the shift, so negative and large values work as expected (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.

Where people use it

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 it fits, and when it doesn't

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 that needs real 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 with 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 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 in your browser and sends nothing to a server. Since the cipher is not secure anyway, this matters less than it would for real encryption.
Why is it called a substitution cipher?
Because each letter is swapped for another by a fixed rule, here a shift by a set amount. The alphabet is relabelled, and that is what lets frequency analysis work 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 real protection, use modern encryption instead of combining classical ciphers.

References

Shifts each letter by the amount you choose. The Caesar cipher has only 25 possible shifts and can be broken in seconds, so the page presents it for puzzles and learning, not secrecy.

PopularHot

Password Generator

A random password at the length and character mix you set.

SecurityOpen
Popular

Password Strength Checker

An entropy estimate in bits, with tips to make it stronger.

SecurityOpen
Popular

Random Number Generator

Whole numbers in any range from a cryptographic source.

SecurityOpen
Trending

SHA-256 Hash Generator

The SHA-256 hash of any text, computed in your browser.

SecurityOpen
Trending

Passphrase Generator

Random words joined into a passphrase you can remember.

SecurityOpen

MD5 Hash Generator

The MD5 checksum of any text.

SecurityOpen

Back to the Caesar Cipher Tool

Your browser generates and checks everything locally, so nothing secret is sent. No account needed.