Skip to content

Substitution Cipher Solver

Paste a cryptogram and solve it the way codebreakers do: line its letter frequencies up against English, try the hinted words for its short words, and watch the plain text appear as you guess. Or switch to encoding and decoding with a keyword alphabet or a random key. Free, no sign-up.

What do you want to do?

Letter frequencies

227 letters in the cipher text

Top row: your cipher letters, commonest first (blue bars). Bottom row: English letters in their usual order (amber bars). Letters in the same column are a first guess, not an answer — on a short text the top few often swap places.

Show the counts as a table
RankCipher letterCountShareEnglish letterEnglish share
1P3113.7%E12.7%
2L2912.8%T9.1%
3R2511%A8.2%
4Y198.4%O7.5%
5U177.5%I7%
6D135.7%N6.7%
7F135.7%S6.3%
8H114.8%H6.1%
9G94%R6%
10J94%D4.3%
11K83.5%L4%
12X83.5%C2.8%
13A62.6%U2.8%
14O62.6%M2.4%
15E41.8%W2.4%
16N41.8%F2.2%
17T41.8%G2%
18W41.8%Y2%
19Q31.3%P1.9%
20Z20.9%B1.5%
21M10.4%V1%
22S10.4%K0.8%
23—00%J0.2%
24—00%X0.2%
25—00%Q0.1%
26—00%Z0.1%

Your guesses

Type the plain letter you think each cipher letter stands for. Letters that do not occur in the cipher text are dimmed.

Guessed 0 of 22

Short-word hints

The commonest English words that fit each short cipher word — same letter pattern, and consistent with your guesses. Select one to try it.

  • PDL 6 times
  • YGJ 3 times
  • Y 2 times
  • UE 2 times
  • KR once
  • PU once
  • DYR once
  • YFF once

Doubled letters

FF × 3PP × 2RR × 2XX × 2AA × 1LL × 1

A doubled cipher pair is a doubled plain pair. In English the commonest are LL, EE, OO, SS and TT.

Partial decryption

Guessed letters are shown in lower case under their cipher letters; a dot marks a letter you have not guessed yet. The copy puts unknown letters in capitals.

L·M·L·H·Q·F·Y·G·T·O·Y·T·L·D·Y·R·D·Y·N·K·P·R·,,Y·G·J·Y·R·K·X·A·F·L·R·O·N·R·P·K·P·O·P·K·U·G·W·K·A·D·L·H·S·L·L·A·R·Y·F·F·U·E·P·D·L·X·..P·D·L·W·U·X·X·U·G·L·R·P·F·L·P·P·L·H·R·R·P·Y·Q·P·D·L·W·U·X·X·U·G·L·R·P·,,P·D·L·R·D·U·H·P·Z·U·H·J·R·R·P·Y·Q·R·D·U·H·P·,,Y·G·J·Y·J·U·O·N·F·L·J·F·L·P·P·L·H·K·R·R·P·K·F·F·J·U·O·N·F·L·J·..T·O·L·R·R·P·D·L·Z·U·H·J·P·D·Y·P·Y·A·A·L·Y·H·R·X·U·R·P·U·E·P·L·G·Y·G·J·P·D·L·H·L·R·P·U·E·P·D·L·X·L·R·R·Y·T·L·R·P·Y·H·P·R·P·U·E·Y·F·F·K·G·P·U·A·F·Y·W·L·..

How to Use the Substitution Cipher Solver

  1. 1. Choose a task. Solve a cryptogram is for cipher text whose key you do not know; Encode or decode with a key is for when you have one.
  2. 2. Paste the cipher text. Keep its spaces and punctuation if it has them — word lengths and apostrophes are the solver's best clues.
  3. 3. Read the frequencies and the hints. The chart lines your commonest cipher letters up against English's E, T, A, O, I, N. The hints list the common English words that fit each one-, two- and three-letter cipher word, and the doubled letters.
  4. 4. Guess and check. Type a plain letter under any cipher letter, or select a hinted word to fill in all of its letters at once. The partial decryption updates as you type, and a plain letter guessed for two cipher letters is flagged.
  5. 5. Encode your own message. Under Encode or decode with a key, build the key from a keyword, type all 26 letters yourself, or press New random key. The key table shows which letter becomes which.

How a Substitution Cipher Works

A monoalphabetic substitution cipher swaps every letter for another, using one fixed cipher alphabet for the whole message. Write the alphabet with the cipher alphabet under it: plain A becomes the key's first letter, B its second, and so on. Decoding reads the table from the bottom row up.

A keyword alphabet is the easiest key to remember: the keyword's letters, each once, then the rest of the alphabet in order. With ZEBRAS:

Keyword alphabet for ZEBRAS

