What if a message does not fill the final row of a columnar grid? Try MEETATGATE with key BIRD: ten letters across four columns leave two cells empty. Those blanks affect column lengths, so we need to account for them before decoding.

1. Fill rows under the key

Position1234
KeyBIRD
Row 1MEET
Row 2ATGA
Row 3TE——
Length3322

The dashes mark empty cells in the table; they are not message characters. There is no need to add X, spaces, or any other padding.

2. Read columns in key order

Read orderKey letterOriginal positionLetters
1B1MAT
2D4TA
3I2ETE
4R3EG

The ten-letter output

InputMEETATGATE
SettingsKey BIRD; alphabetical order B, D, I, R; no padding
Expected resultMATTAETEEG
Try this method

3. Split by the original lengths

The key gives read order 1, 4, 2, 3, with column lengths 3, 2, 3, 2. Split MATTAETEEG into MAT | TA | ETE | EG. Put these pieces under B, D, I, and R, keeping each piece in top-to-bottom order.

4. Read the rows again

Return the columns to B, I, R, D order. Read across to get MEET, then ATGA, then TE: MEETATGATE. Any spaces removed before encoding are still absent; the grid only tells us the order of the letters.

Your turn

Keep the same key BIRD but use ABCDEFGHI. What are the four original column lengths?

Continue the lesson

Columnar transposition toolRepeated letters in columnar keysScytale cipher tool