← Back to Home

Rail Fence Cipher

The zigzag transposition cipher.

About the Cipher

The Rail Fence Cipher (also known as the zigzag cipher) is a form of transposition cipher. It gets its name from the way the message is written: up and down on successive "rails" of an imaginary fence, much like the wooden rails of a physical fence. Unlike the Playfair cipher which substitutes letters, this cipher simply rearranges their order.


Rail Fence Zigzag Diagram

How It Works

Interactive Tool

...