Home › Ciphers › How to Identify a Cipher
How to Identify a Cipher
You have a scrambled text and no label. Before any solving comes naming — and naming is a skill with a routine, not a gift. Five steps: look at the characters, count the letters, measure the shape, study the layout, then test in the right order. It is the same routine this site's Cipher Identifier automates, taught here by hand so you can see what the tool sees — and catch the cases where the tool itself is fooled.
Identification is elimination. The character set disposes of the encodings and codes at a glance (dots and dashes, digits only, mixed-case strings ending in =). The letter count tells you whether statistics can speak at all — under about 25 letters, honestly, they can't. The frequency shape then separates one-alphabet substitution from many-alphabet polyalphabetic from letter-preserving transposition. The layout — word divisions, groups of five, pairs — casts the deciding votes. Only then do you test, in the order the evidence ranks.
In a hurry? The Identifier runs this whole routine in a blink and shows its working. This page is for learning the tells — and for the day the tool's answer smells wrong.
Look at the characters — the free verdicts
Some texts announce themselves before any statistics: their alphabet is too small, or too strange, to be a letter cipher at all. Check these signatures first; they are facts about the text, not guesses.
| What you see | It is almost certainly | Go to |
|---|---|---|
| Only dots, dashes and spaces or slashes | Morse code — a code, not a cipher | Morse Translator |
| Only 0s and 1s, in runs of eight | Binary — bytes written out | Binary Translator |
| Only 0–9 and a–f, an even count, often in pairs | Hexadecimal — bytes again | Hex Converter |
| Upper case, lower case and digits mixed, length a multiple of four, often ending in = or == | Base64 encoding | Base64 Decode |
| Numbers only, all between 1 and 26 | A1Z26 — letters as alphabet positions | A1Z26 |
| Numbers in pairs, digits only 1–5 | Polybius square or tap code | Polybius Square |
| Drawn symbols — boxes, angles, dots | Pigpen or a symbol alphabet | Pigpen · Dancing Men |
| A long even-length string of 0–9 and a–f that resists everything | Possibly a hash — which cannot be decoded at all | See the mistakes section |
One trap lives in this table, and the site's own benchmark caught the Identifier falling into it: A1Z26 written with hyphens between the numbers (19-8-5-…) presents “dashes and no letters”, which is Morse's signature too — the tool ranked Morse first and the correct A1Z26 second. If your numbers are hyphen-separated, squint before you believe a Morse verdict; written with spaces, the same message is named correctly. The full story is in the benchmark.
Count the letters — can statistics even speak?
Every test after this one is statistical, and statistics need material. Below roughly 25 letters, a frequency count is a handful of anecdotes: a 12-letter text may contain no E at all by pure chance, and any tool that names its cipher confidently is bluffing. That is why this site's identifier refuses under 25 letters and answers “too short to tell” — a floor measured and published on the benchmark page. Between 25 and 100 letters, expect ranked maybes rather than verdicts. Past a few hundred, the shapes in step 3 become decisive. If your sample is short, the honest moves are: get more ciphertext, use any context you have (who sent it, for what puzzle), and lean on step 4's layout clues, which work at any length.
Measure the shape — one alphabet, many, or none?
Two measurements do most of the work. The letter census: does the text's commonest letter appear about 12% of the time, with a long tail — English's lopsided shape — or is the distribution suspiciously flat? And the index of coincidence (IoC), the probability that two letters drawn at random from the text match, scaled so ordinary English scores about 1.73 and a random jumble scores 1.00. Together they sort letter ciphers into three piles:
| Measurement | What it means | Test first |
|---|---|---|
| IoC near 1.73; census lopsided but the text won't read; one shift makes it read | Caesar or ROT — a single fixed shift | Caesar Solver (all 25 shifts, ranked) |
| IoC near 1.73; no shift works; census lopsided | Monoalphabetic substitution — one keyed alphabet | Cryptogram Solver |
| IoC near 1.73 and the census is exactly English's, letter for letter | Transposition — letters untouched, order scrambled | Transposition Solver |
| IoC sagging toward 1.00–1.45; census flattened | Polyalphabetic — several alphabets rotating (Vigenère family) | Vigenère Solver |
| IoC near 1.73 but word patterns look doubled or paired | A digraph or fractionating system may be reshaping the counts | Identifier for a second opinion |
The transposition row is the connoisseur's tell: substitution disguises the census, polyalphabetic flattens it, but transposition preserves it perfectly — the ciphertext of a rail fence contains exactly the plaintext's letters, so its E-count is English's E-count to the letter. If the census is perfect and nothing reads, stop substituting and start anagramming.
Study the layout — the sender's fingerprints
How a ciphertext is presented leaks how it was made. Word divisions kept, with apostrophes and one-letter words visible, is the newspaper-cryptogram convention: a monoalphabetic substitution, attacked with word patterns — a one-letter word is A or I, and that is a free letter. Letters in groups of five with word boundaries destroyed is the military convention, used by Vigenère-family and machine-age hand systems alike; it tells you the sender meant business and that pattern attacks will starve. Letters in pairs suggest a digraph system (Playfair family) or a coordinate system. A text whose length is a perfect square hints at a grid or grille. None of these is proof; all of them reorder which solver you open first — which is all identification ever does.
Test in the order the evidence ranks
Identification ends in experiments, cheapest first. If an encoding signature fired in step 1, decode it and start the routine again on what is inside — layers are normal, and the chain solver automates exactly that peeling. For letter ciphers, run the solver your step-3 pile names; a clean, high-scoring solve is the only confirmation that ever really counts. A solve that produces near-English mush at low confidence is information too — the benchmark's published failure is a substitution whose best Caesar shift scored a plausible-looking 46% fit and suppressed the right verdict; when a tool's confidence is lukewarm, try the runner-up family before you try harder on the winner. And when you know or suspect a word that must appear — a name, a “the” with context, a standard greeting — the crib solver turns that guess into a position and a partial key, which is often the fastest identification of all: the family is whichever one the crib fits.
Three identifications, walked through
Example 1 — the single shift
Step 1: ordinary letters, capitals where a sentence would put them — no encoding signature. Step 2: 113 letters, plenty. Step 3: the census is lopsided — the commonest letter appears 9 times in 113 — and the three-letter word aol appears four times: the silhouette of “the” under a substitution with word divisions kept. Step 5: the Caesar solver's ranked list puts shift 7 first, and the text opens into English about a committee and a village hall roof. The Identifier, given the same text, answers “Caesar cipher” at 93% — measured, not staged: this sample is case 1 of the benchmark set.
Example 2 — the encoding in cipher's clothing
Step 1 settles it before statistics wake up: upper and lower case and digits intermixed, no spaces, a length divisible by four, and the tell-tale == at the end — Base64's exact fingerprint. Decode it and out comes Example 1's plaintext, the committee again. The Identifier calls it “Base64 encoding” at 82%, and correctly ranks it above the polyalphabetic guess the mixed case tempts you toward. Lesson: always run step 1 before step 3 — encodings impersonate ciphers precisely by scrambling the statistics.
Example 3 — the flattened shape
Step 1: ordinary letters. Step 2: 197 letters. Step 3: the census is noticeably flat — the commonest letter manages only 7% where English's E should hold about 13% — and the IoC sags toward the polyalphabetic band, while word lengths survive (substitution preserves them; the encipherer here kept the spaces). The three-letter word gsi appearing three times is the repeating key showing through: the same plaintext word, “the”, caught at the same key alignment. Verdict: Vigenère family. The Vigenère solver finds key length 5 and the key LEMON, and the train-station plaintext steps out. The Identifier agrees at 68% — lower than the Caesar case, honestly reflecting that flat shapes are weaker evidence than clean shifts. Benchmark case 6, again measured.
Four mistakes that waste afternoons
- Trying to decode a hash. A 32-, 40- or 64-character hex string is likely a fingerprint (MD5, SHA-1, SHA-256 shapes), and hashes have no inverse — no key, no decoding, ever. Recognise the shape and stop.
- Trusting a verdict on ten letters. Short samples cannot carry frequency evidence. A confident answer about a tiny sample — from a tool or a friend — is a coin flip wearing a suit.
- Skipping step 1. Statistics computed over an encoding produce confident nonsense (Example 2's Vigenère mirage). Characters before counts, always.
- Marrying the first verdict. Identification gives a ranking, not a revelation. When the top family's solver returns mush at low confidence, the runner-up is the next experiment — the published benchmark failure turned on exactly this.
Frequently asked questions
Why not just paste everything into the Identifier?
You can, and usually should — it is faster and shows its working. This routine matters when the tool's answer looks wrong (it publishes its failures; two are known), when the sample is too short for it to judge, and when you want the skill rather than the answer. The tool and the routine are the same method at two speeds.
What is the single most informative test?
The letter census against the index of coincidence — one picture that sorts substitution, polyalphabetic and transposition into different piles. It is the test frequency analysis has rested on since long before computers; the identifier computes both for any text you paste.
My text has word divisions and a one-letter word. What is it?
Almost certainly a monoalphabetic substitution in the newspaper-cryptogram style — the one-letter word is A or I, and every repeated word pattern is a handhold. The cryptogram solver is built for exactly this shape.
The text is in five-letter groups. What does that rule in or out?
It rules out the casual puzzle conventions and rules in the military ones: Vigenère-family systems, machine-age hand ciphers, and layered constructions. It also rules out word-pattern attacks, which is the point of the grouping. Start with the identifier and the Vigenère solver.
Can a text be two ciphers at once?
Routinely — an encoding outside, a cipher inside is the commonest layering (Example 2), and history's serious systems stacked substitution on transposition. Identify the outer layer, peel it, and run the routine again on what emerges.