How to use the Caesar cipher translator
- Enter a short message, choose Encode or Decode, and enter a whole-number shift. Positive, negative, zero, and large values are accepted.
- Select Convert. The value is reduced modulo 26, so shift 29 behaves like 3 and shift −1 behaves like 25.
- Copy result copies only the transformed message. Changing the message, direction, or shift immediately invalidates the old result.
- Use shift 13 for ROT13. Because 13 is half of 26, Encode and Decode produce the same ROT13 transformation.
Caesar shift formula
Give A through Z the positions 0 through 25. Encoding uses C = (P + k) mod 26; decoding uses P = (C − k) mod 26. The modulo operation wraps Z back to A and turns any integer into one of 26 equivalent positions. A zero or multiple-of-26 shift intentionally leaves letters unchanged.
Each ASCII letter is treated independently and its case is preserved. The shift key does not advance through the message, unlike Vigenère. Spaces, punctuation, numbers, accented letters, and non-Latin scripts are passed through unchanged. This page will not try all 25 keys or guess which output is English.
Exact Caesar and ROT13 examples
With Encode and shift 3, ATTACK AT DAWN! → DWWDFN DW GDZQ!. Decode with shift 3 reverses it. Shift −23 gives the same encoded result because −23 mod 26 is 3.
With shift 13, HELLO → URYYB and a second ROT13 returns HELLO. Mixed case and punctuation remain structured: Attack at Dawn! → Dggnpx ng Qnja!.
When a shift cipher tool helps
- Solve or create classroom rotation exercises, check hand calculations, and decode text when the exact shift is already known.
- Handle Caesar cipher, shift cipher, and ROT13 tasks on one page without pretending that related search terms are separate algorithms.
Input rules and security limit
- The shift must be a safe whole number. Decimals, scientific notation, and blank shifts are rejected instead of rounded or guessed.
- Caesar has only 26 effective shifts and offers no modern confidentiality. The page does not brute-force keys, score language, store input, or protect sensitive information.
Caesar cipher FAQ
What is the difference between Encode and Decode?
Encode adds the normalized shift to each letter; Decode subtracts the same shift.
How do negative or large shifts work?
They are normalized modulo 26. For example, −1 equals 25 and 29 equals 3.
Is ROT13 a separate cipher here?
It is the Caesar cipher with shift 13. It is self-inverse, so the same result appears in either direction.
Can the decoder find an unknown key?
No. Enter the key you know; automatic key search and likely-plaintext ranking are outside this tool.