Substitution Ciphers

From the Buttcrack Cipher Wiki — the free field guide to classical ciphers

Try this cipher → Load its worked example and preselect its method.

Reading tools:
Letter frequency profile
Letter frequency profile. Original explanatory artwork prepared for the Cipher Wiki; it is not documentary evidence or a claim about any specific ciphertext.

A scrambled alphabet, used consistently§

In a monoalphabetic substitution cipher, each plaintext letter maps to one different ciphertext letter for the entire message. A key might map A to Q, B to W and so on, but it need not follow any keyboard or keyword pattern. Unlike Caesar, there is no small numerical key to enumerate.

Why it still falls§

English is highly redundant. E remains the commonest plaintext letter even after it is renamed; THE retains the pattern of three distinct letters; and HELLO retains the pattern 0-1-2-2-3. Word boundaries make newspaper cryptograms easier, but continuous ciphertext still contains n-gram frequencies such as TH, HE and ING.

From hand solving to hill climbing§

A hand solver starts with frequency counts, one-letter words, doubled letters and likely short words. An automatic solver starts similarly, then scores the decrypted text with a language model. It swaps two assignments in a candidate alphabet, keeps swaps that improve quadgram fitness, and restarts from perturbed keys to escape local optima. The result is a search guided by English rather than a futile walk through every permutation.

Use enough text§

With fewer than about 60 letters, the statistical evidence is thin; with 150 or more, common patterns repeat and recovery becomes much steadier. Do not treat a beautifully English-shaped 30-letter output as proof. Verify that the recovered key consistently transforms the full message.

For a pair-based cipher whose statistics are less familiar, continue to Playfair.

Frequently asked questions§

How many keys does a substitution cipher have?

A full mixed alphabet has 26 factorial possible permutations, about 4 × 10 to the power of 26. Exhaustive search is impractical, which is why substitution is more interesting than Caesar despite using the same basic idea.

What patterns survive a substitution?

Every occurrence of a plaintext letter becomes the same ciphertext letter, so word lengths, repeated letters and repeated word patterns survive. THE and THAT have different letter-pattern signatures, and doubled letters strongly constrain guesses.

Why do solvers sometimes miss rare letters?

A ciphertext that never uses Q, J or Z contains almost no evidence about where that plaintext letter maps. Several keys can decrypt the observed text equally well; context, a crib or more ciphertext resolves the ambiguity.

The facts in this article are generated from buttcrack's cipher registry when the site is built, so they describe the implementation you can run on this page. Registry-generated content is checked against the code; the history is editorial.

Try it live — break a real puzzle

Private by design

Paste a puzzle. Explore a reading.

Runs on this device

Paste text and press Solve. Ctrl / ⌘ + Enter works too.

Advanced settings & examples

Auto-detect ranks English-looking candidates, not probabilities. A selected method never silently falls back to a different cipher.

Limits & verification boundaries

The browser tries selected classical methods, English statistical scoring and encoding layers. It also recognizes PK1–PK10 by exact normalized corpus equality. It cannot break properly implemented AES/RSA or prove an intended plaintext by a high score. Many wiki methods are only reference demonstrations here; their key-recovery attacks require the full version.

A supplied-key reading is arithmetic under your assumption, not independent confirmation. A worked-example reference is labelled as a build-time lookup, never a newly recovered answer. Rankings show actual returned candidates from a bounded search, which may contain fewer than five.

No analysis upload or account. Nothing is saved unless you choose Save below. This hosted page includes third-party advertising; use a locally served/offline copy for sensitive work.

Solver interface improvements

  • Mobile-first input and solve action, with compact navigation.
  • Simple by default; settings, candidate rankings, statistics and manual controls expand on demand.
  • Every cipher article has a Try this cipher action with its real method and full worked example.
  • Optional named investigations let you save, compare and restore attempts on your own device.
  • Explicit live-operation/reference labels, snapshot boundaries and no automatic text saving.
Optional local investigations — save, compare & restore

Explicit device-only storage, no account or cloud sync. Saved snapshots contain ciphertext, plaintext and keys; browser storage is not encrypted. Deleting browser data removes them. Restore does not run a new search or independently verify an old result.

No automatic text or result saving.

This tool is free and has no account, no upload, no tracking of your text

Everything runs in your browser. If it saved you time, keeping it alive costs nothing but a click.