About this tool
The Rail Fence Cipher Encoder / Decoder is a free, in-browser tool for the best-known transposition cipher. Instead of substituting letters it rearranges them: the plaintext is written in a zig-zag down and up across a chosen number of horizontal rails, then read off one full rail at a time from top to bottom. With 3 rails the letter positions follow the pattern 0,1,2,1,0,1,2,… so consecutive characters land on different rows before being regrouped.
To decode, the tool rebuilds the exact zig-zag path for the ciphertext length, works out how many characters belong to each rail, slices the ciphertext into those rails, and then walks the zig-zag again to lift the letters back into their original order. It supports 2 or more rails, an optional starting offset that shifts where in the zig-zag the first letter sits, and treats a single rail as an identity (no change). Everything runs locally in your browser with nothing uploaded.
By default spaces and punctuation are carried along as ordinary characters so the transposition is fully reversible; a toggle lets you strip non-letters before encoding when you want a clean letters-only ciphertext. The rail fence is the classic partner to the Caesar cipher in cryptography lessons and a frequent sight in CTF challenges and escape rooms, illustrating how transposition ciphers hide a message by scrambling position rather than identity.