Cracking the Caesar Cipher

Only 26 possible keys means we can try them all. Score each candidate against English letter frequencies and the real plaintext rises to the top.

Best guess

Recovered key
Chi² score (lower is better)
Recovered plaintext
 

All 26 candidates

Ranked by how closely their letter distribution matches English. Click any row to promote it as the best guess.

How the scoring works

For every shift k from 0 to 25 we decrypt the ciphertext and count how often each letter appears. We then compare that distribution to the expected frequencies of English text using a chi-squared statistic:

χ² = Σ (observed − expected)² / expected

The closer a candidate's letter mix is to typical English, the smaller its score. The plaintext almost always wins by a wide margin — even for short messages of a dozen letters or so. Try editing the ciphertext above and watch the rankings shuffle live.

This is exactly why the Caesar cipher is considered broken: an attacker only needs to look at shape, not content. With 26 keys and a frequency table, the work is over in milliseconds.