Utilia

Caesar and ROT13 Cipher

Encrypt and decrypt text with the Caesar cipher, ROT13 or ROT47, see the shifted alphabet, and crack an unknown key by testing all 25 shifts.

Alphabet with this key

Plain
Cipher

How to use the Caesar cipher tool

  1. Type or paste your text in the input box.
  2. Under Cipher, choose Caesar (choose the shift), ROT13 (letters shifted by 13) or ROT47 (letters, digits and symbols).
  3. For Caesar, set the Shift (key). Any whole number works: 3, 29 and −23 all give the same result, because the alphabet wraps around after 26 letters.
  4. Click Encrypt or Decrypt. The result updates as you type, and the table under Alphabet with this key shows which letter replaces which.
  5. Click Copy to copy the result, or Use the result as input to work on it again.

If you received a message without its key, click Find the key (try all 25 shifts). The tool decrypts the text with every key, ranks the results and highlights the most likely one. Click Use on a row to decrypt with that key.

How the Caesar cipher works

The Caesar cipher replaces each letter with the letter a fixed number of places further in the alphabet. With a shift of 3, A becomes D, B becomes E, and X wraps around to A. Decrypting shifts back by the same amount. According to Suetonius, Julius Caesar used a shift of 3 for his private correspondence, which is where the name comes from.

The tool keeps upper and lower case, and leaves digits, spaces and punctuation untouched. Accented letters, common in French, can be handled three ways under Accented letters:

  • Shift the letter, keep the accent (é → f́): the base letter is shifted and the accent stays on it. Decrypting gives back the exact original text.
  • Remove accents first (é → e → f): the result is plain A–Z text, like the classic cipher, but the accents are lost.
  • Leave accented letters unchanged: only A to Z are shifted; é, ç or à stay as they are, which gives clues to anyone reading the message.

ROT13 and ROT47

ROT13 is a Caesar shift of 13. Since the alphabet has 26 letters, applying it twice returns the original text, so encrypting and decrypting are the same operation. It has long been used on forums and in newsgroups to hide spoilers, puzzle answers or punchlines from a casual glance.

ROT47 applies the same idea to the 94 visible ASCII characters, from ! to ~, with a shift of 47. It scrambles digits and symbols as well as letters, so “Hello World!” becomes “w6==@ (@C=5P”. Like ROT13, it is its own inverse.

Cracking a Caesar cipher with frequency analysis

With only 25 possible keys, a Caesar cipher can be broken by hand in minutes. This tool tries every key and compares the letter counts of each result with the usual frequencies of English or French, using a chi-squared score: the lower the score, the closer the text is to real language. In English, E, T and A are the most common letters; in French, E, S, A and I lead. Choose the Language of the message, or leave the automatic option to test both. On messages shorter than about 20 letters, the guess can be wrong, so always check that the text reads naturally.

Not for real security

The Caesar cipher, ROT13 and ROT47 are historical and educational tools. They protect nothing: anyone can reverse them in seconds, as the key finder above shows. Use them for puzzles, escape games, classroom exercises or hiding spoilers. To protect real secrets, use modern encryption such as AES through a trusted application.

Frequently asked questions

What is the key of ROT13?

The key is 13. Because 13 is half of 26, the same operation both encrypts and decrypts.

Can I use a negative shift?

Yes. A shift of −3 is the same as a shift of 23. Encrypting with a negative key is equivalent to decrypting with the positive one.

Why does the key finder suggest the wrong key?

Frequency analysis is statistical. Very short messages, lists of names or text in another language may not follow the expected letter distribution. Look at the other highly ranked rows, or pick the right language.

Does the tool handle French accents?

Yes. By default the accent stays on the shifted letter, so a French message decrypts back with all its accents. You can also remove them or leave accented letters unchanged.

Is my text sent to a server?

No. Encryption, decryption and the key search run entirely in your browser.