Home › Ciphers › Transposition Solver
Transposition Solver
Every other cipher on this site changes what the letters are. A transposition cipher changes only where they stand — the same letters, dealt into a new order, like a shuffled deck that still contains exactly the cards you started with. That makes transposition invisible to letter-frequency attacks and obvious to a different sense: the message has English's letters but none of English's words. This solver runs that diagnosis first, then untangles the layouts automatically.
A transposition solver first detects transposition — letter frequencies near English's while common pairs like TH and HE are missing, and an index of coincidence still in the English range — then tries the standard layouts: rail fence with 2–8 rails and unkeyed columnar across widths 2–10, ranking every untangling by how English it reads. A grid anagramming helper below handles the keyed columnar case, where a keyword chose the column order and your eyes do the rearranging.
Not sure it is transposition at all? The Identifier separates substitution from transposition before you commit to a solver.
Diagnose & untangle
Anagramming helper — for keyed columnar
If a keyword set the column order, the automatic solver cannot guess it — but you can anagram it by hand. The helper splits the ciphertext into its column chunks for a width you choose; slide the chunks left and right with the arrows and watch the rebuilt rows for English locking together.
Detection first, layouts second
The diagnosis: three numbers that cannot all lie
Letter frequencies. Transposition preserves them exactly, so the count of E's, T's and A's matches English to within sampling noise — the tool measures this as a chi-squared distance per letter, and transposed text scores like plaintext, not like a cipher. Bigrams. What transposition destroys is company: TH, HE, IN and ER, the pairs that make English readable, appear at chance levels because neighbours have been separated. Index of coincidence. Because it only counts how often letters repeat — never their order — IoC survives transposition untouched, sitting in the English band around 1.7 (×26 convention) where a polyalphabetic cipher would flatten it toward 1.0. Put together — English letters, English IoC, scrambled pairs — the diagnosis is close to a signature. It is the same reasoning the Identifier automates.
The untangling: layouts are few, orders are many
A rail fence writes the message zig-zagging down and up across a set number of rails, then reads the rails off in rows. With only 2–8 plausible rail counts, the solver simply tries them all. Unkeyed columnar — message written in rows, columns read straight down in order — is nearly as obliging: the solver tries widths 2–10 and scores each reconstruction on English three-letter groups and common pairs, a signal a correct untangling wins by a distance. Keyed columnar, where a keyword set the read-off order, is a different problem: a width-9 grid has 362,880 orders, and the classical answer is anagramming — rearrange the columns by hand in the helper below, watching for pairs that lock into English (a TH or QU at a column boundary is unmistakable). It is slower than a button and, on a single message, surprisingly decisive.
The oldest trick: same letters, new order
Transposition is arguably the oldest cipher idea of all. The Spartan scytale — a message strip wound around a baton, readable only on a matching baton — is described by Plutarch; historians debate how exactly it was used, so treat the tidy legend with care, but the principle is genuinely ancient. Columnar systems then guarded military and diplomatic traffic for centuries, and the First World War's ADFGVX cipher married transposition to fractionation — each letter split into two symbols from a six-letter alphabet, the result shuffled — a design that took Georges Painvin's celebrated solo effort to break in 1918. The family survives wherever letters must be scrambled with nothing but paper: puzzle hunts, escape rooms, and the ACA's route and columnar types. (Sources: Kahn, The Codebreakers; ACA cipher type catalogue.)
A columnar grid, read honestly
Example 2's message was written in rows of five, then read straight down the columns. The grid below is that writing, restored — read it across and the plaintext simply appears; the solver's whole job is finding the width that makes this happen:
| T | H | E | Q | U |
| I | C | K | B | R |
| O | W | N | F | O |
| X | J | U | M | P |
| S | O | V | E | R |
| T | H | E | L | A |
| Z | Y | D | O | G |
Down any column the letters are strangers — that is the ciphertext as read off — while across each row they are English. Every transposition solve is the search for the arrangement where the rows turn into language.
Two scrambles, untangled
Example 1 — rail fence (load it above)
The diagnosis reports a chi-squared of about 0.4 per letter and an IoC near 1.5 — transposition, confidently. Trying rail counts in turn, 3 rails produces “THE QUICK BROWN FOX…” instantly, with an English score no other rail count approaches. Rail fence is the weakest layout here precisely because it has so few settings to try.
Example 2 — columnar (load it above)
Same diagnosis, one more step: the solver tries each width in turn and width 5 wins by a distance — the same fox text emerges. Had a keyword set the column order, no width would have won, and the anagramming helper below the tool would be the way in: it carries a keyed example of its own (order 2 4 1 3 5) so you can watch a rearrangement lock into English. Columnar with an incomplete final row — uneven column lengths — is the classic complication, and both the solver and the helper track each column's true length.
Where the untangling struggles
- Short messages. Under ~40 letters the English score cannot reliably separate the true layout from a lucky wrong one. Expect to finish by hand, eyes on the candidates.
- Double transposition. Two columnar passes with different keys defeat single-message layout search. The classic attack is anagramming several messages of the same length together, letting the set solve what one message cannot.
- Route ciphers. Snake, spiral and diagonal routes are transpositions too, but their geometry is not a grid of columns; this solver covers rail fence and columnar, and flags the rest only by diagnosis.
- Transposition over substitution. If a message was substituted and transposed, the frequency test fails (the letters are no longer English's) and neither solver alone applies. The diagnosis numbers will look wrong for both families — that confusion is itself the clue.
The transposition family
| Member | The move | On this site |
|---|---|---|
| Rail fence | Zig-zag across rails, read by rows | Solved above; the rail fence page |
| Columnar | Grid + keyword column order | Solved above; the columnar page |
| Route ciphers | Write one path, read another | Diagnosed here; solved by hand |
| Scytale | Strip wound on a baton | Rail fence's ancient cousin in spirit |
| Anagrams | One word, shuffled | The helper above; word games everywhere |
Why scrambling refuses to die
Transposition needs no tables, no wheels and no arithmetic — a pencil, a grid, and a keyword are a complete cipher kit, which is why it served agents and armies long after substitution became a school exercise, and why it still anchors puzzle design: a scrambled paragraph looks solvable, because it is made of the right letters. It also teaches the deepest beginner's lesson in cryptanalysis: the message was never hiding in different symbols; it was hiding in arrangement.
One scramble, four rails
Practice — the morning post
Run the solver. Before you look at the answer: from the diagnosis alone, could this have been a Vigenère cipher instead? Which number settles it?
Reveal the answer
It is a rail fence on 4 rails: “THE LETTER CAME BY THE MORNING POST AND THE OFFICE WAS…”. The IoC settles the family question — it sits in the English band (~1.7), which a Vigenère ciphertext of this length would have flattened toward 1.0. Frequencies say the letters were never substituted; only their order was taken.
Frequently asked questions
How can I tell transposition from substitution at a glance?
Count the E's. If E is still the commonest letter by a wide margin and the alphabet's shape looks English, but no word reads — suspect transposition. If the frequency chart itself looks wrong (some rare letter doing E's job), it is substitution, and the cryptogram solver is your tool.
What is “anagramming” in the classical sense?
Working a transposition by hand: writing the ciphertext in candidate grids, sliding columns against each other and watching for letter pairs that look like English neighbours — TH, QU, -TION fragments. The helper above is that bench, digitised.
Why does the solver sometimes return the right text at the wrong width?
Some widths are multiples of the true one (a width-10 grid can mimic width 5). The reading is identical — the plaintext is what matters.
Can this solve a message transposed twice?
Not reliably in one pass — see the limits section. If you have several messages of identical length encrypted the same way, classical anagramming across the set is the historical answer.
My text's frequencies are NOT English-like. Is it transposition over something else?
Possibly a substitution underneath, or the plaintext is not English, or the text is too short for frequencies to settle. Run the Identifier and let its panel of tests vote first.