Join the Official Discord
Cipher guides · Transposition

How to Solve the Rail Fence Cipher

A transposition cipher doesn't change any letters at all. Every letter of the answer is already in front of you; they have simply been written down in the wrong order.

How to recognise it

Count the letters. If the frequencies look like ordinary English — plenty of E, T, A, O — but nothing reads, the message has been reordered rather than substituted.

Rail Fence The message was written in a zigzag across 3 lines, then read off line by line.

A worked example

Message

TREASURE MAP

Key

3 rails

Encoded

TSMRAUEAERP

Every letter of the answer is already in front of you — they are simply in the wrong order. Counting the letters is the first useful thing you can do. This one is Rail Fence. The key: 3 rails. The message was written in a zigzag across 3 lines, then read off line by line. Rebuild the grid, read it back in the original order, and the first letters come out T R E. The answer was TREASURE MAP.

Working one out from scratch

Find the shape the writer used: how many rails, how many columns, which route. The letter count is your best lever, because it tells you which rectangles the message could have been written into.

Now try one

There’s a new cipher waiting today

One a day, three guesses, and a streak that breaks the moment you miss one. Today’s is cipher #1.