Cryptography & Ciphers
Rail Fence Cipher Encoder
Encode text with the rail fence zigzag cipher. Choose rails and offset while preserving spaces and punctuation.
This tool runs open-source code from CyberChef by GCHQ (Apache License 2.0). See open-source credits.
The encoder writes characters down and up the rails, then reads each row from top to bottom.
The result contains the same character units in a different order.
- Build a transposition clue for a classroom lesson, puzzle hunt, or escape room.
Rearrange WEAREDISCOVEREDFLEEATONCE
Input: WEAREDISCOVEREDFLEEATONCE
Settings: Rails 3 and Offset 0.
Result: WECRLTEERDSOEEFEAOCAIVDEN
The three rows contain WECRLTE, ERDSOEEFEAOC, and AIVDEN.
Set rails and offset without discarding spaces
- Enter the message.
- Set Rails and Offset. Zero offset starts at the top rail.
- Save both settings with the ciphertext.
- Spaces and punctuation occupy rail positions.
- UTF-16 code units can split an emoji.
- The cipher preserves letter frequencies and does not protect secrets.