Pigpen cipher
The pigpen cipher swaps each letter for a symbol made of lines and, sometimes, a dot. It uses no numbers and no letters: the message looks as if it were written in a secret alphabet, which makes it irresistible in an escape room. Its name comes from the way the letters sit in their cells, like pigs in their pens; in Spanish it is the Freemason's cipher (cifrado francmasón).
How it works
The key is four figures: two noughts-and-crosses grids and two X's.
- The first grid holds the letters A to I, left to right and top to bottom; the second holds J to R, each with a dot.
- The first X holds S (top), T (left), U (right) and V (bottom); the second holds W to Z, also with a dot.
- Each letter is written as the lines around its cell. A, top left, is a corner; E, in the centre, is a square; N is that same square with a dot inside.
With the 27-letter alphabet, Ñ is N's symbol with a tilde over it, just like the letter itself. No other letter changes, so the classic key still works. Digits and punctuation are copied as they are.
A little history
Eighteenth-century Freemasons used a version of this cipher to keep their secrets, which is where its Spanish name comes from. It has also been found carved on gravestones, like that of James Leeson (1794) in the churchyard of Trinity Church in New York, and some prisoners are said to have used it during the American Civil War. It is easy to learn and to remember, but anyone who knows the key reads it in a moment: it is for playing, not for hiding things for real.
Try it
Type a message to see its symbols, with the key drawn beside them. To decode, switch to "Decode" and press the symbols on the keyboard under the text: the tool writes the message as you go. Screen readers name each symbol by its shape ("grid, top left"), never by its letter, so the puzzle stays a puzzle.
No key: everyone uses the same grids.
- A: grid, top left
- B: grid, top
- C: grid, top right
- D: grid, left
- E: grid, centre
- F: grid, right
- G: grid, bottom left
- H: grid, bottom
- I: grid, bottom right
- J: grid, top left, with a dot
- K: grid, top, with a dot
- L: grid, top right, with a dot
- M: grid, left, with a dot
- N: grid, centre, with a dot
- O: grid, right, with a dot
- P: grid, bottom left, with a dot
- Q: grid, bottom, with a dot
- R: grid, bottom right, with a dot
- S: X, top
- T: X, left
- U: X, right
- V: X, bottom
- W: X, top, with a dot
- X: X, left, with a dot
- Y: X, right, with a dot
- Z: X, bottom, with a dot
35 of 600 characters
When you copy the result, each symbol is written as a look-alike character (⌟ ⊔ ⌞, with a dot over it if it has one), which the tool reads back. The cipher's worksheet prints the key in a large size.
Classroom ideas
- Secret posters. Stick clues written in symbols around the classroom and hide the key in another corner: they have to find it first.
- Incomplete key. Hand out the key with some letters erased; students work them out from words they already know.
- Chalk message. Write a short word in symbols on the board as the lesson starts: whoever decodes it opens the first lock.
- Key makers. Ask them to invent their own version by changing the order of the letters in the figures, and to encode a message for another team.
Tips
- Draw the dots clearly: without them, A and J are the same symbol.
- For younger students, print the key large and use short words; give older ones only the first grid and let them work out the rest.
- Create a lock from a message: its clue shows the symbols on screen and on paper.
Printable worksheet
Practise this cipher on paper: a worksheet with the key and two exercises, ready to print or download with its answer key. Open the worksheet