How the pigpen cipher works
Draw a noughts-and-crosses (tic-tac-toe) grid and write A to I in its nine cells. Draw a second grid, put a dot in each cell, and write J to R. Draw a large X and write S, T, U, V in its four arms. Draw a second X with dots for W, X, Y, Z.
Each letter is then written as the shape of the lines around it:
- A sits in the top-left corner of the first grid, with a line to its right and a line below. Its symbol is those two lines, like a backwards L.
- E sits in the middle, fenced on all four sides. Its symbol is a square.
- N is in the same position as E, but in the dotted grid. Its symbol is a square with a dot.
- S sits in the top arm of the X. Its symbol is a V shape.
The chart under the tool shows all twenty-six.
Reading a pigpen message
If you have been handed a row of pigpen symbols, use the chart as a keyboard: tap each symbol in turn and the letters appear in the plain text pane. Check the dots carefully; they are the easiest thing to miss.
If the message does not make sense, it may use a different layout of the grids. In that case treat it as an unknown substitution cipher: assign each distinct symbol a letter of your choosing, then put the result through the cryptogram solver.
History
Grid-based ciphers of this kind are found in Hebrew-language Kabbalistic writing from the medieval period, and versions were described in print in the sixteenth century. The cipher is most closely tied to the Freemasons, who used it widely in the eighteenth century to keep lodge records and correspondence private. It can still be seen carved on some Masonic gravestones.
The most-photographed example is the tombstone of James Leeson, who died in 1794, in Trinity Churchyard in New York. Its pigpen inscription reads “Remember death”.
It was also reportedly used by Union prisoners in Confederate prisons during the American Civil War. Today it lives mostly in children’s puzzle books, scouting and video games, which is perhaps the right home for a cipher whose chief virtue is that it is fun to draw.
Questions people ask
How do I decode a pigpen cipher?
Match each symbol to the chart. Look at which sides of the square are drawn and whether there is a dot. On this page, tap each symbol on the pigpen alphabet below the tool and the letters are typed for you.
Why is it called pigpen?
The grid lines look like the fences of an animal pen, with each letter shut in its own stall. It is also called the Masonic cipher, the Freemason's cipher and the tic-tac-toe cipher.
Is there more than one version of pigpen?
Yes. The layout here (A to I in the first grid, J to R in the dotted grid, S to V in the first X, W to Z in the dotted X) is the most common today. Older and regional versions fill the grids in a different order or put the dots elsewhere, so a message from another source may need a different key.
Is pigpen secure?
No. It is a simple substitution cipher: each letter always becomes the same symbol. Odd-looking symbols feel more secret than letters, but they fall to frequency analysis just the same.