A substitution cipher looks like nonsense, but it has a weakness it can never hide. Whoever made it swapped every letter for another, consistently, from first word to last. They disguised which letter is which, but not how often each is used, and English uses its letters unevenly: e alone makes up roughly 12 percent of ordinary prose. Whatever symbol stands for e inherits that share, and it stands out in a count.
This guide walks through the classic method with the free Character Frequency Analyzer on Ovatly, which counts every letter, digit and symbol and shows a table with bars and percentages, most common first. The scope is honest: this works on simple substitution ciphers, the kind in puzzle books and newspaper cryptograms, and on nothing stronger.
Contents
- Quick answer
- Why ciphers leak their secret
- How to run the analysis
- Worked example
- Cross-checks
- Limitations
- Common mistakes
- FAQs
- Conclusion
Quick answer
Paste the ciphertext into the Character Frequency Analyzer, leave spaces out of the count, and read the table, most common first. Take the most frequent cipher letter as your first candidate for e, the next ones as candidates for t, a and o. Then cross-check with one-letter words (a or I), common pairs like th and he, and repeated word patterns. Read what emerges and iterate, swapping any guess that produces impossible spellings. Short ciphertexts give unreliable frequencies, and the method does not touch modern encryption.
Why ciphers leak their secret
A simple substitution cipher is a fixed swap: pick a mapping (every a becomes q, every b becomes w), then rewrite the whole message with it. The mapping never changes inside the message; if it did, the intended reader could not decode it either.
That consistency is the leak: e appears about twice as often as most other common letters in English, and after the swap, the letter standing in for e appears as often as e did. The disguise renames the letters but preserves their counts. Lining the cipher counts up against the known English order gives you a first draft of the mapping. That order runs e, then t, a, o, i, n, s, h and r, down to j, x, q and z.
A cipher that changes the swap as it goes, rotating alphabets, flattens the frequencies and the tall rows disappear. Modern encryption uses different mathematics and produces output with no letter pattern.
How to run the analysis
- Open the Character Frequency Analyzer and paste in the ciphertext.
- Set the options. If the cipher mixes cases for the same letters, leave case sensitivity off so A and a count as one character. Leave the spaces option unticked; spaces are usually the most frequent character in prose and would sit on top, shrinking every letter's share.
- Read the table, most common first, with counts and percentage shares, and note the summary line.
- Note the top five or six cipher letters in order: your candidates for e, t, a, o, i and n.
- Substitute the first guesses into a copy of the ciphertext, read the result, then iterate using the cross-checks below.
Worked example
Here is a small example, made from a short English sentence with one fixed mapping. It is deliberately tiny; cautions about short texts come after.
Ciphertext: RJJY RJ FY YMJ QFPJ
The analyzer counts 15 letters (spaces left out), 7 different characters:
| Cipher letter | Count | Share |
|---|---|---|
| J | 5 | 33.3% |
| Y | 3 | 20.0% |
| R | 2 | 13.3% |
| F | 2 | 13.3% |
| M | 1 | 6.7% |
| Q | 1 | 6.7% |
| P | 1 | 6.7% |
Percentages are rounded to one decimal place, so on other texts they can total slightly more or less than 100.
First deduction. J is the most frequent letter, a third of the whole message. That is the e signature. Try J = e: the first word's pattern now stands out as ?ee?, and the third word ends in e.
Second deduction. Y is next at 20.0 percent; try Y = t, English's second most common letter. The first word reads ?eet, and the third word, YMJ, reads t?e.
Third deduction. A word of the pattern ?eet, in a message that contains the two-letter word Re (same first two letters, R and J = e), points to one answer: MEET, with the two-letter word reading ME. Set R = m. Then t?e falls as THE, giving M = h. The rest confirms itself: FY reads ?t, which with Y = t can only be AT, so F = a; QFPJ reads ?a?e, resolving as LAKE, so Q = l and P = k.
The plaintext is: MEET ME AT THE LAKE. The mapping used was a plain shift of five places (a becomes f, b becomes g, and so on); check it letter by letter against the deductions: e to J, t to Y, m to R, h to M, a to F, l to Q, k to P, and every one matches.
Notice what did the work: frequency supplied only the first two letters. The rest came from word patterns: the repeated RJ, the ?eet shape, and t?e being almost forced to be THE.
Cross-checks
One-letter words. English has only two common ones, a and I, so a lone cipher letter standing as its own word must be one of them.
Common pairs. The pairs th, he, in, er and an do heavy work in English. Once you suspect t and e, the cipher letter often standing just before your e candidate is a strong candidate for h, because the is so common. In the example, YMJ resolving to THE confirmed two letters at once.
Repeated patterns. A cipher word keeps the original word's pattern: RJJY has a doubled middle, and doubled letters are most often e, l, s, o and t, another reason ?eet was a strong read.
Impossible spellings. If a guess produces a word shape English cannot have, the guess is wrong, not the language. Swap the two nearest candidates and try again.
Limitations
Short texts give unreliable frequencies, full stop. This example is 15 letters: one different word could have put a different letter on top; it behaved because it was constructed to. In a real five-word puzzle the most frequent letter may stand for t or a, and every deduction is a bet. A few sentences is a sensible minimum; a paragraph is comfortable.
The analyzer counts single characters only, not words; word level clues, like one-letter words, come from your own reading of the ciphertext. Accented letters count separately from their base letters, so a cipher in a language with accented letters splits its counts across rows even with case merged.
And it does not touch modern encryption: passwords, messaging apps and encrypted files use mathematics with no letter swapping, so there is no frequency table to match.
Common mistakes
- Trusting the ranking blindly. Frequency gives candidates, not certainties. Letters close in share, like a and o, are often in the wrong order.
- Working on too little text. A handful of words cannot support the method; get more ciphertext or accept a guess.
- Counting spaces and capitals inconsistently. Set the analyzer options once, spaces out and case merged, and keep them fixed.
- Locking in a wrong early guess. If the text resists, suspect the earliest guesses: undo them and swap the candidates.
- Aiming the method at real encryption. Modern encryption is out of reach by design.
FAQs
What kind of cipher can letter frequency crack? Only a simple substitution cipher, where each letter is swapped for one other, consistently, through the whole message. Ciphers that change the swap as they go, and all modern encryption, leave no stable frequency pattern to match.
How much ciphertext do I need for this to work? A few sentences at minimum; more is better. In a very short message the most frequent letter may not stand for e at all, because small samples wobble.
What do I match the cipher frequencies against? The published English order: e first by a wide margin, then roughly t, a, o, i and n. Paste the ciphertext into the Character Frequency Analyzer for its table, most common first, and line the two orders up.
Should I count spaces when analyzing a cipher? Leave the spaces option unticked. Spaces are usually the most frequent character in prose, and counting them pushes a space row to the top and shrinks every letter's share. Word lengths still help separately for one-letter words.
Can this method crack real encrypted messages or passwords? No. Modern encryption does not swap letters one for one, and its output shows no letter pattern to match. Frequency analysis belongs to classical puzzle ciphers: newspaper cryptograms, puzzle books and classroom codes.
Conclusion
A simple substitution cipher renames every letter but cannot change how often each is used, and that single fact unravels it: count the cipher letters, match the tallest row to e, and let word patterns do the rest. The Character Frequency Analyzer gives you the table in seconds, most common first. For the background on why e dominates, read the companion guide, Letter Frequency Explained: Why E Is the Most Common Letter. More counting and text tools live in the Text and Writing Tools guide archive.