UTILS.
100% in-browser
🏛️

Columnar Transposition Cipher

Keyword-driven columnar transposition: fill a grid row-wise, then read columns in the alphabetical order of the keyword letters. Complete or incomplete variant.

— output appears here —

About this tool

The Columnar Transposition Cipher tool is a free, in-browser encoder and decoder for a keyword-driven transposition cipher used historically by militaries and now common in CTFs. The plaintext is written left-to-right into a grid whose width equals the length of the keyword. Each column is then numbered by the alphabetical rank of the keyword letter above it — ties are broken left-to-right — and the ciphertext is produced by reading the columns out in ascending rank order. For the keyword ZEBRAS, for example, the A-column is read first, then B, then E, R, S, Z.

Two variants are supported. In the complete (padded) variant the final short row is filled with a pad character of your choice so every column is the same height. In the incomplete (irregular) variant no padding is added, leaving a ragged last row; decoding then carefully computes each column's true length so the letters land back in the right cells. All computation is done locally in your browser and nothing is uploaded.

Decoding reverses the process: from the ciphertext length and keyword the tool determines how many letters each column holds, assigns the ciphertext blocks to columns in key-rank order, and reads the reconstructed grid back row by row. In the padded variant any trailing pad characters are trimmed from the recovered text. Because transposition changes only letter positions and not their identities, columnar transposition is often layered with a substitution cipher for extra strength.

Frequently asked questions

How is the column read order chosen?
Each column is ranked by the alphabetical order of the keyword letter above it, with ties broken left-to-right. Columns are then read out from lowest rank to highest. For ZEBRAS the order is A, B, E, R, S, Z.
What is the difference between complete and incomplete?
Complete pads the last row with a pad character so all columns are equal height; incomplete leaves the final row ragged with no padding. Decoding accounts for the uneven column lengths in the incomplete variant.
What is the pad character for?
In the complete variant it fills any empty cells in the final row so every column has the same number of letters. It should be a letter unlikely to appear in the message, such as X; it is trimmed off when decoding.
Does the keyword's spelling matter or just its letters?
Only the alphabetical order of the letters matters, so keywords with the same sorted-letter pattern give the same permutation. Repeated letters are ranked left-to-right in the order they appear.

More tools