Encode, decode, and brute force

Caesar cipher, every shift.

Shift letters by a fixed amount with the Caesar cipher. Encode, decode, or brute force every possible shift. Non-alphabetic characters are preserved. Pure browser; no upload.

Output

The Caesar cipher, and why it is easy to break

The Caesar cipher replaces every letter with the letter a fixed number of places further along the alphabet. With a shift of 3, A becomes D, B becomes E and Z wraps around to C. The Roman historian Suetonius wrote that Julius Caesar used exactly this shift for his private letters, which is how the cipher got its name.

This tool encodes and decodes with any shift from 1 to 25, and its brute-force mode lists all 25 possibilities at once, which shows in a second why the cipher protects nothing today. It is a classic first step into cryptography, puzzles and escape rooms.

How to use it

  1. Choose Encode, Decode or Brute force.
  2. Set the shift with the slider, from 1 to 25. Brute force ignores the slider and tries them all.
  3. Type or paste the text. Upper and lower case are kept, and digits, spaces and punctuation pass through unchanged.
  4. In brute-force mode, scan the 25 lines for the one that reads as real words.

Example: Caesar's own motto, shifted by 3

Input
Veni, vidi, vici
Output
Yhql, ylgl, ylfl

Each letter moves three places: V to Y, e to h, n to q. The comma and spaces stay where they are, which already gives away the word lengths.

Breaking it

With only 25 possible keys, anyone can try them all, which is exactly what brute-force mode does. Even without trying, the cipher leaks the language underneath: the most common letter in an English ciphertext usually stands for E, and a lone one-letter word is almost always A or I. Counting letter frequencies, a method the Arab scholar al-Kindi described in the 9th century, breaks any simple substitution cipher.

ROT13 and other relatives

A shift of 13 is called ROT13. Because the alphabet has 26 letters, applying it twice gives back the original, so the same operation encodes and decodes. Online forums used it to hide spoilers and puzzle answers from accidental reading. The Vigenère cipher extends the idea with a keyword that changes the shift letter by letter; it resisted casual attack for centuries, but it is also broken today.

Use it for fun, not for secrets

Caesar ciphers are great for treasure hunts, classroom exercises, geocaching puzzles and explaining how encryption works. For anything that must stay private, use modern encryption such as AES, which has more possible keys than there are atoms in the observable universe.

Questions

Does it work with accented letters?

Only the 26 letters A to Z are shifted. Accented letters, other alphabets, digits and symbols are left as they are.

Is decoding with shift 3 the same as encoding with shift 23?

Yes. Moving back 3 places in a 26-letter alphabet lands on the same letter as moving forward 23.

Why are there only 25 shifts?

A shift of 26, or 0, leaves every letter where it is.