Rail Fence Cipher
Encode and decode messages with the zig-zag Rail Fence cipher.
Result
How to use
- Enter your values in the fields above.
- Press Calculate to see your result instantly.
- 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?
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
No calculators found
Comments (0)