Skip to content

Caesar cipher decoder and shift encoder

Move each English letter by a chosen whole-number shift. Encode adds the shift, Decode subtracts it, and shift 13 provides ROT13.

Cipher input

Processed in your browser.

Up to 500 characters. Only English A–Z letters change; case, spaces, punctuation, numbers, and other scripts are preserved.

Any whole number. It is normalized modulo 26; 13 is ROT13.

Converted text

Enter a short message, then select Convert.

How to use the Caesar cipher translator

  1. Enter a short message, choose Encode or Decode, and enter a whole-number shift. Positive, negative, zero, and large values are accepted.
  2. Select Convert. The value is reduced modulo 26, so shift 29 behaves like 3 and shift −1 behaves like 25.
  3. Copy result copies only the transformed message. Changing the message, direction, or shift immediately invalidates the old result.
  4. 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

Input rules and security limit

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.