Solved.tools โ€” Free Online Calculators & Tools

We use cookies for analytics and advertising. Learn more about our cookie policy

Caesar Cipher Decoder & Encoder

Last updated: 21 August 2026

Reviewed by Gavin ยท Research and drafting assisted by AI

NKRRU CUXRJ
11 characters ยท to decode, try every shift 1โ€“25 below โ€” exactly one row will read as plaintext
All 25 shift variants (look for the readable one)

Every Caesar shift from 1 to 25 applied to your current input. When you are decoding unknown ciphertext, scroll this list and read each row โ€” the plaintext will jump out at you. Click Use on any row to load it back into the input box.

ShiftResultย 
+1LIPPS ASVPH
+2MJQQT BTWQI
+3NKRRU CUXRJ
+4OLSSV DVYSK
+5PMTTW EWZTL
+6QNUUX FXAUM
+7ROVVY GYBVN
+8SPWWZ HZCWO
+9TQXXA IADXP
+10URYYB JBEYQ
+11VSZZC KCFZR
+12WTAAD LDGAS
+13XUBBE MEHBT
+14YVCCF NFICU
+15ZWDDG OGJDV
+16AXEEH PHKEW
+17BYFFI QILFX
+18CZGGJ RJMGY
+19DAHHK SKNHZ
+20EBIIL TLOIA
+21FCJJM UMPJB
+22GDKKN VNQKC
+23HELLO WORLD
+24IFMMP XPSME
+25JGNNQ YQTNF
Letter mapping at shift = 3 (Aโ€“Z)

Each uppercase letter maps to the letter 3 positions ahead (with wrap from Z back to A). Lowercase letters follow the same rule independently.

Aโ†’D
Bโ†’E
Cโ†’F
Dโ†’G
Eโ†’H
Fโ†’I
Gโ†’J
Hโ†’K
Iโ†’L
Jโ†’M
Kโ†’N
Lโ†’O
Mโ†’P
Nโ†’Q
Oโ†’R
Pโ†’S
Qโ†’T
Rโ†’U
Sโ†’V
Tโ†’W
Uโ†’X
Vโ†’Y
Wโ†’Z
Xโ†’A
Yโ†’B
Zโ†’C
ROT13 letter mapping (Aโ€“M) โ€” the most common special case

ROT13 is shift = 13, exactly half the alphabet, so it is self-inverse (applying it twice returns the original). The first 13 letters map to the second 13 and vice versa.

Aโ†”N
Bโ†”O
Cโ†”P
Dโ†”Q
Eโ†”R
Fโ†”S
Gโ†”T
Hโ†”U
Iโ†”V
Jโ†”W
Kโ†”X
Lโ†”Y
Mโ†”Z
Worked examples (hand-verified)
ShiftInputOutput
+3HELLOKHOOR
+25HELLOGDKKN
+3Hello, World!Khoor, Zruog!
+7ATTACK AT DAWNHAAHJR HA KHDU
+13Hello, World!Uryyb, Jbeyq!
+8Caesar cipher: 123, hello!Kimaiz kqxpmz: 123, pmttw!

The Caesar cipher is not encryption โ€” it is a fixed-shift substitution with no key. With only 25 possible shifts, it is trivially broken by brute force or by frequency analysis (E, T, A, O, I, N are the most common letters in English). Use it for puzzles, games, and learning โ€” not for protecting sensitive data.

Was this helpful?


Caesar Cipher Decoder & Encoder

The Caesar cipher is one of the oldest and most recognisable substitution ciphers in the Western tradition. It works by shifting every letter in the alphabet by a fixed number of positions, the original Caesar used a shift of three, so A became D, B became E, and X became A again after wrapping around. This tool is the general version: pick any shift from 1 to 25, encode plaintext, or decode ciphertext by scanning all 25 variants at once. The cipher dates back to roughly 50 BC, when Julius Caesar used it in his military dispatches; the Roman historian Suetonius describes the method in De Vita Caesarum (~121 CE). Because the Caesar cipher has only 25 possible shifts, it is trivially broken by brute force, and more elegantly by frequency analysis, but it remains a beautiful teaching example and a working tool for puzzles, games, and offline learning.

Unlike modern ciphers, the Caesar cipher has no key, no password, and no secrecy. Anyone who knows the algorithm can try all 25 shifts in seconds. That is exactly why this tool is valuable: when you are handed an unknown Caesar ciphertext, the fastest way to read it is to display all 25 candidate decodings side-by-side and let your eyes find the one that forms readable English (or whichever target language). This page explains the algorithm, the history, and the most common ways to break it, and gives you an in-browser encoder/decoder that runs in real time as you type.

