Free Online Tool
Rail Fence Cipher
Encode messages using the Rail Fence transposition cipher with zigzag pattern encryption.
How to Use Rail Fence Cipher
- Enter text and choose the number of rails; the examples use 3.
- Select Encode to write characters in a down-and-up zigzag.
- The output concatenates rail 1, rail 2, and rail 3 without removing spaces.
- Switch to Decode with the same rail count to reconstruct the zigzag positions.
Rail Fence is a transposition cipher: it changes character positions but never substitutes their values.
Examples
Classic three-rail example:
WEAREDISCOVEREDFLEEATONCE
Output:
WECRLTEERDSOEEFEAOCAIVDEN
Spaces remain characters in the zigzag:
HELLO WORLD
Output:
HOREL OLLWD
Features
Privacy Focused
All processing happens in your browser. No data is sent to servers.
Free Forever
No registration, no limits, completely free to use.