Columnar Cipher Decoder

Type the key into Key word or numbers, paste into Code to decode, and the rows read as words again.

This is a sample. Type or paste your own code over it.

Message

NOBODYHASFEDTHEPIGEONSINCETUESDAY
No key? Try every order

Every order of 2 to 7 columns, 5,912 in all, with one key and a short last row. These are the ten readings that look most like English, by common letter pairs and common short words. Under about 20 letters the ranking is a guess. A longer key or a second key is not searched.

Column numbersReadingScoreUse it
5 2 1 4 3 6 LikelyNOBODYHASFEDTHEPIGEONSINCETUESDAY45.11In use
2 1 4 3 6 5 LikelyOBODYHASFEDTHEPIGEONSINCETUESDAYN33.11
2 7 3 5 6 4 1 LikelyTYOFHIBYDEPTISOGASEEEANDUCONHSEND31.60
2 1 3 6 4 5OBDYFHASEDPTHEIGSEONINUCETESNDAYO29.19
2 1 5 3 4 6OBNDOYASHEFDHETIPGONEISNETCEUSAYD28.95
6 2 1 5 3 4DOBNDOYASHEFDHETIPGONEISNETCEUSAY28.95
4 1 5 3 6 2 7IBPOTYDISSEEOGEEUACANONNDDHSFTHEY28.12
1 6 4 5 2 3BDENOASYOHADEDFTHENGPEOITNSCEIYSU28.07
1 4 6 5 2 3BEDNOASOYHADEFDTHENPGEOITSNCEIYUS27.91
2 1 3 4 6 5OBDFYHASEPDTHEISGEONIUNCETENSDAYO27.55
More options
  • The key SECRET is numbered 5 2 1 4 3 6. 33 letters in 6 rows of 6; the last row has 3, so the first 3 columns are one longer.
  • With the spaces back: nobody has fed the pigeon since tuesday
The message in rows under the key. The code is each column read downwards, column 1 first.
KeySECRET
RowColumn number 5Column number 2Column number 1Column number 4Column number 3Column number 6
Row 1NOBODY
Row 2HASFED
Row 3THEPIG
Row 4EONSIN
Row 5CETUES
Row 6DAY
The working, step by step (6 rows)

Where the code goes: each run of letters is dealt down the column with that number.

NumberColumnLetters
1C, column 3BSENTY
2E, column 2OAHOEA
3E, column 5DEIIE
4R, column 4OFPSU
5S, column 1NHTECD
6T, column 6YDGNS

How it works

This columnar cipher decoder numbers the columns from your key word, refills the grid and reads the rows. A columnar transposition keeps every letter and changes only their order. Below are 39 worked keys and routes.

Read the full guide

Key word first, then the code

The page numbers the key's letters alphabetically, equal letters from left to right, so SECRET becomes 5 2 1 4 3 6. The opening example puts 33 letters in six columns, so only the three leftmost columns get a sixth letter.

No key word, or a route instead

With no key, open Try every order. It lists the ten orders of 2 to 7 columns most like English. Press Use on the best. For a route cipher decoder, set Method to A route through the grid. If the page asks for a full grid, set Columns in the grid to a width it lists. Then open Try every route and press Use on the row that reads.

Tips
  • A key like 3 1 4 2 may label the columns or order them. Try The numbers are both ways.
  • Count the letters first. If no sensible width divides the total, the last row is short.
  • Spiral? Set The message was written to Down the columns. Written across, a top left spiral leaks the first row.

Questions and answers

How do I know a code is a transposition?

Count the letters. Only the order has changed, so E and T still lead, and a count close to plain English most likely means transposition. If Q, X and Z crowd the code, the letters were replaced, and no grid will help.

Why does the right key word give nonsense?

Usually the sender numbered repeated key letters alike, so TOMATO becomes 4 3 2 1 4 3. That is Myszkowski's 1902 rule: set Method to Repeated key letters share a number. If not, suspect a second key word.

