Quick access

Saved in this browser. Sign in to keep it on all your devices.

Caesar Cipher

Encrypt and decrypt text using Caesar cipher.

Input Text
Output Text
Quick Shift:
Version 1.1 Updated What's new

Release notes

  1. v1.1 Latest
    • Added an in-depth guide below the tool, written from what the tool actually does.
    • The shift is now treated as a number, so encoding and then decoding gives back the original text.

About the Caesar Cipher

The Caesar cipher shifts each letter of the alphabet by a fixed number. With a shift of 3, A becomes D and B becomes E. It is named after Julius Caesar, who used it in his letters.

How to use it

  1. 1 Type your message.
  2. 2 Choose a shift from 1 to 25.
  3. 3 Encrypt or decrypt and copy the result.

Frequently asked questions

What is ROT13?

ROT13 is a Caesar cipher with a shift of 13. Because the alphabet has 26 letters, applying ROT13 twice gives back the original text.

Is the Caesar cipher secure?

No. There are only 25 possible shifts, so anyone can try them all in seconds. Use it for puzzles and learning, not for real secrets.

Are numbers and punctuation changed?

No. Only letters are shifted; numbers, spaces, and punctuation stay the same.

The arithmetic behind the shift

Number the alphabet from A = 0 to Z = 25. Encrypting a letter x with key k gives (x + k) mod 26, and decrypting gives (x − k) mod 26. The mod 26 wraps the alphabet into a circle, so with a shift of 3 the letter Y (24) becomes 27 mod 26 = 1, which is B.

Plain:   H  E  L  L  O
Number:  7  4 11 11 14
+3:     10  7 14 14 17
Cipher:  K  H  O  O  R

This tool keeps capitals as capitals and leaves digits, spaces and punctuation alone. Accented letters such as é are also left unchanged, since the cipher is defined only over the 26 basic Latin letters.

What Suetonius recorded

The Roman biographer Suetonius wrote that Julius Caesar replaced each letter with the one three places further along. He also reported that Augustus used a shift of one and, oddly, wrote AA in place of X instead of wrapping around. Both accounts date from the second century, more than 150 years after Caesar died.

Breaking one without the key

A shift of 0 or 26 changes nothing, which leaves just 25 useful keys. Press Show all shifts on this page and scan the list for the one line that reads as a language. That exhaustive approach is called a brute-force attack, and for this cipher it takes seconds by hand.

Frequency analysis needs even less effort on longer text. The ninth-century scholar Al-Kindi described counting how often each symbol appears and matching the counts to the known habits of a language. In English, E is the most common letter, so if a long ciphertext is full of H, a shift of 3 is the first thing to try.

ROT13 and its one useful trick

Since 13 is exactly half of 26, a shift of 13 undoes itself: applying it twice returns the original. Usenet readers adopted ROT13 in the 1980s to hide spoilers and punchlines from anyone who had not chosen to decode them. It conceals text from a casual glance and protects nothing.

The Vigenère cipher is the classic attempt to fix the weakness, using a keyword so that each letter gets a different Caesar shift. For real privacy today, use modern authenticated encryption such as AES-GCM, and treat this page as a way to learn or to set a puzzle.