Caesar Cipher Decoder & Encoder

Decode or encode any Caesar shift cipher instantly. Brute-force all 26 shifts, rank by English score, use the cipher wheel. Free, in-browser, no signup.

Advertisement

Free Online Caesar Cipher Decoder, Encoder & Translator

This Caesar cipher decoder translates shifted text back into readable English — and encodes plaintext into ciphertext just as fast. Paste your message, pick a shift from 0 to 25, and the output updates as you type. If you do not know the key, the tool brute-forces all 26 shifts automatically and ranks them so the correct plaintext usually sits at the top of the list. Everything runs in your browser: nothing is uploaded, nothing is logged, and there is no signup.

A Caesar cipher (also spelled “cypher”, and often called a shift cipher) replaces every letter with another letter a fixed number of positions further along the alphabet. It is the classic starting point for cryptography courses, escape-room puzzles, geocaching clues, newspaper cryptograms, and the warm-up round of most Capture The Flag competitions. This cipher translator is built for all of those: decode, encode, brute-force, and inspect the letter statistics that give the key away.

What This Cipher Decoder Does

The tool is organised into four tabs, each solving a different part of the problem:

  • Cipher — the main encode/decode workspace. Choose Encode or Decode, set the shift, and read the result. A swap button flips input and output so you can chain operations without retyping.
  • Frequency Analysis — a chart comparing the letter frequencies in your text against standard English frequencies, plus a side-by-side list of the most common letters in your text versus the most common letters in English.
  • Brute Force — all 26 shifts computed at once, each scored for how English-like it looks. Scoring combines a common-word match count with a chi-squared test against English letter frequencies, and results are sorted best-first.
  • Cipher Wheel — an interactive, draggable wheel showing the plaintext alphabet against the shifted alphabet. Drag it and the shift value follows, which makes the “wrap-around” behaviour obvious in a way a number box never does.

Two toggles change how non-letters are handled. Preserve Case keeps uppercase and lowercase as they were instead of flattening the output. Preserve Numbers leaves digits untouched; turn it off and digits are shifted too. Punctuation, spaces, and line breaks always pass through unchanged, so the shape of the message survives. A Step-by-Step Mode walks one character at a time through the substitution, and a share button copies a permalink that encodes your text, shift, and mode into the URL.

How to Use the Caesar Cipher Translator

  1. Paste your text. Drop the ciphertext (or plaintext) into the input box. Multi-line input is fine.
  2. Pick a mode. Encode turns plaintext into ciphertext; Decode reverses it. The labels on the boxes change to match, so you always know which side you are looking at.
  3. Set the shift — or skip it. If you know the key, type it. If you do not, ignore it entirely and go to the next step.
  4. Open the Brute Force tab. Any input longer than ten characters is analysed automatically. Scan the ranked list from the top; the first line that reads as English is almost always your answer, and it tells you the shift that produced it.
  5. Confirm with frequency analysis. For longer ciphertexts, the Frequency Analysis tab is a useful sanity check: a correct decode makes the letter distribution line up with the English curve.
  6. Copy or share. Copy the output to the clipboard, or copy a shareable link that reopens the tool with the same text, shift, and mode already loaded.

How the Shift Cipher Works

Number the alphabet A=0 through Z=25. Encryption with a key of n is E(x) = (x + n) mod 26, and decryption is D(x) = (x - n) mod 26. The modulo is what makes the alphabet wrap: at a shift of 3, X becomes A, Y becomes B, and Z becomes C. Because encoding with shift n and decoding with shift 26 - n are the same operation, a “decode with 3” and an “encode with 23” produce identical output — a common source of confusion when two people compare answers.

A worked example with shift 3:

PlaintextPosition+3 mod 26Ciphertext
H710K
E47H
L1114O
L1114O
O1417R

So HELLO encodes to KHOOR. Reverse the arithmetic and KHOOR decodes back to HELLO.

ROT13 and Other Named Shifts

ROT13 is simply a Caesar cipher with a shift of 13. Because 13 is exactly half of 26, applying it twice returns the original text — encryption and decryption are the same operation. That self-inverse property is why ROT13 became the standard way to hide spoilers and punchlines on early internet forums. Set the shift to 13 here and you have a ROT13 translator; we also maintain a dedicated ROT13 cipher tool if that is all you need.