Plain:  A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Cipher: Z E B R A S C D F G H I J K L M N O P Q T U V W X Y

So FLEE AT ONCE. WE ARE DISCOVERED! becomes SIAA ZQ LKBA. VA ZOA RFPBLUAOAR! — the tool's encoding example. The tail of a keyword alphabet is nearly in order (U becomes T, V becomes U), which is one reason a random key is stronger. A random key is a shuffle of all 26 letters: the tool draws it with your browser's cryptographic random generator and, as newspaper cryptograms do, never lets a letter stand for itself.

How to Solve a Cryptogram: A Worked Example

A substitution changes the letters but not the language underneath, so the solver works from what English keeps. The sample cryptogram has 227 letters; its commonest are P (31 times), L (29) and R (25), so frequency alone suggests P is e. Frequency is only a starting point:

  1. Start with the short words. The three-letter word PDL appears six times. THE is the commonest three-letter word in English, so try P = t, D = h, L = e.
  2. Follow the patterns. YGJ appears three times and fits AND, which makes the lone Y the word a. UE then fits OF, and YFF — a doubled letter — is ALL.
  3. Use doubled letters. The hint panel lists FF three times. English doubles L more than any other letter, and F = l turns YFF into ALL and RPKFF into STILL once R = s and K = i.
  4. Let the long words fall. With those guesses in place, PDYP reads as THAT and FLPPLHR as LETTERS, and every new letter makes the next word easier.

The plain text turns out to describe the method: Every language has habits, and a simple substitution cipher keeps all of them. Start from frequency order fills in a first guess by rank alone; on a message this short it gets most letters wrong, which is why the word hints matter.

From al-Kindi to the Daily Cryptogram

Substitution is among the oldest ciphers, and the first to be broken systematically. Around 850 AD the Arab scholar al-Kindi explained how in A Manuscript on Deciphering Cryptographic Messages: count the cipher letters and match them against the letter frequencies of the language — the earliest known account of frequency analysis. Renaissance secretaries answered with nomenclators, which mixed substitution with code words, and with homophones that gave common letters several symbols. Today the simple substitution lives on as a puzzle, in newspaper cryptograms and in the Aristocrats of the American Cryptogram Association.

Is a Substitution Cipher Secure?

No. There are 26! ≈ 4.03 × 10²⁶ possible keys — about 88 bits, far too many to try one by one — but the cipher keeps the language's fingerprints: how often each letter occurs, the length and letter pattern of every word, which letters double. The unicity distance of English, the amount of cipher text needed for only one key to make sense, is about 28 letters, and around 50 letters are usually enough to solve one by hand. A computer search solves a cryptogram of that length in seconds. Use substitution for puzzles and teaching; protect real information with modern encryption.

Frequently Asked Questions

What is a substitution cipher?
A cipher that replaces each letter of the message with another letter, following a key. In a monoalphabetic substitution — the kind this tool solves — the same plain letter always becomes the same cipher letter. The Caesar and Atbash ciphers are special cases with a fixed pattern; a general substitution can use any of the 26! orderings of the alphabet.
How do I solve a cryptogram?
Start with the short words and the apostrophes: a one-letter word is almost always A or I, and the commonest three-letter word is usually THE. Compare letter frequencies with English, look for doubled letters and repeated word patterns, and fill in one guess at a time, checking that each new letter makes sense everywhere it appears. Guessing wrong is normal — undo the letter and try the next candidate.
What are the most common letters in English?
In order: E, T, A, O, I, N, S, H, R, D, L, then C and U — close to the ETAOIN SHRDLU of the old Linotype keyboard. In a large body of English text, E makes up about 12.7% of letters, T about 9.1% and A about 8.2%. A short message can stray far from these figures, so treat them as a guide.
What is a keyword cipher?
A substitution cipher whose cipher alphabet starts with a keyword — repeated letters dropped — followed by the rest of the alphabet in order. With ZEBRAS, A becomes Z, B becomes E and C becomes B. It is easy to share and remember, but the end of the alphabet barely moves, which gives a solver a head start.
Can a cryptogram be solved without spaces?
Yes, but it takes longer. Without word breaks you lose the word-length clues, so you rely on letter frequencies and on common pairs and triples: TH, HE, IN and ER, and THE and AND. The frequency chart works the same without spaces; the short-word hints need them.
Is a substitution cipher the same as a Caesar cipher?
A Caesar cipher is one kind of substitution: every letter shifts by the same amount, so there are only 25 keys and you can try them all. A general substitution allows any rearrangement of the alphabet, which defeats trying every key, but frequency analysis breaks both.

Related Tools

More in Codes & Ciphers

See all Codes & Ciphers