TranspositionDifficulty: Medium
Rail fence cipher
Write the message in a zigzag across several fence rails, then read it off rail by rail. Tidy text turns into apparent chaos.
Try it
27 characters
Result · Rail fence cipher
SESETLERTESGFRHCUCMAOEB
How it works
- 1Choose the number of rails, for example 3, and write the message without spaces.
- 2Place the letters diagonally down to the bottom rail, then diagonally back up, like stitching a zigzag.
- 3Read the first rail left to right, then the second, then the third. The joined text is the ciphertext.
- 4Example: WEAREDISCOVERED on 3 rails gives WECRERDSOEEAIVD.
- 5To decode, count how many letters fall on each rail, split the ciphertext into those parts and walk the zigzag again.
Example
We are discovered
WECRERDSOEEAIVD
Did you know
The rail fence cipher is a simple transposition named after the zigzag that resembles a split-rail fence. It is often described as a field cipher of the American Civil War, as it can be done with pencil and paper only. The only key is the number of rails, so every option can be tried by hand.
Try to decode
This message is encrypted with Rail fence cipher using the default settings:
ACDTAKTANTAW
Hint
The cipher uses 3 rails and spaces were left out.
Show solution
ATTACK AT DAWN
More ciphers in this category
- Reverse textThe simplest transposition: the letters stay, you just read them backwards - the whole text, word by word, or as a pyramid.
- Skip cipher (every N-th letter)Letters are stored at every N-th position, and after reaching the end you start again from the second slot. A scrambled text that hides your message.
- Grid cipherWrite the text into a square grid along diagonals, a spiral or a zigzag, then read it row by row. The letters only change places.
- Columnar transpositionWrite the message in rows under a keyword and read it off by columns in the alphabetical order of the key letters.