Chris Spackman's NeoCities Page

Breaking Substitution Ciphers

Frequency analysis is the fundamental technique for breaking monoalphabetic substitution ciphers. The idea is simple: in any substitution cipher, the letter that replaces E will appear roughly 13% of the time, the letter that replaces T will appear roughly 9% of the time, and so on. The cipher scrambles the names of the letters, but it cannot hide how often each one appears.

This technique has been known since at least the 9th century, when the Arab scholar al-Kindi described it. Parker Hitt's 1916 Manual for the Solution of Military Ciphers devoted an entire chapter to it, and it remains the starting point for any cryptanalyst today. Frequency analysis also works against the Caesar cipher, which is just a special case of substitution where the key is a single shift value.

How It Works

The attack follows a general pattern:

  1. Count letter frequencies. Tally how often each letter appears in the ciphertext and compare the distribution to standard English. The most common letter in the ciphertext is likely E (12.7% in English), followed by T (9.1%), A (8.2%), O (7.5%), I (7.0%), N (6.7%), and S (6.3%).
  2. Look for common digraphs and trigraphs. The most common two-letter pair in English is TH, followed by HE, IN, ER, and AN. The most common three-letter group is THE, followed by AND and ING. These patterns are powerful clues because they constrain multiple letters at once.
  3. Check single-letter words. In English, the only common single-letter words are a and I. If the ciphertext preserves word boundaries (as many practice ciphers do), single-letter words immediately identify one or two letters.
  4. Build the mapping letter by letter. Start with the most confident guesses, fill them in, and look for patterns in the partially decoded text. As you assign more letters, words begin to emerge, confirming or correcting your guesses.

Given enough ciphertext (generally 100+ characters) from an ordinary English message, frequency analysis will break virtually any monoalphabetic substitution cipher. (A very short message, or an unusual one — say, a note written without the letter E — can resist it.) The usual defense is to use a polyalphabetic cipher that flattens the frequency distribution — but even those can be broken with more advanced techniques.

Frequency Chart

Paste ciphertext below or load a pre-made challenge. The chart compares the letter frequencies in your ciphertext (red bars) against standard English frequencies (green bars). Look for the tallest red bar — that letter probably represents E.

Interactive Solver

Use the solver below to decode the ciphertext one letter at a time. Click any letter in the ciphertext display to select it, then press a key (A–Z) to assign a plaintext letter. The red letters are unsolved; cyan letters are your guesses. Use the frequency chart and pattern hints above to guide your assignments.

Load a challenge or paste ciphertext and click Analyze to begin.

Letter Mapping

Things to Try

Disclaimer: these pages are educational demos provided as-is, with no warranty of any kind. The author is not responsible for any consequences arising from their use.

Send comments and bug reports to chris@chrisspackman.com.

Version 0.1.1 — Last updated: 2026-07-02

This page is Copyright © 2025 – 2026 Chris Spackman <chris@chrisspackman.com>.
This web site developed entirely on GNU/Linux with Free / Open Source Software.

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Creative Commons License