What is double columnar transposition?

The same grid worked twice, often under two key words. Wikipedia traces serious use into the 1950s, though French codebreakers regularly solved Germany's in 1914. Under More options, fill in Second key word, if there is one. Keep it for puzzles.

All 39 worked keys and routes

Key words and their column order 14

  • 3 1 4 2 A key handed over as numbers can mean two things. Read as labels above the columns, 3 1 4 2 sends the second column out first. Read as the order in which to take the columns, it sends the third column out first and gives URCED WABEN EWYMK ARTAN EYBAO S instead. The example is encoded the first way, and a switch on the page tries the second.
  • ALMOST Column order 1 2 3 4 5 6. The letters are already in alphabetical order, so the columns are read in the order they were written and the key adds nothing. That is a transposition with no key, which is the scytale's job, not this page's.
  • BANANA Column order 4 1 5 2 6 3. The three As take 1, 2 and 3 from left to right, B takes 4 and the two Ns take 5 and 6. Number the As in any other order and the decode is nonsense, which is the usual reason a key with repeated letters fails.
Show all 39 worked keys and routes (36 more)

Key words and their column order, continued

  • CRYPTO Column order 1 4 6 3 5 2, as Wikipedia gives it. C is first in the word and first in the alphabet, so the first column written is also the first column read, and the code opens with the first letter of the message.
  • FOREVERJIGSAW Column order 4 8 9 2 12 3 10 7 6 5 11 1 13, as Wikipedia gives it. Thirteen columns, with E and R each used twice. A long key spreads a short message thin: the 46 letters of the example make only 4 rows, the last one 7 letters long.
  • GREEN DOOR Column order 4 8 2 3 5 1 6 7 9. The space is dropped before the letters are numbered, which leaves nine columns. E, O and R each appear twice.
  • JANEAUSTEN Column order 5 1 6 3 2 10 8 9 4 7. One of the two keys in the animated double transposition on Wikipedia's page. A, E and N each appear twice, so three ties are settled from left to right.
  • OWL Column order 2 3 1. Three columns can be arranged in only 6 ways, so a three-letter key falls to trial in a minute. Seven columns allow 5,040 and ten allow 3,628,800.
  • SECRET Column order 5 2 1 4 3 6, as Wikipedia gives it. The two Es are numbered from left to right, 2 then 3. This is the example the page opens with: 33 letters in 6 columns make 6 rows, and the last row holds only 3.
  • SIGNER Column order 6 3 2 4 1 5, the same as ZEBRAS. Only the order of the letters matters, never the word itself, so either key opens a message locked with the other.
  • STRIPE Column order 5 6 4 2 3 1, as Wikipedia gives it for the second key of its double transposition. No letter repeats, so the numbering has no ties to settle. The example has 32 letters, which leaves a last row of 2.
  • TOMATO Column order 5 3 2 1 6 4 under the usual rule: the first T is 5 and the second is 6, the first O is 3 and the second is 4. Wikipedia gives the same numbering before it shows the Myszkowski variant, which numbers this key 4 3 2 1 4 3.
  • WRONG Column order 5 4 3 2 1. The letters run backwards through the alphabet, so the columns are read from right to left. The example has 30 letters, which fill 6 rows of 5 exactly.
  • ZEBRAS Column order 6 3 2 4 1 5. The key word in Wikipedia's worked example, which turns we are discovered flee at once into EVLNA CDTES EAROF ODEEC WIREE. Z sorts last, so the first column written is the last one read.

