Caesar Cipher Encoder & Decoder

Encode or decode a Caesar cipher with any shift from 1 to 25, or crack one: all 25 shifts listed and ranked by how English each looks, best guess first.

A Caesar cipher replaces each letter with the letter a fixed number of places further along the alphabet, wrapping from Z back to A. With a shift of 3, HELLO becomes KHOOR, and decoding shifts back by 3. ROT13 is the same cipher with a shift of 13, so encoding and decoding are the same step. If you don't know the shift, paste the ciphertext into the decoder: it tries all 25 shifts and ranks them by how closely each result matches English, using common letter pairs and words and a chi-squared test against English letter frequencies. You can keep the original case, spaces and punctuation, or output letters only, optionally in blocks of five, the traditional way to hide word lengths.

Quick shifts

Shift 3: each letter in the top row becomes the one below it.

PlainABCDEFGHIJKLMNOPQRSTUVWXYZCipherDEFGHIJKLMNOPQRSTUVWXYZABC

Don't know the shift? All 25 decodings

Every possible shift of the ciphertext above, most English-like first: results containing common English letter pairs and words come first, then all are ordered by a chi-squared test against English letter frequencies (lower is closer to English). Short messages can fool the ranking, so scan the list.

RankShiftDecoded textChi-squaredAction
13Best guessHello, World!28.4
26Ebiil, Tloia!24.0
314Wtaad, Ldgas!24.8
425Lipps, Asvph!60.0
512Yvccf, Nficu!62.1
622Olssv, Dvysk!69.3
710Axeeh, Phkew!93.9
819Rovvy, Gybvn!118.4
92Ifmmp, Xpsme!123.1
1013ROT13Xubbe, Mehbt!130.7
1121Pmttw, Ewztl!164.6
1223Nkrru, Cuxrj!169.6
137Dahhk, Sknhz!198.4
149Byffi, Qilfx!222.3
154Gdkkn, Vnqkc!238.9
1616Uryyb, Jbeyq!239.1
1711Zwddg, Ogjdv!247.3
1820Qnuux, Fxaum!405.9
198Czggj, Rjmgy!445.7
201Jgnnq, Yqtnf!505.4
2118Spwwz, Hzcwo!582.0
225Fcjjm, Umpjb!618.5
2317Tqxxa, Iadxp!710.2
2424Mjqqt, Btwqi!1023.7
2515Vszzc, Kcfzr!1251.5

Common use cases

  • Decode a Caesar or ROT13 clue in an escape room, geocache or puzzle hunt
  • Crack a message with an unknown shift by checking all 25 decodings at once
  • Write shifted messages for a classroom code-breaking lesson
  • Check a cipher-wheel puzzle's answer before printing it

How to use

  1. Choose Encode or Decode.
  2. Type or paste your text.
  3. Set the shift from 1 to 25. If you don't know it, use the list of all 25 shifts below the result.
  4. Choose whether to keep case and punctuation, then copy the result.

FAQ

Is the Caesar cipher secure?

No. There are only 25 possible shifts, so anyone can try them all in seconds, as this tool does. Use it for puzzles, games and teaching, not to protect real information.

What is ROT13?

ROT13 is a Caesar cipher with a shift of 13. Because 13 is half of 26, applying ROT13 twice returns the original text, so the same step both encodes and decodes.

How does the decoder pick the best shift?

It decodes the text with all 25 shifts. Results that contain common English letter pairs or words rank first, and results are then ordered by a chi-squared test: how far each one's letter counts are from typical English frequencies. Very short messages can still fool it, so scan the whole list.

Does the Caesar cipher change numbers or punctuation?

No. Only the letters A to Z are shifted. Digits, spaces and punctuation stay as they are unless you choose letters-only output.