Interactive Training  |  Classical Cryptanalysis  |  No Answer Key Needed

Frequency Analysis Visualizer

Paste any ciphertext — a Caesar or substitution cipher works best — and see its letter frequency plotted against standard English letter frequency. Then guess the mapping for each letter and watch the decoded text update live as you go. This is the actual technique cryptanalysts used for centuries to break substitution ciphers before computers existed, and it's still the fastest way to build real intuition for why simple substitution isn't secure.

1
Paste Ciphertext
Works best with substitution or Caesar ciphers — try a sample if you don't have one handy

2
Letter Frequency
Blue bars: your ciphertext. Red markers: standard English frequency, for comparison.

3
Guess the Substitution
Type a plaintext guess under each ciphertext letter (most frequent letters listed first) — the decoded text below updates as you type

Why Frequency Analysis Breaks Substitution Ciphers

Every natural language has a statistical fingerprint. In English, the letter "E" appears in roughly 12.7% of all letters written, "T" around 9.1%, "A" around 8.2%, while "Z", "Q", and "X" barely register. A simple substitution cipher — where each plaintext letter is consistently replaced by one ciphertext letter — preserves this fingerprint perfectly. It just relabels it. Al-Kindi, a 9th-century Arab polymath, is credited with the earliest known description of this technique, and it remained the primary method for breaking substitution ciphers for over a thousand years, right up until modern computing made brute-force and statistical approaches vastly more powerful.

English Letter Frequencies (Approximate)

LetterFrequencyLetterFrequency
E12.7%D4.3%
T9.1%L4.0%
A8.2%C2.8%
O7.5%U2.8%
I7.0%M2.4%
N6.7%W2.4%
S6.3%F2.2%
H6.1%G2.0%
R6.0%Y2.0%

What This Technique Can and Can't Break

Frequency analysis works because simple substitution is a one-to-one, static mapping — the same ciphertext letter always means the same plaintext letter, everywhere in the message. Polyalphabetic ciphers like Vigenère defeat basic frequency analysis by rotating through multiple substitution alphabets, which flattens the letter-frequency curve. Modern block and stream ciphers (AES, ChaCha20) don't operate on individual letters at all — they transform blocks of bits through mathematical operations designed specifically so that no statistical pattern survives from plaintext to ciphertext. This is exactly why frequency analysis is a museum-piece technique for modern cryptography, but it's also exactly why it's such a good teaching tool: it makes the core weakness of "simple" encryption viscerally obvious in a way that reading about it never quite does.

Want to test what you find here? Try the Cipher Identifier to guess which classical cipher produced a given ciphertext, or explore Classical Ciphers for hands-on encoding/decoding of Caesar, Vigenère, and others.

References

  1. Frequency analysis — general background
  2. KF-Cipher Classical Ciphers tool
  3. KF-Cipher Cipher Identifier