Last rows, second keys and shared numbers 5

  • Last row padded with nulls The sender fills the last row with spare letters so that every column has the same length. Wikipedia's example pads with Q, K, J, E and U and gets EVLNE ACDTK ESEAQ ROFOJ DEECU WIREE. It decodes like any other code, and the nulls turn up as five stray letters after the last word.
  • Letters shuffled inside each row The message is cut into pieces as long as the key and each piece is shuffled by the column order. Wikipedia describes it as reading out by rows instead of columns. With the six-letter key STRIPE no letter moves more than five places, and a short last piece keeps only the numbers it has letters for.
  • One key word, used twice Wikipedia's article notes that a double transposition may use the same key for both passes. The example runs WRONG twice. Two passes of right to left do not cancel out, because each pass reads down the columns of a fresh grid: the result is RAOIO MTLNT IDLGW GASSO HKORW TENT.
  • Repeated letters share a number The Myszkowski transposition, which Wikipedia records as proposed by Émile Victor Théodore Myszkowski in 1902. Equal letters get equal numbers, so TOMATO becomes 4 3 2 1 4 3. Columns that share a number are read together, row by row from left to right. The article's example gives ROFOA CDTED SEEEA CWEIV RLENE.
  • Two key words, one after the other A double transposition: the code from the first key is written into a second grid under another key. Wikipedia runs its ZEBRAS code through STRIPE and gets CAEEN SOIAE DRLEF WEDRE EVTOC. To decode, undo the second key first, then the first.

Spiral routes 8

  • Spiral in, anticlockwise, from the bottom left Starts in the bottom left corner, runs right along the bottom row and turns anticlockwise at each corner until it reaches the middle. On the example grid, 4 rows by 6 columns filled down the columns, the first letters out are T H E O T E. The longest stretch of the message left in order is 4 letters, ENIN, which is NINE backwards.
  • Spiral in, anticlockwise, from the bottom right Starts in the bottom right corner, runs up the last column and turns anticlockwise at each corner until it reaches the middle. On the example grid, 4 rows by 6 columns filled down the columns, the first letters out are E N I N O E. The longest stretch of the message left in order is 4 letters, MEET.
  • Spiral in, anticlockwise, from the top left Starts in the top left corner, runs down the first column and turns anticlockwise at each corner until it reaches the middle. On the example grid, 4 rows by 6 columns filled down the columns, the first letters out are M E E T H E. The longest stretch of the message left in order is 4 letters, MEET.
  • Spiral in, anticlockwise, from the top right Starts in the top right corner, runs left along the top row and turns anticlockwise at each corner until it reaches the middle. On the example grid, 4 rows by 6 columns filled down the columns, the first letters out are N O E E B M. The longest stretch of the message left in order is 4 letters, MEET.
  • Spiral in, clockwise, from the bottom left Starts in the bottom left corner, runs up the first column and turns clockwise at each corner until it reaches the middle. On the example grid, 4 rows by 6 columns filled down the columns, the first letters out are T E E M B E. The longest stretch of the message left in order is 4 letters, NINE.
  • Spiral in, clockwise, from the bottom right Starts in the bottom right corner, runs left along the bottom row and turns clockwise at each corner until it reaches the middle. On the example grid, 4 rows by 6 columns filled down the columns, the first letters out are E T O E H T. The longest stretch of the message left in order is 4 letters, TEEM, which is MEET backwards.
  • Spiral in, clockwise, from the top left Starts in the top left corner, runs right along the top row and turns clockwise at each corner until it reaches the middle. On the example grid, 4 rows by 6 columns filled down the columns, the first letters out are M B E E O N. The longest stretch of the message left in order is 4 letters, NINE.
  • Spiral in, clockwise, from the top right Starts in the top right corner, runs down the last column and turns clockwise at each corner until it reaches the middle. This is the route in Wikipedia's route cipher example: a grid of 3 rows and 9 columns, filled down the columns and padded with J and X, comes out as EJXCT EDECD AEWRI ORFEO NALEV SE.