How to Use This Tool

  1. Type or paste text into the input box, plaintext, ciphertext, or a mix. Anything you paste is preserved exactly: digits, punctuation, whitespace, newlines, tabs, and accented characters all pass through unchanged.
  2. Pick a shift value between 1 and 25 using the slider, the number box, or one of the preset buttons (ROT13 = 13, Caesar's original = 3). The output updates instantly.
  3. Read the output in the result box. Letters A-Z and a-z are shifted by your chosen amount; digits and punctuation are not.
  4. Decode unknown ciphertext by scrolling the All 25 shift variants table. Each row shows your input with a different shift applied; the plaintext row will be obvious at a glance.
  5. Click Use on any variant to load it back into the input box, or Copy to grab the current output to your clipboard.

The worked-examples table at the bottom of the tool gives you six hand-verified test cases, including Julius Caesar's own shift of 3 on HELLO โ†’ KHOOR, so you can sanity-check the output at a glance.

The Caesar Cipher Formula

For an uppercase letter with code point c and shift s, the encoded letter is:

c' = ((c - 'A' + s) mod 26) + 'A'

For lowercase letters, replace 'A' with 'a' and the constant 65 with 97:

c' = ((c - 'a' + s) mod 26) + 'a'

The modulo 26 keeps the result inside the 26-letter range. The shift s advances the letter by s positions, and the wrap from Z back to A is automatic: (25 + 1) mod 26 = 0, which is 'A'. Every other character, digits, spaces, punctuation, newlines, tabs, emoji, accented Latin characters, and anything outside the ASCII range A-Z / a-z, passes through unchanged because it is not in either letter range.

In one line: shift letters by s, wrap at Z, leave everything else alone. There is no key, no nonce, no integrity check, and no expansion (the output is the same length as the input). Applying the cipher a second time with shift 26 - s always returns the original text, because (s + (26 - s)) mod 26 = 0. That round-trip property is what makes the cipher symmetric: the same algorithm encodes and decodes, just by choosing the complementary shift.

Why Only 25 Shifts?

The shift value can be 0 to 25, but 0 and 26 both produce the identity (no change), so the meaningful range is 1 to 25. With only 25 possible keys, the cipher has a key space of just 25, small enough that any attacker can try all of them in milliseconds. This is the single most important property of the Caesar cipher for a defender to understand: brute force is trivial, and any secret communicated with a Caesar cipher is, in a meaningful sense, not secret at all.

Worked Examples

Example 1, Caesar's original shift of 3. Julius Caesar's dispatches used a 3-position shift. The plaintext HELLO becomes KHOOR: H (7) โ†’ K (10), E (4) โ†’ H (7), L (11) โ†’ O (14), L โ†’ O, O (14) โ†’ R (17). To decode KHOOR, shift back by 3 (equivalently, forward by 23): K โ†’ H, H โ†’ E, O โ†’ L, O โ†’ L, R โ†’ O. The general form is encode by s, decode by 26 - s.

Example 2, Full alphabet rotation. ABCDEFGHIJKLMNOPQRSTUVWXYZ shifted by 3 yields DEFGHIJKLMNOPQRSTUVWXYZABC. The alphabet cleanly splits into "before wrap" (A, B, C โ†’ D, E, F) and "after wrap" (X, Y, Z โ†’ A, B, C). Lowercase letters follow the same rule independently: abcdefghijklmnopqrstuvwxyz becomes defghijklmnopqrstuvwxyzabc.

Example 3, Mixed content. The phrase Caesar cipher: 123, hello! shifted by 8 produces Kimaiz kqxpmz: 123, pmttw!. Note that the digits 123, the comma, the colon, the space, and the exclamation mark all pass through unchanged, only the letters rotate. The output length is identical to the input length.

Example 4, Military-style message. A classic classroom example is ATTACK AT DAWN. With shift 7, this becomes HAAHJR HA KHDU. To an attacker who does not know the shift, scanning the 25 variants reveals exactly one readable row (ATTACK AT DAWN at shift -7 = +19). Frequency analysis makes the break even faster on a longer message.

Example 5, ROT13 round-trip. Because 13 is exactly half the alphabet, applying shift 13 twice returns the original. Hello, World! โ†’ Uryyb, Jbeyq! โ†’ Hello, World!. This is the unique property that makes ROT13 self-inverse, and it is why ROT13 is the most widely-used modern Caesar variant, you can use the same algorithm to encode and decode, and the same tool works for both.

Example 6, Wrap-around at Z. The lowercase word xyz shifted by 3 yields abc: x (23) + 3 = 26 โ†’ 0 โ†’ a; y (24) + 3 = 27 โ†’ 1 โ†’ b; z (25) + 3 = 28 โ†’ 2 โ†’ c. The wrap is automatic, no special case is needed beyond the modulo.

Where the Caesar Cipher Shows Up

Puzzles and games. Escape rooms, scavenger hunts, and puzzle-box apps frequently use Caesar shifts because they are easy to teach, easy to solve by hand, and visually distinctive. "Decode this message" clues in puzzle books are often Caesar shifts with the unknown shift value hinted at by the story ("Julius sent this" usually means shift 3).

Capture-the-flag (CTF) competitions. Beginner cryptography challenges in CTF competitions frequently start with a Caesar shift or ROT13 as the very first layer. The standard approach is to brute-force all 25 shifts and visually inspect the candidates, exactly what the All 25 shift variants table in this tool is designed for.

Cryptography education. Every introduction to classical cryptography uses the Caesar cipher as the first example because it captures the essential idea of substitution without requiring keys, modular arithmetic, or any modern infrastructure. Students learn about monoalphabetic substitution, key space size, brute force, and frequency analysis by attacking a Caesar cipher with pencil and paper.

Roman military history. Julius Caesar used a shift-3 cipher for military messages around 50 BC, as recorded by Suetonius in De Vita Caesarum (~121 CE). Augustus, Caesar's successor, used a similar but slightly different scheme (according to Suetonius, he used Aโ†’B, Bโ†’C, etc., with no shift on X). The cipher is named after Caesar because his was the first documented Western military use of the technique.

Online spoiler tags (ROT13 only). The special case of shift 13 is still used to hide plot spoilers on Reddit, Usenet, and various forums. Because ROT13 is self-inverse, the same tool that hides a spoiler also reveals it, readers who want the surprise can decode instantly; everyone else sees gibberish.

Programming and easter eggs. Some software uses ROT13 (or other small shifts) to obfuscate profanity-filtered strings, joke answers, or configuration constants that should not be immediately human-readable. The Unix tr command-line tool has supported ROT13 since the early BSD releases, and several programming languages ship with built-in ROT13 helpers.

Email address obfuscation. Some websites encode email addresses as ROT13 in their HTML source, then decode them with a small JavaScript snippet, hoping to confuse simple email-scraping bots. Modern scrapers catch up, but the technique is still common enough to be worth recognising when you see encoded text in a webpage.

Brute Force: Why 25 Tries Is All It Takes

Because there are only 25 non-trivial shift values, an attacker can break any Caesar ciphertext by trying all 25 possibilities and checking which one yields readable text. There is no shortcut needed for short messages, just look at each candidate and pick the one that looks like English. This tool's All 25 shift variants table does exactly that: it shows the result of every possible shift applied to your input, so you can spot the plaintext by eye. For longer messages, frequency analysis is even faster.

Frequency Analysis: A More Elegant Break

For ciphertext longer than roughly 100 letters, frequency analysis breaks a Caesar cipher in seconds without trying all 25 shifts. The idea is simple: in normal English text, the letter E appears about 12.7% of the time, T about 9.1%, A about 8.2%, O about 7.5%, and I about 7.0%. After a Caesar shift, those frequencies move, E becomes whatever letter is shift positions ahead of E, but the shape of the distribution (one tall bar, two medium ones, many short ones) is preserved. The attacker computes the frequency histogram of the ciphertext, slides it against the known English distribution, and the shift that lines up the tallest bar with E is the key.

In practice, the attacker only needs the most frequent letter. If H is the most common letter in the ciphertext, the shift is H - E = 3. Caesar's original shift of 3 makes this very fast to demonstrate on any textbook example. Frequency analysis was the breakthrough that broke monoalphabetic substitution ciphers across Europe during the Arab Golden Age (Al-Kindi, A Manuscript on Deciphering Cryptographic Messages, ~850 CE) and again in Renaissance Europe.

ASCII vs Unicode

The Caesar cipher as implemented here operates on ASCII letters A-Z (code points 65 to 90) and a-z (code points 97 to 122). Anything outside those ranges, accented Latin letters (รฉ, รผ, รฑ), Cyrillic, Greek, Han characters, emoji, mathematical symbols, passes through unchanged. This is a deliberate design choice: ASCII letters are the universal common denominator for English text, and the math is clean ((c - base + s) mod 26 works directly on integer code points).

If you need to obscure Unicode text, the Caesar cipher is the wrong tool. Consider ROT47 (which shifts 94 printable ASCII characters, codes 33 to 126, by 47), Base64 (which encodes any binary data as text), or a Unicode-aware cipher. For cryptographic protection of any modern data, use a real cipher like AES-GCM, ChaCha20-Poly1305, or a modern password-based KDF, never a Caesar shift.

ROT13: The Special Case

ROT13 is the Caesar cipher with a shift of exactly 13. The number 13 is half the alphabet (26 / 2 = 13), which makes ROT13 self-inverse: applying it twice returns the original. This is why ROT13 is so popular for hiding spoilers, the same operation encodes and decodes, no separate key needed, no separate decode button. To get plaintext from ROT13 ciphertext, just apply ROT13 again.

ROT13 became a standard on Usenet in the early 1980s as a way to obscure spoilers and potentially offensive content in newsgroup posts. From there it spread to BBS systems, early internet forums, and eventually Reddit, where ROT13-style spoiler tags are still common. The Unix tr 'A-Za-z' 'N-ZA-Mn-za-m' command is the canonical one-liner and has been part of the BSD distribution since the 1980s.

If you only ever need ROT13, a dedicated ROT13 tool will be slightly faster than this general Caesar tool. But if you want to encode with a non-13 shift, decode unknown Caesar ciphertext, or teach the broader family, the general Caesar cipher is the right place to start. ROT13 is one row of this tool's 25-row variant table.

Common Mistakes

Confusing Caesar with encryption. A Caesar shift has no key, only 25 possible values, and is broken by brute force in milliseconds. It is a substitution cipher, not encryption. Use it for puzzles, teaching, and offline learning, never for passwords, personal data, or anything that needs to stay confidential.

Applying shift 0 or 26. Shift 0 returns the input unchanged; shift 26 also returns the input unchanged (one full revolution). This tool clamps to 1 to 25 to avoid the identity "cipher".

Forgetting case. A and a are different letters. ROT13 keeps the uppercase and lowercase streams independent, so a โ†’ n and A โ†’ N. If you upper-case the input before encoding, you still get the right answer, but if you mix cases randomly, the case is preserved independently.

Assuming non-letter characters are encrypted. Standard Caesar only touches letters. Digits, punctuation, spaces, and newlines pass through unchanged. If you see encoded text where digits or punctuation also rotate, you are looking at a different cipher (ROT47, ROT5, or a general ASCII shift).

Reading encoded text as gibberish. When you see a string like KHOOR ZRUOG, do not assume it is random, try shift 23 (or just scan all 25 variants) and it almost certainly becomes HELLO WORLD. Always assume Caesar first when you see a short all-uppercase Latin string that does not look like real text.

Trying to extend to Unicode naively. Wrapping Unicode code points by mod 26 does not produce a Caesar cipher, accented letters, emoji, and Han characters do not map cleanly onto a 26-letter alphabet. For Unicode, use a Unicode-aware cipher or ROT47 instead.

Frequently Asked Questions

What is the Caesar cipher in one sentence? A fixed-shift substitution cipher that rotates every letter in the Latin alphabet by the same number of positions (1 to 25) and leaves digits, punctuation, and whitespace unchanged. Julius Caesar used shift 3 for military messages around 50 BC.

How does the Caesar cipher work? Each letter in the plaintext is replaced by the letter a fixed number of positions ahead in the alphabet. Shift 3 turns A into D, B into E, โ€ฆ X into A (with wrap). Decoding is the same operation with the complementary shift: encode by 3, decode by 23 (or 26 - 3 = 23).

How do I decode a Caesar cipher when I don't know the shift? Try all 25 possible shifts and pick the one that yields readable text. This tool's All 25 shift variants table does exactly that, it shows your input with every shift applied, so you can spot the plaintext by eye. For longer messages, frequency analysis finds the shift in seconds: identify the most common letter in the ciphertext, and the shift is that letter's distance from E.

Is the Caesar cipher the same as ROT13? ROT13 is the Caesar cipher with shift 13. Because 13 is exactly half the alphabet, ROT13 is self-inverse, applying it twice returns the original. The general Caesar cipher allows any shift from 1 to 25; ROT13 is just one of the 25 possibilities.

Who invented the Caesar cipher? Julius Caesar used a shift-3 cipher for military dispatches around 50 BC. The Roman historian Suetonius records the method in De Vita Caesarum (~121 CE). The cipher is named after Caesar because his was the first documented Western military use of the technique. The earlier Greek writer Polybius (~150 BC) described a different substitution scheme (the Polybius square).

Is the Caesar cipher secure? No. With only 25 possible keys, brute force takes milliseconds, and frequency analysis finds the key in seconds on any message longer than roughly 100 characters. Use AES-GCM, ChaCha20-Poly1305, or a modern password-based KDF for anything that needs real confidentiality. The Caesar cipher is for puzzles and teaching, not for security.

What is the difference between the Caesar cipher and ROT47? The Caesar cipher shifts only ASCII letters A-Z and a-z (52 characters) by a value from 1 to 25. ROT47 shifts 94 printable ASCII characters (code points 33 through 126) by 47, including digits, punctuation, and common symbols. ROT47 is useful when you need to obscure digits or punctuation, which the standard Caesar cipher leaves alone.

Does the Caesar cipher work on numbers and punctuation? No. Standard Caesar only touches the 26 uppercase and 26 lowercase Latin letters. Digits (0 to 9), punctuation (.,!?;:), whitespace, newlines, tabs, and Unicode characters all pass through unchanged. To obscure digits, use ROT5; to obscure punctuation, use ROT47.

What is the key space of the Caesar cipher? 25, the number of non-trivial shifts. This is why the cipher is so weak: an attacker can try all 25 possibilities in microseconds. Even with a billion-dollar budget, no technology makes a Caesar cipher secure, because the key space is fixed at 25 by the algorithm itself.

Why is the Caesar cipher still taught? It captures every essential idea of substitution cryptography, mapping, key space, brute force, frequency analysis, without requiring modular arithmetic beyond single-digit mod 26, without tables, and without keys. It is the simplest possible example that still demonstrates real attacks, which is why it is the first cipher in every cryptography textbook.

Can I use the Caesar cipher for passwords? No, never. Caesar shifts are instantly reversible and provide zero security. For passwords, use a modern password manager with a strong master password, and store passwords hashed with Argon2id or bcrypt on the server. A Caesar-shifted password is not a password, it is a 5-bit hint at most.

Q: Can the Caesar Cipher Decoder & Encoder be used for professional or commercial purposes? A: Yes, the Caesar Cipher Decoder & Encoder provides mathematically correct results that are suitable for professional, commercial, and educational use. For the Caesar Cipher Decoder & Encoder, For the Caesar Cipher Decoder & Encoder, For high-stakes applications (medical, legal, financial), verify results with a domain expert. For the Caesar Cipher Decoder & Encoder, the Caesar Cipher Decoder & Encoder formulas used are well-established and validated against reference standards.

Q: How often are the Caesar Cipher Decoder & Encoder formulas updated? A: the Caesar Cipher Decoder & Encoder formulas are based on established scientific, mathematical, or industry-standard references and rarely require updates. when standards change, the Caesar Cipher Decoder & Encoder is updated to reflect the current authoritative source.

References

  • Suetonius, De Vita Caesarum (~121 CE): the Roman historian's biographies of the Caesars, including the passage describing Julius Caesar's shift-3 cipher for military dispatches. The canonical historical source for the cipher's origin.
  • David Kahn, The Codebreakers (1996): the standard history of classical and modern cryptography, including the Caesar cipher, frequency analysis, and the Arab Golden Age breakthroughs.
  • Al-Kindi, A Manuscript on Deciphering Cryptographic Messages (~850 CE): the earliest known description of frequency analysis, the technique that broke monoalphabetic substitution ciphers across the Mediterranean world.
  • RFC 20: ASCII format for Network Interchange (1969): the standard that defines the English alphabet code points (65 to 90 for A-Z, 97 to 122 for a-z) that the Caesar cipher operates on.
  • Dennis Ritchie and Ken Thompson, Unix Man Page: tr(1) (1971): documentation of the Unix tr command, which has included ROT13 since the early BSD releases.
  • Alfred J. Menezes, Paul C. van Oorschot, and Scott A. Vanstone, Handbook of Applied Cryptography (1996): the modern reference for cryptographic techniques, including frequency analysis and the limits of monoalphabetic substitution.