InfyCalculator
💻

Caesar Cipher Encoder & Decoder

Encode or decode text with the Caesar cipher (shift cipher, ROT13): choose the shift, keep punctuation, and see every possible shift to crack an unknown key.

Text
Shift (key)
Mode
Loading calculator…

How it works

Encode: E(x) = (x + k) mod 26 · decode: D(x) = (x − k) mod 26, with A = 0, B = 1, …, Z = 25 · ROT13: k = 13 (its own inverse)

The Caesar cipher replaces each letter with the one k places further along the alphabet, wrapping around from Z to A. Julius Caesar reportedly used a shift of 3. With only 25 possible keys it offers no real security — trying every shift (the brute-force table in decode mode) or counting letter frequencies breaks it instantly — but it is the classic first example in cryptography and is still used for puzzles, geocaching and ROT13 spoilers.

Worked example

Encoding “Veni, vidi, vici” with shift 3 moves V → Y, e → h, n → q, i → l, d → g and c → f, giving “Yhql, ylgl, ylfl”. Decoding that text with shift 3 (or encoding with 23) returns the original.

Sources: Caesar cipher — Wikipedia · Suetonius, The Life of Julius Caesar, 56

Frequently asked questions

How do I decode a Caesar cipher without the key?

Choose Decode and look at the brute-force table: one of the 25 rows will be readable. Letter frequency analysis also works on longer texts.

What is ROT13?

A Caesar cipher with shift 13. Because 13 + 13 = 26, applying it twice gives back the original, so the same operation encodes and decodes.

What happens to numbers, spaces and accents?

They are left unchanged. Only the 26 basic Latin letters are shifted, and upper and lower case are preserved, so letters like ñ or é stay as they are.

Is a negative shift allowed?

Yes. A shift of −3 is the same as 23; the calculator shows the effective forward shift between 0 and 25.

Related calculators

This calculator is for educational purposes. Double-check important results before acting on them.