Skip to content
100% local

Columnar transposition cipher

Encrypt or decrypt text by writing it into a grid and reading the columns back in key order.

Input
Output

Columnar transposition cipher

A columnar transposition cipher scrambles a message by writing it row by row into a grid as wide as a chosen key, then reading the grid back column by column in the order the key's letters would sort alphabetically. Nothing is substituted — every letter is still there, just rearranged — which makes it a natural companion to a substitution cipher like Vigenère or Atbash, and the basis of a puzzle-hunt clue where a keyword unlocks the grid.

The key sets two things at once: its length is the number of columns, and the alphabetical order of its letters is the reading order for those columns. Double transposition runs the grid a second time with a second key, resisting the column-frequency analysis a single pass leaves it open to. When the text doesn't divide evenly into full rows, leave the last row short (irregular) or pad it to a full rectangle with a fill character — padding is simpler, but the decrypted text carries that filler at the end. Keep spaces and punctuation for a readable grid, or strip everything but letters and digits for the classic wartime look. Show grid prints the grid as text, so you can see how the key reordered the columns.

The tool works on Unicode code points, so accented letters and emoji survive a round trip, and Windows and Unix line endings are treated the same way. The live tally reports characters in and out, the column count per pass, and whether the result was encrypted or decrypted.

Everything runs in your browser — the text and key you type are never uploaded. Copy the result, download it as a .txt file, or send the output back to the input to decrypt it again or chain another cipher on top.

FAQ

How does the key decide the column order?
Sort the key's letters alphabetically and number them 1, 2, 3... in that order — that numbering is the order the columns are read in. A key of ZEBRA reads columns in the order A, B, E, R, Z.
What's the difference between irregular and padded last rows?
Irregular leaves the last row exactly as long as the remaining text, which some columns a little shorter than others. Pad fills the grid out to a full rectangle with the fill character first, so every column is the same length — but that filler will appear at the end of the decrypted text.
What does double transposition add?
It runs the whole cipher a second time, with a second key, on the output of the first pass. That breaks up the column patterns a single transposition leaves behind and was standard practice for hand ciphers used in the field.
Can I decrypt a message I made with a different tool?
Yes, as long as you use the same key, the same last-row setting and the same keep-spaces choice used to encrypt it — those settings determine the exact grid shape, and a mismatch will scramble the result instead of reversing it.
Is my text or key uploaded anywhere?
No. The cipher runs entirely in your browser — your text and key never leave your device.