Join the Official Discord

Substitution cipher solver

Paste a cryptogram and press Solve. Lock in any letters you're sure of and solve again.

Plaintext

The key

Type a letter under any cipher letter to lock it in. Solve again to fill the rest around it.

Cipher ABCDEFGHIJKLMNOPQRSTUVWXYZ
Plain
Count

Simple substitution and cryptograms

In a simple substitution cipher every letter stands for one other letter, consistently, all the way through. Newspaper cryptograms and cryptoquotes work this way, and so do the keyword cipher, Atbash and the Caesar shift. They're all special cases with a pattern in the key. Here the key can be any of 403 septillion arrangements of the alphabet. Far too many to try, but a solver doesn't need to try them all.

How the solver cracks it

It starts with a sensible guess: the commonest cipher letter is E, the next T, then A, and so on. Then it keeps swapping two letters of the key and scoring the result against English. A swap that makes the text read better stays; one that makes it worse is undone. That's called hill-climbing. A single climb can stall on a near-miss, so the solver starts again from fresh random keys and keeps the best answer.

The score comes from four-letter sequences counted across millions of letters of English fiction. Spaces aren't needed, which means it also cracks ciphertext that's been run together or written in blocks of five.

Helping it along

  • Give it enough text. Around 80 letters solves most cryptograms outright. Shorter puzzles have several answers that look nearly as good.
  • Lock in what you know. If you can see that XLI is THE, type T, H and E under X, L and I in the key, and solve again. Locked letters are shaded and the solver works around them.
  • Watch for red letters. Two cipher letters pointing at the same plain letter is a contradiction, and it's highlighted.

If the solver can't find anything that reads, the cipher probably isn't a single substitution. Check the index of coincidence with frequency analysis. A low one points to Vigenère.

Step-by-step guide How to solve a Substitution Solver by hand, with a worked example

Questions

How does the substitution solver work?

It starts by guessing that the most common cipher letter is E, the next is T, and so on, then swaps pairs of letters over and over, keeping each swap that makes the result read more like English. It restarts from several random guesses and keeps the best answer.

How long does my message need to be?

Around 80 letters usually solves cleanly. 40–80 letters often gets most of the way, and you can finish it by locking in the letters you recognise. Under 30 letters there are simply too many possible answers.

Does it work on cryptograms with spaces and punctuation?

Yes. Spaces, punctuation and capitals are kept where they were. Word breaks don't help the solver here; it scores runs of four letters, which is what makes it work on unspaced text too.

Can it solve a keyword cipher?

Yes. A keyword cipher is a simple substitution whose alphabet starts with a keyword, so the solver handles it like any other substitution. The recovered key will usually show the keyword at the start.

More cipher tools

See all cipher tools →