Caesar Cipher

Characters—

How Caesar Cipher is calculated: Each letter shifts forward by the shift amount, wrapping at Z: Hello with shift 3 is Khoor. Decrypt shifts back by the same amount. Case is preserved; other characters stay unchanged.

What is a Caesar cipher?

A Caesar cipher shifts every letter in your text forward by a fixed number of places. With a shift of 3, A becomes D, B becomes E, and X becomes A, because the alphabet wraps around at the end. The default text on this page — Hello with a shift of 3 — becomes Khoor, with 5 characters, and decrypting Khoor with the same shift gives Hello back.

The cipher is named for Julius Caesar, who used it to send military orders. It is the oldest substitution cipher still taught today, and the simplest cipher there is: one number, one rule, and every letter moves the same distance. The need now is the same as it was then — puzzles, games, and learning how ciphers work.

This tool encrypts and decrypts live as you type. Pick a shift from 0 to 25, pick Encrypt or Decrypt, and the result appears at once. Everything runs in your browser — your text never leaves your device, nothing is stored, and there is no account to create.

How a Caesar cipher works

Each letter moves forward by the shift amount, wrapping from Z back to A. With a shift of 3, H moves to K, e moves to h, l moves to o, and o moves to r — so Hello becomes Khoor. The shift is the same for every letter, and it never changes a letter's case: a capital H becomes a capital K, and a small e becomes a small h.

Numbers, spaces, and punctuation are left alone. Hello has 5 letters and no other characters, so the result has the same 5 characters, only shifted. That is why the character count on this page never changes with a Caesar cipher — the output is always exactly as long as the input, whatever the shift.

Decrypting is the same rule in reverse: each letter moves back by the shift amount. Decrypting Khoor with a shift of 3 moves K back to H, h back to e, and o back to l, giving Hello. A shift of 0 changes nothing, and a shift of 26 would be a full circle — which is why the shift only runs from 0 to 25.

The shift: the one number that matters

The shift is the whole cipher. A shift of 3 is the classic Caesar shift, the one Julius Caesar used, and the one on this page by default. A shift of 13 is ROT13, the special case where encrypting and decrypting are the same operation, because 13 is half of 26. A shift of 1 moves every letter one place — A becomes B, and the text is barely hidden.

Small shifts are easy to break by eye, and large shifts are no harder — there are only 25 possible shifts, so anyone trying to read a Caesar message can try them all in a minute. A shift of 3 and a shift of 20 are equally weak; the number only changes the answer, not the strength. The default shift of 3 turns Hello into Khoor, and a shift of 13 turns it into Uryyb.

The shift box on this page takes any whole number from 0 to 25. A shift of 0 leaves the text unchanged, which is useful for checking that the tool works. A shift of 25 moves every letter back one place — Ab becomes Za — which is the same as decrypting with a shift of 1. A base64 encoder decoder does a different kind of letter work for data, turning bytes into safe text.

Breaking a Caesar message by hand is a lesson in itself. Because there are only 25 shifts, the attacker tries each one and reads the results until one of them is English — a method called brute force, and the reason the cipher fell out of military use centuries ago. A longer message is even easier to break, because letter frequency gives the shift away: the most common letter in the coded text is usually E, shifted by the same amount as every other letter.

A worked example: Hello with a shift of 3

Take the default text exactly as it sits on the page: Hello, shift 3, mode Encrypt. It is 5 characters long. The result is Khoor — also 5 characters, because a Caesar cipher never changes the length. H moves 3 places to K, e moves to h, l moves to o, and o moves to r.

Now switch the mode to Decrypt and paste Khoor back in, keeping the shift at 3. The result is Hello, the original text, because decrypting moves each letter back 3 places. That is the whole round trip: encrypt with a shift, decrypt with the same shift, and the text comes back.

Try two more shifts. Hello with a shift of 13 becomes Uryyb — the ROT13 of Hello. Hello with a shift of 0 stays Hello, because a shift of 0 moves nothing. And Ab with a shift of 25 becomes Za, because A wraps back to Z and b wraps back to a. A password generator makes real secrets the way a Caesar cipher makes a puzzle, and a random number generator can pick a shift for you.

Who uses a Caesar cipher, and why

