Rail Fence Cipher Encoder & Decoder

Zig-zag transposition cipher with a choice of rails.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

Rail fence cipher encoder and decoder

The rail fence cipher is a classic transposition cipher: your text is written in a zig-zag across a chosen number of rows, or rails, then read off one row at a time. The letters are rearranged rather than substituted.

Choose encrypt or decrypt, set the number of rails, and type your text — the output updates instantly, all inside your browser.

Ad placeholder (rectangle)