b2KIT

Substitution Cipher Solver

Decode substitution ciphers using frequency analysis. Interactive letter mapping with bigram/trigram hints and English pattern matching.

Tested tool guide Tested browser tools Checked August 16, 2026

What Substitution Cipher Solver does, with a checked example

Paste ciphertext and the tool ranks each letter by how often it appears, then lets you assign plaintext letters one at a time until the text reads in English. The frequency ranking, bigram/trigram hints, and word-pattern matches are suggestions, not answers: the mapping stays manual, and the decoded text, hints, and candidates update as you confirm letters. The surprise: a few confirmed letters - often from one repeated short word - unlock more than the full frequency table. Frequency analysis assumes a fixed one-to-one letter substitution and reasonably long text; both must hold for the rankings to mean much. Everything runs in the browser, so the ciphertext never leaves your machine.

Worked example

A concrete input and expected output from the current implementation.

Input

ZIT JXOEA WKGVF YGB PXDHL GCTK ZIT SQMN RGU

Expected output

THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG - the fully decoded message, with the mapping confirmed (Z to T, I to H, T to E, J to Q, X to U, O to I, E to C, A to K, and so on).

This ciphertext was made with the classic keyboard substitution, whose cipher alphabet reads QWERTYUIOPASDFGHJKLZXCVBNM in keyboard order under the plaintext alphabet ABCDEFGHIJKLMNOPQRSTUVWXYZ. So ciphertext Z decodes to T, I to H, and T to E, making ZIT read THE, and because a substitution maps every letter the same way throughout, the rest of the pangram follows.

How the result is produced

1

Frequency ranking

The tool counts every ciphertext letter and sorts the counts. In normal English prose E is the most frequent letter by a clear margin (around 13% of letters), followed by T, A, O, I, N, S, H, R, so the tool proposes the most common ciphertext letter as E. The proposal is a hypothesis the user accepts or reassigns; each accepted pair tightens every other suggestion.

2

Word patterns and n-grams

Each ciphertext word is reduced to a shape - ABBA for a four-letter word whose first and fourth letters match - and compared against dictionary words with the same shape, so an ABBA-shaped word yields candidates like SEES or NOON. Bigram and trigram counters flag common sequences such as TH, HE, IN, THE and AND, which turns a repeated ZIT at both ends of a message into a confident THE.

Good uses

  • Solving newspaper and puzzle-book cryptograms, where every puzzle is a fresh substitution with its own alphabet.
  • Decoding a message someone enciphered with a personal alphabet - a puzzle-hunt clue, a treasure-hunt note, or a role-playing game master's letter.
  • Learning cryptanalysis: encipher texts yourself and watch whether the frequency ranking and pattern hints recover them, to see where the method succeeds and fails.

Limits and checks

  • Length matters. With fewer than a few hundred characters the counts are noisy and the top letter is not always E; very short messages are solved one confirmed letter at a time with pattern hints, not by ranking.
  • It only works on monoalphabetic substitution. Polyalphabetic ciphers (Vigenere, rotor machines), homophonic ciphers, and transpositions have no fixed letter-to-letter map, so the tool cannot solve them and its output for such inputs is meaningless.
  • The dictionary match is per word and cannot see meaning. Names, invented words, and abbreviations produce wrong or empty pattern matches, and a mapping can decrypt into plausible-looking but incorrect English that only a human reader will catch.

Common questions

Why does the frequency ranking not just solve it for me?

The ranking is a guess, not a proof. In a typical puzzle of 200-300 letters the top few positions are usually right, but the middle of the ranking drifts, and a single wrong assignment corrupts every word that contains that letter. That is why the mapping stays manual and the hints recompute as you confirm letters.

Will it solve a Caesar cipher?

Yes. A Caesar shift is a substitution cipher whose alphabet is rotated by a fixed amount, so it has exactly the fixed letter-to-letter map this tool handles and you will get the plaintext. It will not label the result a Caesar shift, though - if you already suspect one, rotating the alphabet by hand is faster.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools