Tool to write/read a spiral cipher. The spiral encryption/writing system consists to write a text in a quadrangular spiral and read it by lines or columns.
Spiral Cipher - dCode
Tag(s) : Transposition Cipher
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
Spiral writing is a method of arranging text within a grid (square or rectangular) in a spiral pattern, with a predetermined starting point and direction of rotation.
When used to encrypt a message, it constitutes a transposition cipher: the letters are not changed, but simply rearranged according to a geometric rule.
The plaintext is written following the spiral pattern, and then the ciphertext is obtained by reading it in a different order (by rows, by columns, or according to another agreed-upon sequence).
To encrypt a message by spiral writing, imagine a quadrangular spiral (written in a square). Then write the message by turning like a spiral/snail.
Example: Code SPIRALS99 via an inner spiral from the top left, clockwise direction:
| S | P | I |
| 9 | 9 | R |
| S | L | A |
Example: Code CYCLONIC! via an outer spiral from below, trigonometric rotation:
| I | N | O |
| C | C | L |
| ! | Y | C |
If the spiral doesn't form an exact square (or rectangle), filler characters like X can be added. Avoid spaces, as they are visually invisible and can introduce ambiguities.
Then read the grid according to another agreed-upon rule (by rows, by columns, etc.) to obtain the encrypted text.
Example: The ciphertext is S9SP9LIRA (example 1) or IC!NCYOLC (example 2)
Decryption is writing the message in rows or in columns and reading the text in a spiral. It is necessary to know the mode of writing (inward or outward, trigonometric direction or clockwise, etc.)
Example: RNOOSITAT written in rows in a square grid becomes
| R | N | O |
| O | S | I |
| T | A | T |
a spiral reading gives the plain message ROTATIONS.
Since spiral encryption is a transposition cipher, the frequencies of the letters are preserved, the coincidence index of the text is the same of the original plain message language.
Sometimes a word or text is formed on one or more created lines or columns (the word may be written backwards).
Ideally the encrypted message has a number of square characters (whose square root is an integer: 9, 16, 25, 36 etc.)
Any reference to a whirlwind, cyclone, vortex, or anything rotating around something is a clue.
Variations of the spiral cipher involve several parameters:
— The starting point (corner, center, edge)
— The type of spiral: inner spiral (towards the center), outer spiral (from the center)
— The direction of rotation: clockwise, counterclockwise
— The final reading method: by rows, by columns, boustrophedon, etc.
More generally, this method belongs to the family of route ciphers, in which the message follows a predefined geometric path within a grid.
dCode retains ownership of the "Spiral Cipher" source code. Any algorithm for the "Spiral Cipher" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Spiral Cipher" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Spiral Cipher" or any other element are not public (except explicit open source licence). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.
The content of the page "Spiral Cipher" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source (Creative Commons CC-BY free distribution license).
Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link:
In a scientific article or book, the recommended bibliographic citation is: Spiral Cipher on dCode.fr [online website], retrieved on 2026-03-19,