Caesar Cipher Calculator

Encrypt and decrypt text using the Caesar cipher. Shift letters by any amount, brute-force all 25 shifts, and learn classical cryptography basics.

1-25 (0 = no change)
Ciphertext (shift 3):
Wkh txlfn eurzq ira mxpsv ryhu wkh odcb grj
Shift Amount
3
A→D
Letter Count
35
Alphabetic characters processed
Most Common (output)
R
11.4% frequency
Likely Plaintext E
R
If decrypting, shift 13 would map this to E
Key Space
25 keys
Caesar cipher only has 25 possible shifts
Security Level
None
Trivially breakable by brute force

Letter Frequency (Output)

A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
🔵 Cipher frequency🔴 English average
Planning notes, formulas, and examples

About the Caesar Cipher Calculator

The Caesar cipher is one of the oldest and simplest encryption techniques, used by Julius Caesar to communicate with his generals. It works by shifting each letter in the plaintext by a fixed number of positions in the alphabet. With a shift of 3, A becomes D, B becomes E, and so on. Despite its simplicity, the Caesar cipher is foundational to understanding cryptography and frequency analysis.

Our Caesar Cipher Calculator lets you encrypt and decrypt messages with any shift value from 1 to 25. Enter your text, choose a shift amount, and see the encrypted or decrypted result. The tool also includes a brute-force mode that shows all 25 possible decryptions simultaneously — useful when you've intercepted a Caesar-encrypted message and don't know the shift.

Beyond basic encoding, this calculator displays letter frequency analysis, which is the primary method for breaking substitution ciphers. By comparing the frequency distribution of letters in your ciphertext to the known frequency of English letters (E is most common at ~12.7%), you can often determine the correct shift. The tool also includes the famous ROT13 variant and examples of how Caesar cipher relates to modern encryption concepts.

When This Page Helps

Learn cryptography fundamentals, solve cipher puzzles, encode fun messages, or use ROT13 to hide text spoilers. It is most useful when you want to compare brute-force results, teach substitution ciphers, or sanity-check a short encoded message by hand.

How to Use the Inputs

  1. Enter your plaintext message in the input field.
  2. Set the shift value (1-25) or select a common preset like ROT13.
  3. Choose encrypt or decrypt mode.
  4. View the result and letter frequency analysis.
  5. Use brute-force mode to see all 25 possible shifts at once.
  6. Compare letter frequencies to identify the likely correct shift for unknown ciphertext.
Formula used
Encrypt: E(x) = (x + shift) mod 26 Decrypt: D(x) = (x - shift) mod 26 where x is the letter position (A=0, B=1, ... Z=25) ROT13: shift = 13 (self-inverse: encrypt = decrypt)

Example Calculation

Result: KHOOR ZRUOG

With shift 3: H→K, E→H, L→O, L→O, O→R, W→Z, O→R, R→U, L→O, D→G. Non-alphabetic characters (space) are preserved unchanged.

Tips & Best Practices

  • ROT13 (shift 13) is self-inverse: encrypting and decrypting use the same operation.
  • In English, E, T, A, O, I, N are the most frequent letters — use this for frequency analysis.
  • The brute-force display lets you visually scan all 25 options to find the right decryption.
  • Combine Caesar cipher with a keyword for the more secure Vigenère cipher.
  • Caesar cipher is a special case of the affine cipher with multiplier = 1.
  • Use shift = 0 as a sanity check — the output should equal the input.

History of the Caesar Cipher

Julius Caesar used this cipher with a shift of 3 in his private correspondence, as documented by the Roman historian Suetonius. The general Valerius Probus wrote about its use for military communication. While the exact shift value seemed to be commonly known among Roman officials, the technique provided a basic level of security in an era when most interceptors were illiterate.

The Caesar cipher remained in use for centuries after Rome's fall. In the 15th century, it was still considered reasonably secure. It wasn't until the development of frequency analysis by Arab mathematician Al-Kindi in the 9th century that systematic methods for breaking substitution ciphers were documented. Even so, many European cryptographers were unaware of these techniques for several more centuries.

Frequency Analysis: Breaking the Code

Every language has a characteristic letter frequency distribution. In English, E appears approximately 12.7% of the time, followed by T (9.1%), A (8.2%), O (7.5%), and I (7.0%). When text is encrypted with a Caesar cipher, this frequency distribution is simply shifted — the most common letter in the ciphertext corresponds to the most common letter in the language.

To crack a Caesar cipher using frequency analysis: count the frequency of each letter in the ciphertext, find the most common letter, and assume it represents E. The difference between that letter and E gives you the likely shift. For short messages, this may not work perfectly due to statistical variation, which is why the brute-force approach (checking all 25 shifts) is more reliable for short texts.

From Caesar to Modern Cryptography

The Caesar cipher's fatal weakness is its tiny key space — only 25 possible shifts. The Vigenère cipher (16th century) addressed this by using multiple Caesar shifts controlled by a keyword, creating a polyalphabetic cipher that resisted simple frequency analysis for three centuries. The Enigma machine (20th century) took this further with rotating mechanical wheels. Modern ciphers like AES operate on the same substitution-permutation principle but with key spaces of 2^128 or 2^256 possibilities, making brute-force attacks computationally infeasible.

Sources & Methodology

Last updated:

Frequently Asked Questions

  • The Caesar cipher is a substitution cipher where each letter is replaced by a letter a fixed number of positions later in the alphabet. It's named after Julius Caesar who reportedly used a shift of 3.