Other shifts have picked up informal names in puzzle communities — ROT5 for digits, ROT18 for a combined letters-and-digits variant, ROT47 for the printable ASCII range. Only the letter-based shifts are true Caesar ciphers; the rest extend the same idea to a larger character set. If your ciphertext resists every shift, the cipher is probably not a Caesar at all, and the cipher identifier is the faster next step.

Breaking a Caesar Cipher Without the Key

The Caesar cipher has a fatal flaw: a keyspace of 25 usable keys. A computer tries every one of them faster than you can read this sentence, which is exactly what the Brute Force tab does. For short ciphertexts — a handful of words — brute force is the only reliable approach, because there is not enough text for statistics to mean anything.

For longer messages, frequency analysis is more elegant. English letter frequencies are famously lopsided: E at roughly 12.7%, T at 9.1%, A at 8.2%, while Z, Q, and J barely register. A shift cipher does not change the shape of that distribution, it only slides it sideways. Find how far the peak has moved and you have the key. The scoring in this tool formalises that with a chi-squared statistic: for each candidate shift it measures how far the decoded text’s letter distribution sits from English, and a lower chi-squared value means a better fit. That score is combined with a count of recognisable English words so that short, statistically noisy inputs still rank sensibly.

Cases where automatic ranking struggles are worth knowing about: text that is not English, text with the spaces stripped out, proper nouns and codewords, and messages under about ten characters. In all of those, read the full brute-force list yourself rather than trusting the top row.

Where Shift Ciphers Still Get Used

  • Teaching cryptography. The Caesar cipher introduces plaintext, ciphertext, keys, keyspace, and cryptanalysis in one small package before anything harder is attempted.
  • CTF challenges. Introductory rounds routinely wrap a flag in a shift so competitors have to recognise the pattern and decode it.
  • Puzzles and games. Escape rooms, geocaches, ARGs, and printed cryptograms all lean on shift ciphers for their entry-level difficulty tier.
  • Trivial obfuscation. Hiding an email address from a naive scraper, or lightly masking a string in non-sensitive code. Encoding — not encryption — is usually the better fit here; see the Base64 encoder and decoder.

What it should never be used for is protecting anything real. A Caesar cipher offers no security against a computer, or against a patient human with a pencil. If you have arrived here because you need to protect data, look at proper cryptographic tooling in our security tools collection instead.

Frequently Asked Questions

How do I decode a Caesar cipher if I don’t know the shift?

Paste the ciphertext and open the Brute Force tab. All 26 shifts are generated and ranked by how English-like each result is, using common-word matching plus a chi-squared comparison against English letter frequencies. Read down from the top and the readable line is your plaintext.

What is the difference between a Caesar cipher and ROT13?

ROT13 is one specific Caesar cipher — the one with a shift of 13. A Caesar cipher can use any shift from 1 to 25. ROT13 is special only because 13 is half of 26, which makes encoding and decoding the same operation.

Does the tool handle numbers, punctuation, and capital letters?

Yes. Punctuation, spaces, and line breaks always pass through untouched. Preserve Case keeps your original capitalisation, and Preserve Numbers leaves digits alone — switch it off if you want digits shifted as well.

Is my text sent to a server?

No. All encoding, decoding, brute-forcing, and frequency analysis happens in your browser using JavaScript. The text never leaves your device. The only exception is the optional share link, which encodes your text into a URL that you choose to copy and send.

Why does “decode with 3” give the same result as “encode with 23”?

Because shifting backwards by 3 and forwards by 23 land on the same letter in a 26-letter alphabet. Both are valid descriptions of the same transformation, which is why puzzle answers sometimes quote a key that looks like the complement of the one you used.

My text won’t decode at any shift — what now?

It is probably not a Caesar cipher. Try the cipher identifier, which suggests likely cipher types, or go straight to a substitution cipher solver or the Vigènere cipher tool if a keyword-based cipher is suspected.

Can a Caesar cipher be considered secure?

No. With only 25 possible keys it can be broken exhaustively in milliseconds, and frequency analysis often reveals the key on the first guess for anything longer than a sentence. Treat it as a puzzle and teaching device, never as protection.

Is this Caesar cipher translator free?

