Skip to content
CodeShift
Menu

Caesar Cipher — Encode, Decode & Crack

Type a message and choose a shift to encode it, or paste ciphertext to decode it. Don't know the shift? The table below tries all 25 and ranks them.

Standard: Classical shift cipher (A–Z)Reviewed October 2026 · by The CodeShift DeskHow we translate
PlaintexttoCiphertext
Brute force: the ciphertext under all 25 shifts
Click a row to use that shift. ★ = most English-like.
ShiftDecoded text

How the Caesar cipher works

A Caesar cipher replaces every letter with the letter a fixed number of places further along the alphabet, wrapping from Z back to A. With a shift of 3 the alphabet lines up like this:

PlainABCDEFGHIJKLMNOPQRSTUVWXYZ
CipherDEFGHIJKLMNOPQRSTUVWXYZABC

The Roman historian Suetonius describes Julius Caesar writing confidential letters this way: to read them, “substitute the fourth letter of the alphabet, namely D, for A, and so with the others” (Life of Julius Caesar, 56).

Worked example: HELLO with shift 3

LetterPosition (A = 0)+3Cipher letter
H710K
E47H
L1114O
L1114O
O1417R

So HELLO encodes to KHOOR. In arithmetic terms, each letter at position p becomes (p + shift) mod 26, and decoding subtracts the shift instead. A shift of 29 is the same as 3, and a shift of −3 is the same as 23 — the tool accepts any whole number and reduces it for you.

Cracking a Caesar cipher

There are only 25 useful shifts, so the fastest attack is to try them all. Paste a message into the Ciphertext box and the brute-force table shows every possibility at once. Here is part of that table for the ciphertext XPPE XP LE ESP ZWO ZLV ECPP LE YZZY:

ShiftDecoded
9OGGV OG CV VJG QNF QCM VTGG CV PQQP
10NFFU NF BU UIF PME PBL USFF BU OPPO
11MEET ME AT THE OLD OAK TREE AT NOON
12LDDS LD ZS SGD NKC NZJ SQDD ZS MNNM
13KCCR KC YR RFC MJB MYI RPCC YR LMML

Only shift 11 produces English. To save you scanning, the tool also scores each row by how typical its letters are of English and whether it contains very common English words, and stars the best match — here, shift 11. Scoring is reliable for a sentence or more; for very short messages, trust your eyes over the star.

Frequency analysis by hand

Without a computer, count the letters in the ciphertext. In ordinary English, E is the most common letter, followed by letters such as T, A and O. If the most common cipher letter is H, a shift of 3 (E → H) is a good first guess.

ROT13

ROT13 is the Caesar cipher with a shift of 13. Since 13 + 13 = 26, encoding twice returns the original text, which made ROT13 a popular way to hide spoilers and puzzle answers online: “Hello” ↔ “Uryyb”. It hides text from a casual glance, nothing more.

What gets shifted

Only the 26 basic Latin letters change. Upper and lower case are preserved, and spaces, digits, punctuation and accented letters pass through untouched, so the punctuation of a message survives. For a cipher that resists brute force a little longer, try the Vigenère cipher, which uses a different shift for each letter of a keyword, or the fixed mirror substitution of the Atbash cipher.

Make a cipher wheel

A classroom favourite is the cipher wheel: two paper discs, each printed with the alphabet around the edge, pinned together at the centre. Turn the inner disc until A sits under the outer letter for your shift — D for a shift of 3 — and read each plaintext letter on the outer ring straight across to the inner ring. Turning the wheel to every position in turn is the brute-force attack done by hand, and shows why 25 keys are far too few for real secrecy.

The same idea in code

In most programming languages the cipher is one line per letter: take the letter’s position (A = 0), add the shift, take the remainder after dividing by 26, and convert back to a letter, keeping the original case. This tool does exactly that and leaves every non-letter untouched, so Hello, World! 2026 with a shift of 3 becomes Khoor, Zruog! 2026.

Frequently asked questions

What is ROT13?+

ROT13 is a Caesar shift of 13. Because the alphabet has 26 letters, applying it twice gives back the original, so the same operation encodes and decodes: "Hello" becomes "Uryyb". Press the ROT13 button to set it.

How do I decode a Caesar cipher without the key?+

Paste the ciphertext into the lower box and look at the table of all 25 shifts. Only one row will read as sensible language; the tool also ranks rows by how English-like their letters and words are, and marks the most likely shift.

What shift did Julius Caesar use?+

According to the Roman historian Suetonius, Caesar’s letters could be read by substituting the fourth letter of the alphabet, D, for A — a shift of three.

Does the cipher change numbers and punctuation?+

No. Only the 26 letters A–Z are shifted; case is preserved and digits, spaces, punctuation and accented letters pass through unchanged.

Is a Caesar cipher secure?+

No. There are only 25 possible keys, so anyone can try them all in seconds. It is great for puzzles, escape rooms and teaching, but never for real secrets.

Guides

More translators