Rail Fence

Encode text using a zigzag pattern.

Codes

Encode or decode a message with Rail Fence, a transposition cipher that distributes characters in a zigzag across several rails. View the pattern and easily copy the result.

Rail Fence

Enter a message, choose the rails, then run the conversion.

Mode
Choose at least 2 rails. 3 rails is common for puzzles.

Result

The preview shows how characters are distributed across rails.

Zigzag preview
 

Quick explanation

Enter a message, choose the mode and a rail count from 2 to 12. The tool distributes characters in a zigzag to encode the text or reconstructs their original order during decoding.

Try this too

Need another grid-based transposition?

Use the Scytale to encode or decode a message according to a selected grid width.

Try this tool

Additional information

Tool currently being tested and written

Rail Fence is currently being tested and written.

A cleaner, clearer and more polished version will arrive on the site soon. It will replace this temporary block with notes that match the actual behavior of the tool.

Until then, you can use the tool interface, keeping in mind that its presentation and explanations may still evolve.

Limits and reuse

AppErgo tools are provided free of charge for practical and informational purposes. Although care is taken in their design, a result may be incomplete, unexpected or incorrect. Before relying on a result for any important use, check it using an appropriate method.

To report a bug in the tool, you can use the dedicated bug report form.

Results produced by AppErgo tools may be copied and reused freely. When publicly reusing a result, a method or an AppErgo page, a link to the relevant page is appreciated.

Unless otherwise stated, AppErgo texts, images, visual elements, scripts, templates and internal components remain the property of AppErgo.

For any other request, you can contact the webmaster.