Rail Fence Cipher
Classical transposition cipher — text is written in a zigzag across rails, then read off row by row.
Zigzag pattern (plain text → rail pattern)
W E C R L H
E R D S O E E F E A E D
A I V D E A
How the rail fence cipher works
The rail fence cipher writes the plaintext in a zigzag pattern across nimaginary rails. For example with 3 rails and text "WEAREDISCOVERED", the pattern is:
W . . . E . . . I . . . V . . . D . E . R . D . S . O . E . E . F . . . A . . . C . . . R . . . A . .
Reading each rail left-to-right and concatenating gives the ciphertext: WEIDVERDSOEEFARECA. Decryption reverses the process — place the known pattern of positions, fill in rows, then read diagonally. For other classical ciphers try Affine Cipher and Caesar Cipher.
Private & free — this tool runs entirely in your browser.
Recommended: IndieKit — Ship your Next.js startup in days.affiliate
Related Converters tools
JSON to YAML
Convert JSON into clean, readable YAML instantly.
YAML to JSON
Convert YAML configuration into valid JSON.
JSON to CSV
Flatten a JSON array of objects into CSV rows.
CSV to JSON
Parse CSV with headers into a JSON array of objects.
JSON to XML
Convert JSON structures into nested XML markup.
JSON Minifier
Strip whitespace to produce compact JSON.
JSON to TypeScript
Generate TypeScript interfaces from a JSON sample.
JSON to SQL
Turn a JSON array of objects into SQL INSERT statements.