Classical cipher

Columnar Transposition Cipher

Encode or decode a single columnar transposition with stable keyword ordering, explicit text handling, and an inspectable grid.

0 / 20,000 UTF-16 units

Preserve mode moves every Unicode code point, including spaces and line breaks. Classical mode keeps only ASCII letters A-Z.

Use 2 to 32 ASCII letters. Case is ignored; equal letters are ordered from left to right.

The selected rule is applied before both encoding and decoding.

Padding applies only when encoding. Decoding keeps every trailing X because padding cannot be identified safely.

Mode
Published duplicate-key example:

No output yet.

Exact convention

  1. The normalized message is written left to right in rows as wide as the keyword.
  2. Keyword letters are compared as uppercase ASCII. Columns are read by ascending letter; ties keep their original left-to-right order.
  3. Encoding reads each selected column downward. Decoding calculates each original column length, fills columns in that same order, then reads rows.

Text handling

  • Preserve every character does not normalize Unicode. Each Unicode code point occupies a cell; a combining mark can therefore move separately from its base character. Browser textareas expose line breaks as LF.
  • ASCII letters only removes every non-ASCII-letter character and returns uppercase A-Z. Removed spacing cannot be recovered.
  • The 20,000-unit limit uses JavaScript UTF-16 length. An emoji normally counts as two units toward the limit but occupies one grid cell.

Security note: Single columnar transposition is a historical hand cipher for learning and puzzles. It is not suitable for protecting sensitive information.