Rail Fence Cipher

Encode and decode messages with the zig-zag Rail Fence cipher.

How to use

  1. Enter your values in the fields above.
  2. Press Calculate to see your result instantly.
  3. Use the Share button to copy a link to your result.

About this calculator

This tool encrypts or decrypts text with the Rail Fence cipher, a transposition cipher that writes the message in a zig-zag pattern down and up across a chosen number of "rails" (rows), then reads the letters off row by row to produce the ciphertext. Unlike substitution ciphers, it doesn't change any letters — only their order.

It's a classic introductory example in cryptography courses and a favorite of puzzle and escape-room designers because it's easy to encode by hand yet illustrates the core idea of transposition. Enter your text and choose the number of rails to encrypt or decrypt instantly.

Was this helpful?

Comments (0)

  • Be the first to comment.

Popular calculators

All Calculators