How do you decode the columnar transposition cipher?

Decoding rebuilds the grid the message was written in, so you need the keyword, or at least the alphabetical order of its letters. The keyword's length gives the number of columns. Divide the number of letters by it: the result is the number of full rows, and the remainder is how many columns, from the left, hold one more letter in a short last row. Fill the columns with the cipher text in the keyword's alphabetical order, then read the grid row by row. NSOAELSTUWPTNELHFR has 18 letters, so with the keyword TULIP, there are 3 full rows and 3 letters over, and the T, U and L columns hold 4 letters each:

T U L I P
4 5 2 1 3
P L A N T
T H E S U
N F L O W
E R S

The I column takes NSO, the L column AELS, then P takes TUW, T PTNE and U LHFR. Row by row, the grid reads PLANTTHESUNFLOWERS: plant the sunflowers.

Tool description

Put the cipher text in the Cipher text box and type its Keyword below the Cipher menu, in capitals or small letters. The Keyword field is empty at first, and while it has no letter, the tool asks for one with "Enter a keyword." After that, the decoded message builds up in the Plain text box as you type. Only letters and digits get rearranged: a space, a comma or a line break stays at the same spot as in the cipher text, so five-letter groups come back as five-letter groups. Insert sample adds etk nup ne tro oety ha Saao and the keyword PICNIC, and the message reads See you at the park at noon. To answer, swap the boxes with the button between them, and the decoded text becomes the input for encoding, or go to the Columnar Transposition Cipher Encoder. Other classical ciphers are in the Cipher menu. Decoding runs on your device, in the browser.

Examples

Cipher text Keyword Plain text
ianka e nrlacgk snn dsBbta PICNIC Bring a blanket and snacks
kosr yekoiBc in daoeFa OVEN Bake cookies on Friday
wtlm hk ita Saee WAVE Swim at the lake
OSOAN NTPTM EDSOL AAENE DNNO JUICE LEMON ADEST ANDOP ENSAT NOON
iaece te Ksh attbh CADB Kites at the beach

How to find an unknown keyword

  • The keyword's length is the number of columns, so try short keywords first. If the last row was full, the number of letters divides by it.
  • Any keyword with the same letter order works, so you don't need the exact word: BAKE reads what CAKE wrote. To try orders by hand, use keywords such as BADC, where A marks the column read first, B the next and so on.
  • If the key is given as numbers, such as 3 1 4 2, write it in letters, with A for 1, B for 2 and so on: CADB, as in the last example.
  • The Cipher Identifier tries short keywords in every column order. It names the order it finds with the first letters of the alphabet, such as DEBAC where the writer used TULIP. Paste the message with its spaces, if it has them: the decoded words must then fit between them, which rules out most wrong orders. On a short message without spaces, check that the whole text reads right, as a wrong order can also make words.

Good to know

  • Columnar text looks like rail fence text: the letters of real words, shuffled between the gaps. But a rail fence message always keeps its first letter in front, so if the first letter can't start a sentence, columnar is the better guess.
  • Some tools drop the repeated letters of a keyword, so BALLOON gives them five columns. If a message from such a tool won't decode, type the keyword without its repeats: BALON.
  • If the writer filled the last row with extra letters, such as X, they come back at the end of the decoded text.
  • If the tool says "Enter a keyword.", the Keyword field is still empty, or it holds no letter A to Z, only digits or signs.