Yes — free, unlimited, no account, and no software to install. Like the rest of our security tools, it runs entirely client-side in your browser.

Not sure which cipher you have? Use the Cipher Identifier to auto-detect cipher types from unknown ciphertext using frequency analysis and Index of Coincidence.

What Is the Caesar Cipher

The Caesar cipher is one of the oldest and simplest encryption techniques in recorded history. Named after Julius Caesar, who reportedly used it to protect military correspondence, this substitution cipher works by shifting each letter in the plaintext by a fixed number of positions in the alphabet. With a shift of 3, the letter A becomes D, B becomes E, and so on.

While the Caesar cipher offers virtually no security against modern cryptanalysis, it remains a foundational concept in cryptography education. Understanding how it works — and why it fails — provides essential insight into the principles that underpin all modern encryption.

How the Caesar Cipher Works

The encryption function for a Caesar cipher is:

E(x) = (x + n) mod 26

Where x is the position of the plaintext letter (A=0, B=1, ..., Z=25) and n is the shift value (the key). Decryption reverses the operation:

D(x) = (x - n) mod 26

ShiftA becomesExample: "HELLO" becomes
1BIFMMP
3DKHOOR
13NURYYB (ROT13)
25ZGDKKN

The cipher has only 25 possible keys (shifts of 1-25), since a shift of 0 or 26 produces the original text. This tiny keyspace makes brute-force attacks trivial.

Common Use Cases

  • Cryptography education: Teaching the fundamentals of substitution ciphers, key spaces, and frequency analysis
  • Puzzle and escape rooms: A popular element in recreational puzzle design
  • ROT13 obfuscation: The shift-13 variant is still used on forums and social media to hide spoilers or punchlines, since applying ROT13 twice returns the original text
  • Historical study: Understanding how ancient military communications were secured and eventually broken
  • Introduction to cryptanalysis: Demonstrating why small keyspaces and letter frequency patterns make simple ciphers insecure

Why the Caesar Cipher Is Insecure

The Caesar cipher fails against even basic cryptanalytic techniques:

  1. Brute force — With only 25 possible keys, an attacker can try every shift in seconds. This tool demonstrates this by showing all 26 rotations simultaneously.
  2. Frequency analysis — In English, the letter E appears approximately 12.7% of the time. By comparing letter frequencies in the ciphertext to expected distributions, the shift value can be determined without trying all keys.
  3. Known plaintext — If any portion of the plaintext is known or guessable (common words like "the" or "and"), the key is immediately revealed.
  4. No diffusion — Each letter is encrypted independently. Identical plaintext letters always map to the same ciphertext letter, preserving patterns.

Historical Context

Julius Caesar used a shift of 3 in his personal correspondence, according to the Roman historian Suetonius. However, substitution ciphers of this type were known to Arab scholars by the 9th century, when Al-Kindi described frequency analysis as a systematic method for breaking them — making the Caesar cipher effectively obsolete over a thousand years ago.

Frequently Asked Questions

What is the Caesar cipher?+

The Caesar cipher is one of the oldest known encryption techniques, named after Julius Caesar who used it for military communications. It works by shifting each letter in the plaintext by a fixed number of positions in the alphabet. For example, with a shift of 3, A becomes D, B becomes E, and so on.

How do I decrypt a Caesar cipher without knowing the key?+

There are several methods: 1) Brute force all 26 possible shifts and look for readable text. 2) Use frequency analysis - in English, E is the most common letter, so the most frequent letter in the ciphertext likely represents E. 3) Look for common patterns like single-letter words (A, I) or common short words.

What is ROT13 and how does it relate to Caesar cipher?+

ROT13 is a specific Caesar cipher with a shift of 13. Since the English alphabet has 26 letters, applying ROT13 twice returns the original text. This makes it symmetric - the same operation encrypts and decrypts. ROT13 is often used to hide spoilers or puzzle answers online.

How secure is the Caesar cipher?+

The Caesar cipher is not secure by modern standards. With only 26 possible keys (shifts), it can be broken in seconds by trying all possibilities. It is useful for learning about cryptography and obfuscating casual text, but should never be used for protecting sensitive information.

This tool is provided for informational and educational purposes only. All processing happens in your browser — no data is sent to or stored on our servers. While we strive for accuracy, we make no warranties about the completeness or reliability of results.