Snake routes 8

  • Snake along the rows from the bottom left Starts in the bottom left corner, reads the last row left to right, the row above it right to left, and carries on up the grid. On a grid filled by rows this route hands over a whole row untouched, so the example grid is filled down the columns. The first letters out are T H E O T E. No more than two letters of the message stay side by side.
  • Snake along the rows from the bottom right Starts in the bottom right corner, reads the last row right to left, the row above it left to right, and carries on up the grid. On a grid filled by rows this route hands over a whole row untouched, so the example grid is filled down the columns. The first letters out are E T O E H T. No more than two letters of the message stay side by side.
  • Snake along the rows from the top left Starts in the top left corner, reads the first row left to right, the second right to left, and carries on down the grid. On a grid filled by rows this route hands over a whole row untouched, so the example grid is filled down the columns. The first letters out are M B E E O N. No more than two letters of the message stay side by side.
  • Snake along the rows from the top right Starts in the top right corner, reads the first row right to left, the second left to right, and carries on down the grid. On a grid filled by rows this route hands over a whole row untouched, so the example grid is filled down the columns. The first letters out are N O E E B M. No more than two letters of the message stay side by side.
  • Snake down the columns from the top left Starts in the top left corner, reads the first column downwards, the second upwards, and carries on to the right. The example grid is filled by rows, because a grid filled down the columns would give this route a whole column in order. The first letters out are M T E A T N. No more than two letters of the message stay side by side.
  • Snake down the columns from the top right Starts in the top right corner, reads the last column downwards, the one before it upwards, and carries on to the left. The example grid is filled by rows, because a grid filled down the columns would give this route a whole column in order. The first letters out are Y E R E N O. No more than two letters of the message stay side by side.
  • Snake up the columns from the bottom left Starts in the bottom left corner, reads the first column upwards, the second downwards, and carries on to the right. The example grid is filled by rows, because a grid filled down the columns would give this route a whole column in order. The first letters out are A E T M E H. No more than two letters of the message stay side by side.
  • Snake up the columns from the bottom right Starts in the bottom right corner, reads the last column upwards, the one before it downwards, and carries on to the left. The example grid is filled by rows, because a grid filled down the columns would give this route a whole column in order. The first letters out are E R E Y B R. No more than two letters of the message stay side by side.

Diagonal routes 4

  • Diagonal snake from the top left The same diagonals, read in alternating directions: the first long one upwards, the next downwards, so every step lands on a neighbouring cell. The example grid is filled by rows and the first letters out are M T E E H E. No more than two letters of the message stay side by side.
  • Diagonal snake from the top right The same diagonals, read in alternating directions: the first long one upwards, the next downwards, so every step lands on a neighbouring cell. The example grid is filled by rows and the first letters out are Y E B T R R. No more than two letters of the message stay side by side.
  • Diagonals from the top left Starts with the single letter in the top left corner, then takes each diagonal in turn, working away from that corner. Every diagonal is read from its upper end down towards the left edge. The example grid is filled by rows and the first letters out are M E T E H E. No more than two letters of the message stay side by side.
  • Diagonals from the top right Starts with the single letter in the top right corner, then takes each diagonal in turn, working away from that corner. Every diagonal is read from its upper end down towards the right edge. The example grid is filled by rows and the first letters out are Y B E T R R. No more than two letters of the message stay side by side.

How this list was compiled: The 14 key words, 5 grid settings and 20 routes were put together for this site. The values marked as Wikipedia's come from the article Transposition cipher (https://en.wikipedia.org/wiki/Transposition_cipher), read on 2026-09-19: the numberings of ZEBRAS, STRIPE, TOMATO, CRYPTO, SECRET and FOREVERJIGSAW, the padded and unpadded ZEBRAS codes, the ZEBRAS then STRIPE double transposition, the Myszkowski example and the spiral route example. The build script reproduces each of those values exactly before it writes this list. Every other example message was written for this site, encoded by the script, decoded again by a separate routine and checked to match. The routes are the turning paths a grid allows from its corners: eight inward spirals, eight snakes and four diagonal readings. Straight readings down the columns are left out, because a grid read that way with no key is a scytale, which has its own page. Licence: own work; the published key numberings and example codes named in the source line are quoted with credit from Wikipedia