Cipher Table

Tool

Cryptogram solver

Paste a cryptogram into the red pane and press the button. The solver finds the scrambled alphabet by itself and shows you the answer, along with the key so you can fix any letter it got wrong.

Key

Solving a cryptogram by hand

A cryptogram is a quotation in which every letter has been swapped for another, consistently throughout. If you would rather beat it yourself, these are the footholds, roughly in the order to try them.

  1. One-letter words are A or I.
  2. Apostrophes give a great deal away. After an apostrophe you will nearly always find S, T, D, M, RE, VE or LL.
  3. The commonest three-letter word is usually THE, then AND. If the same three letters also end a four-letter word, think THAT, THEM, THEN.
  4. Two-letter words come from a short list: OF TO IN IT IS BE AS AT SO WE HE BY OR ON DO IF ME MY UP AN GO NO US AM.
  5. Double letters are most often LL EE SS OO TT FF RR NN PP.
  6. The most frequent letter overall is probably E, with T A O I N S H R close behind. The frequency analysis tool will count for you.
  7. Word shapes. A pattern like ABCDB could be THERE or WHERE; ABBC ends many words like BEEN, SEEM, ALLY.

Each letter you place rules out others, and the puzzle accelerates toward the end.

How the solver does it

The solver works in two passes. The first knows nothing about words at all. It knows one thing: how common every four-letter sequence is in English.TION and THER are very common; QZKX never happens.

It begins with a rough guess, matching the most frequent cipher letter to E, the next to T, and so on. Then it tries swapping two letters of its key. If the decoded text now contains more plausible four-letter sequences, it keeps the swap; if not, it undoes it. It works through every possible pair, again and again, until no swap helps.

This is called hill climbing, and it has a known flaw: it can settle on a small hill, a key that is nearly right, where no single swap improves things. So the solver starts again from a different shuffled key, dozens of times, and keeps the best few summits it reached.

That gets most of the message, but letter statistics can't always settle the rare letters. REPEAL THE SHAVE has almost exactly the texture of REVEAL THE SHAPE. So the second pass checks the reading against a list of forty thousand English words and how common each one is, and climbs again, preferring keys that give real, everyday words. If the puzzle has no spaces, it works out the most likely word breaks for every key it tries.

Read more about the cipher itself on the substitution cipher page.

Questions people ask

How do I use the cryptogram solver?

Paste the puzzle into the red pane on the right, keeping its spaces and punctuation, and press "Break without the key". The solved text appears on the left within a second or two, and the alphabet it found is shown in the key box.

It got a few letters wrong. What now?

That is normal for short puzzles, where rare letters such as J, K, Q, X and Z may appear once or not at all. Read the result, spot the word that is nearly right, and correct the key: the 26-letter key lists the cipher letter for A, then B, and so on. Swap the two letters that are confused and the text updates instantly.

Does it solve cryptoquotes and cryptoquips?

Yes. Cryptoquote, Cryptoquip, Celebrity Cipher and "aristocrat" puzzles are all simple substitution ciphers with the word spacing left in, which is what this solver expects.

What about puzzles with the spaces removed?

Those, known as "patristocrats", work too. The solver finds the most likely word breaks itself. They are harder, so give it a hundred letters or more if you can.

Is using a solver cheating?

That is between you and your conscience. It is a good way to check an answer, to get unstuck on one stubborn word, or to see how the statistics behind the puzzle work.