Join the Official Discord

Columnar transposition cipher

Enter a keyword or a number key like 3142. No key? “Try all” tests every column order.

Mode
Result

The grid

Best column orders

    How columnar transposition works

    1. Write the keyword across the top, one letter per column. ZEBRAS gives six columns.
    2. Write the message underneath in rows, left to right.
    3. Number the columns in the alphabetical order of the keyword's letters. In ZEBRAS, A is 1, B is 2, E is 3, R is 4, S is 5 and Z is 6.
    4. Read each column top to bottom, in number order, and string them together.

    WEAREDISCOVEREDFLEEATONCE under ZEBRAS becomes EVLNACDTESEAROFODEECWIREE. Type it into the tool to see the grid.

    Padding and number keys

    If the message doesn't fill the last row, some setters pad it with X's and some leave it short. The decoder handles both. A number key such as 632415 is the same as a keyword: it just states the column numbers outright. When you crack a message without the key, the result is given as a number key, because the original keyword can't be recovered. Many words give the same order.

    Cracking it without the key

    A transposition keeps every letter, so frequency analysis looks exactly like English. That's the giveaway. “Try all” decodes with every column order for 2 to 7 columns, 5,912 orders in all, and ranks them by how English they read. Longer keys need a smarter search. In a puzzle, the keyword is usually hidden nearby.

    Columnar transposition was the backbone of many military ciphers. Doing it twice, as double transposition, was strong enough for field use into the Second World War.

    Step-by-step guide How to solve a Columnar Transposition by hand, with a worked example

    Questions

    How does columnar transposition work?

    Write the message in rows under the keyword, one letter per column. Then read the columns off top to bottom, in the alphabetical order of the keyword's letters. The letters don't change, only their order.

    What if the last row isn't full?

    Some setters pad it with X's, others leave it short. The tool decodes either kind. Untick “Pad the last row” to encode without padding.

    Can I use a number key?

    Yes. 3142 means the column under 1 is read first, then 2, and so on. A keyword is just a way to remember the numbers: its letters' alphabetical order gives the same thing.

    How do I crack it without the key?

    Choose “Try all”. The tool tests every column order for 2 to 7 columns, about 5,900 possibilities, and ranks them by how English they read.

    More cipher tools

    See all cipher tools →