Rail Fence Cipher Decoder

Encode and decode Rail Fence ciphers with rails and optional offset.

Plaintext

This page is dedicated to Rail Fence Cipher Decoder.
Letters only.
Offset shifts the starting zig-zag position before placing the first character.

Ciphertext

Rail Fence Cipher Decoder — explanation, history & tips

Family: Transposition Era: 1800s+ (popular puzzles) Strength: Weak

The Rail Fence cipher writes text in a zig-zag pattern across a chosen number of rails, then reads it row by row. Set the number of rails (and optional offset) and this tool will encode or decode instantly so you can test rail counts quickly.

  • Pick Encode or Decode.
  • Set the number of rails (try 2–6 first).
  • Optional: set offset if you suspect a shifted start.
  • Watch the output; readable text often appears quickly.

History (quick)

A classic transposition cipher: it scrambles order rather than substituting letters. It’s widely used in puzzle books and beginner CTFs because you can often guess the rail count by trying small values and looking for readable output.

Quick FAQs

What’s a good first guess for rails?
Try 2–5. Many puzzle rail fences use small rail counts.
What does offset do?
It shifts the starting zig-zag position before placing the first character—useful for variants seen in puzzles.
How do you break it without rails?
Brute-force small rail counts and check for crib words/patterns; transposition keeps letter frequencies intact.
Want to decode with no key? Try our Cipher Breaker →