Frequency Analysis
Paste ciphertext and watch it confess. Letter frequencies, the index of coincidence, and bigram/trigram tells — the code-breaker's lab.
Paste some text above and the analysis appears here.
How to use the frequency analyzer
Frequency analysis is the oldest weapon in cryptanalysis — Arab scholar Al-Kindi described it around 850 AD, and it broke every monoalphabetic cipher for the next thousand years. The idea is simple: language has habits, and habits survive scrambling.
- Paste your ciphertext into the box. Everything updates live.
- Read the index of coincidence first. Near 0.065 means English under a simple substitution — crackable by hand. Near 0.038 means something stronger (polyalphabetic or transposition).
- Study the bar chart. The gold marker on each bar is where English expects that letter. The tallest ciphertext bars map to E, T, A, O, I, N.
- Check bigrams and trigrams. The most common cipher pair is probably TH or HE; the most common triple is probably THE.
- Try it on a known cipher: load the English sample, note its clean 0.065, then encode it with the Cipher Lab's Caesar cipher and paste the result back here — same coincidence, shifted bars.
Why it works
A substitution cipher renames letters but cannot change how often each one appears. E is 12.7% of English whether you call it E or X — so the frequency profile of the ciphertext is the frequency profile of English, wearing a mask. The index of coincidence measures that profile in a single number, which is why it survives even when you don't know the substitution table.
When it fails
Vigenère with a long keyword flattens frequencies toward random — the index of coincidence is your early-warning system. Transposition ciphers (reordering letters) don't change frequencies at all, so frequency analysis can't touch them. And with fewer than ~25 letters, the statistics are noise.
- What is frequency analysis?
- Frequency analysis is the classic code-breaking technique: in any English text, some letters appear far more often than others (E about 12.7%, Z about 0.07%). A substitution cipher preserves those frequencies under new names, so counting letters in the ciphertext reveals which cipher letter probably stands for E, T, A, and the rest.
- What is the index of coincidence?
- The index of coincidence is the probability that two randomly chosen letters from the text match. For English it sits near 0.065; for random text near 0.038. Monoalphabetic substitutions like Caesar preserve it, while polyalphabetic ciphers like Vigenere flatten it toward random — so it tells you what kind of cipher you are facing.
- Why compare against English norms?
- A substitution cipher scrambles which letter is which but keeps the shape of the frequency distribution. The gold marker on each bar shows where English expects that letter; when the tallest bars sit far from their markers, the chart is showing you the cipher's substitution table in disguise.
- What do bigrams and trigrams tell me?
- Common English pairs and triples — TH, HE, THE, AND — survive substitution as the most common cipher pairs and triples. Matching the top bigrams against the known English list (TH, HE, IN, ER...) is how code-breakers make their first guesses at the substitution table.
- How much text do I need?
- More is better. Under about 25 letters the statistics swing too wildly to trust; a few hundred letters give clean frequencies. The tool warns you when the text is too short for the index of coincidence to mean anything.
- Is my text sent anywhere?
- No. All analysis happens in your browser with JavaScript. Nothing is uploaded, stored, or tracked.
Kept alive by readers like you
Every tool in the codex is free. If they save you time, a small donation inscribes new pages.
DonateNeed help with this tool?
Found a bug, or have a suggestion for the codex? Write to us — a real human reads every message.
[email protected]More from the codex
Frequency Analysis
Crack ciphers with letter counts, charts, and coincidence.
Cipher Lab
Caesar, Vigenère, and Atbash ciphers in your browser — make the ciphers this tool breaks.
Open tool → LiveBacon's Cipher
Biliteral A/B cipher with a two-typeface steganography demo.
Open tool → LiveElder Futhark
Translate between Latin text and ancient runes.
Open tool → LiveBraille Translator
Text to Unicode braille patterns and back.
Open tool → LiveReadability Checker
Grade level and style highlights for your writing.
Open tool → LiveText Summarizer
Shrink any article to its most important sentences.
Open tool → LiveWord Counter
Count words and estimate reading time instantly.
Open tool →