These Rail Fence puzzles ask you to rebuild a message from its zigzag. Each question gives you 2 or 3 rails, starting at the top and moving downward. The messages use A–Z letters only; blank cells in the diagram are not hidden spaces.

What to do

  1. Count the ciphertext letters.
  2. Mark that many positions along the specified zigzag.
  3. Count the positions on each rail.
  4. Fill rails with ciphertext from top to bottom, left to right.
  5. Read the zigzag to recover the prepared message.

Sample with uneven rails

InputMEETME
Settings3 rails; path 1, 2, 3, 2, 1, 2
Expected resultMMETEE
Try this method
RailPositionsLetters
11 and 5MM
22, 4, and 6ETE
33E

Read the three rails to make MMETEE. To decode it, fill rails of 2, 3, and 1 letters, rather than putting two letters on every rail. Leave grid cells outside the zigzag empty.

A quick extra question

Encode ABCDEF with two rails. Which letters go on the top rail?

Use distinct letters to check the path

If two grids do not match, try ABCDEF before a word with repeated letters. It is easier to spot a misplaced letter when every letter is different. Return to the original puzzle once the writing and reading directions are clear.

Choose a seed and the number of questions, then make the set. Save these settings with the Rail Fence worksheet type and generator version to reproduce it later. Select A4 or Letter, and keep the separate answer pages for checking or omit them from the download.

Rail Fence cipher toolFollow a three-rail exampleSubstitution vs. transposition