Skip to content
Also from us: TypologyOnline.com · Free personality tests

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: The Zigzag That Hid the Message

How one of the simplest transposition ciphers scrambled plaintext by changing where the letters sit, not what the letters are.

Read the article
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