Caesar / Shift cipher
Caesar cipher decoder
Decode a Caesar-shifted message with a known key, or compare every possible shift when the key is unknown.
Local processing: your text stays in this browser. This tool makes no network requests and stores nothing.
01 / Workspace
Decode ciphertext
Only ASCII letters A-Z and a-z are shifted. Case, spacing, line breaks, digits, punctuation, emoji, accents, and other scripts are preserved.
Enter an integer from 0 through 25. Decoding subtracts this key, so ciphertext D with key 3 becomes plaintext A.
Ready to decode.
02 / Result
Decoded text
Known-shift mode fills this result directly. In unknown-shift mode, select a candidate below to load its full text.
All 26 candidate shifts
Each number is the forward encryption shift being undone. Select a row to load its complete plaintext above.
03 / Guide
How decoding works
- Use the encryption key. If plaintext A was shifted forward by 3 to ciphertext D, enter 3. The decoder moves every ciphertext letter back by 3.
- Try every key when needed. Unknown-shift mode computes keys 0 through 25 in numeric order. Inspect the previews, then select the candidate that fits your context.
- Read modulo 26. With A as 0, plaintext is
((ciphertext - key) % 26 + 26) % 26. The added 26 makes the JavaScript remainder non-negative before the final modulo.
Known checks
- Key 3
KHOORdecodes toHELLO.- Key 13
Uryyb, Jbeyq!decodes toHello, World!.- Keys 0 and 25
AbcstaysAbcwith 0;Zabdecodes toAbcwith 25.
Limits and security
- This tool implements the conventional 26-letter ASCII alphabet only. It preserves letter case and copies every non-ASCII character unchanged.
- Browser text fields normalize CR and CRLF line endings to LF. The tool does not transliterate accented letters or shift digits.
- Input is limited to 2,000 Unicode code points. Unknown-shift mode bounds its projected work to 52,000 code points and shows compact previews; selecting a row reveals that candidate in full.
- The tool does not rank languages or guarantee that a readable candidate is correct. Very short text can have several plausible decodings, and no readable candidate may mean the input is not a Caesar cipher.
- Classical ciphers are educational and not secure. Do not use Caesar cipher output to protect passwords, personal data, or other sensitive information.