Teachers are the biggest users. A Caesar cipher is the first cipher most pupils meet, because it needs only the alphabet and one number. A teacher who sets a coded message with a shift of 3 gives the class a puzzle they can solve by hand in a lesson.

Puzzle makers are the second group. Treasure hunts, escape rooms, and puzzle books all hide messages in a Caesar cipher, because the solver needs no key beyond the shift — and the shift can be hidden in the puzzle itself, as a clue or a number on a wall.

History lovers are the third group. The cipher is two thousand years old, and using it is a way of touching that history. The tool on this page handles all three uses — type, pick a shift, copy — which covers most of what anyone needs.

Scouts and code clubs are a fourth group, and they use the cipher for games and badges. A coded message pinned to a noticeboard, a shift number hidden in a clue, a race to decode a paragraph first — the cipher is simple enough for a child to use and old enough to feel like real history. A shift of 3 is the usual starting point, because it is the shift Caesar himself used.

Caesar cipher vs ROT13

A Caesar cipher and ROT13 are the same idea with one difference: the shift. ROT13 always shifts 13 places, and a Caesar cipher shifts by any number from 0 to 25. A shift of 13 in this tool is exactly ROT13, and a shift of 3 is the classic Caesar shift.

The same text-tools family on this site does the nearby jobs. A base64 encoder decoder turns data into safe text, and a password generator makes secrets that cannot be guessed. ROT13 is a fixed-shift Caesar cipher with no mode to pick; this tool adds the shift and the mode.

The practical rule is simple: use ROT13 when the shift does not matter and you want one button, and use this tool when the shift is part of the puzzle — a clue that says shift 7, a code that changes every day, or a lesson about how ciphers work.

Common Caesar cipher mistakes

The most common mistake is thinking a Caesar cipher is secure. It is not. There are only 25 possible shifts, so anyone trying to read the message can try them all in a minute. Never use a Caesar cipher for a password, a private note, or anything secret.

Second: forgetting the mode. Encrypting with a shift of 3 and then encrypting again gives a shift of 6, not the original. To undo an encryption, switch to Decrypt with the same shift. Encrypting twice is a different cipher, not a round trip.

Third: expecting the cipher to hide numbers. It only moves letters. A message with a date or a code number in it keeps the numbers in plain sight, because digits pass through unchanged. If the numbers matter, a Caesar cipher does not hide them.

Fourth: using a shift outside 0 to 25. A shift of 26 is a full circle and changes nothing, and a shift of 29 is the same as a shift of 3. The box on this page only takes 0 to 25, so the shift you pick is always the shift that applies.

How to use this Caesar cipher

Using this tool is simple. Type or paste your text into the box — the default is Hello. Set the shift — 3 is the default, and it is the classic Caesar shift. Pick Encrypt to hide the text or Decrypt to show it. The result appears instantly in the output box, with its character count shown above it.

To decode a message, paste it in, set the shift it was made with, and pick Decrypt. To try another shift, change the number and watch the output change. The character count never changes, because a Caesar cipher only moves letters and never adds or removes characters.

Everything runs in your browser. No sign-up, no account, no data sent anywhere — your text never leaves your device. It works offline once the page has loaded, so you can use it in a classroom or anywhere else you solve a puzzle. Try it with something real before you need it: encode a sentence with a shift of 3, then decode it back. For a key-based cipher instead of a fixed shift, try the text encryptor.

Frequently Asked Questions

No. There are only 25 possible shifts, so anyone trying to read a Caesar message can try them all in a minute. Use it for puzzles, games, and lessons only, never for passwords, private messages, or anything secret.

ROT13 is a Caesar cipher with a fixed shift of 13. This tool lets you pick any shift from 0 to 25 — a shift of 3 is the classic Caesar shift, and a shift of 13 is exactly ROT13. With ROT13, encrypting and decrypting are the same step; with other shifts, you need the mode.

Because decrypting moves each letter back by the shift amount. Hello encrypted with a shift of 3 is Khoor, and Khoor decrypted with a shift of 3 is Hello. Decrypting with a different shift gives a different, wrong text — Khoor decrypted with a shift of 5 is Fcjjm.

No. It only moves the 26 letters of the English alphabet, keeping their case. Numbers, spaces, and punctuation pass through unchanged, and the output is always exactly as long as the input.

More free tools

More calculators and utilities from Sortrun — free, no sign-up.