Rail Fence Cipher

Write text in zig-zag rails and read row-by-row.

Input

Output

Using This Tool: Guide & Notes Show guide

Rail Fence writes text in a zig-zag path across rails, then reads the rows to produce ciphertext.

How to use it

  • Choose the number of rails.
  • Paste the plaintext or ciphertext.
  • Use Encrypt to write the zig-zag and read rows, or Decrypt to reconstruct the path.
  • Check the rail preview to understand the rearrangement.

Options and settings

  • Rail count changes the height and rhythm of the zig-zag pattern.
  • Preserve spacing controls whether spaces remain part of the visible output.
  • Grouping creates classical-looking ciphertext blocks.
  • Reset defaults returns to the standard simple demonstration settings.

Notes

  • Rail Fence is a transposition cipher: letters are moved, not replaced.
  • Very low rail counts are especially easy to recognise.
Related Article

Rail Fence Cipher guide coming soon

The matching article is not published yet. This tool is ready now, and the guide can be added through the shared article template when it is written.

Guide coming soon
Signal acquired

A note from the team

We build these tools because we love cryptography, encoding, and making difficult ideas easier to explore. If they've helped you, even a small coffee means the world to the project. Thank you!

Say thanks on Ko-fi