Pigpen Cipher
Translate text to and from the pigpen cipher — the Masonic or Freemason cipher — that replaces each letter with a symbol drawn from two tic-tac-toe grids and two X shapes. Type to watch your message turn into symbols, click symbols to decode a message back into letters, follow along on the live A–Z chart, and download the result as an image. Everything runs in your browser.
Type text above to see it written in pigpen symbols.
Pigpen alphabet
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
How to use Pigpen Cipher
- 1
Choose encode or decode
Pick Encode to turn plain text into pigpen symbols, or Decode to turn symbols you have seen back into letters.
- 2
Type your message to encode
In Encode mode, type or paste your text. Each letter becomes a pigpen symbol instantly, while spaces and punctuation are kept as they are.
- 3
Click symbols to decode
In Decode mode, use the on-screen symbol keyboard to click the shapes you see, in order. Use Space between words and Backspace to fix a slip.
- 4
Use the alphabet chart
Open the pigpen alphabet chart to see every letter and its symbol. It is the exact key this tool uses, so you can check or copy any shape.
- 5
Save, copy, or share
Download your encoded message as an SVG image, copy the decoded text, or share a link that reopens the tool with your exact message ready to go.
Understanding the Pigpen Cipher
What is the pigpen cipher?
The pigpen cipher is a simple substitution cipher that swaps each letter of the alphabet for a little geometric symbol instead of another letter. Because those symbols are built from the lines of two grids and two crosses, an encoded message looks like a row of angular shapes rather than text — which is a large part of its charm. It goes by many names: the Masonic cipher, the Freemason's cipher, the Napoleon cipher, the tic-tac-toe cipher, and the Rosicrucian cipher, all describing the same idea.
It is one of the most recognisable ciphers in the world and a favourite first cipher for children, puzzle makers, escape rooms, and capture-the-flag challenges, because the symbols are easy to draw by hand and fun to decode. This tool turns text into pigpen symbols as you type, lets you decode a message by clicking the symbols you see, and shows the full alphabet chart so you can learn the system at a glance.
How the pigpen cipher works
Start by writing the alphabet into four diagrams: two tic-tac-toe grids and two X shapes. The first grid holds A, B, C, D, E, F, G, H, I; the second grid holds J, K, L, M, N, O, P, Q, R; the first X holds S, T, U, V; and the second X holds W, X, Y, Z. Each letter's symbol is simply the lines that surround its position in the diagram. A letter in a grid cell is drawn as the lines that box that cell in, and a letter in an X is drawn as the wedge of the cross that points to its position.
To tell the two grids and the two X shapes apart, the second grid and the second X add a dot inside each symbol. So a plain three-sided shape and the same shape with a dot are two different letters. The letter E, for example, sits in the centre of the first grid surrounded on all four sides, so its symbol is a complete square; N sits in the centre of the second grid, so its symbol is that same square with a dot — the dotted twin of E.
The grids, the X shapes, and the dots
Reading the symbols becomes easy once you see the pattern. In each grid, a corner cell keeps only two of its lines, an edge cell keeps three, and the very centre keeps all four to make a closed box. B, in the top-middle cell, is open at the top and closed on the other three sides, giving a U shape; A, in the top-left corner, keeps just the line on its right and the line below it, giving a right-angle corner. Every grid letter is one of these open or closed boxes.
The last eight letters live in the two X shapes. Picture a cross with four triangular wedges — top, right, bottom, and left — and fill them clockwise from the top: S, T, U, V take the top, right, bottom, and left wedges of the first X, and W, X, Y, Z take the same four wedges of the second X, each marked with a dot. Different books sometimes arrange the X letters in a slightly different order, so the safest habit is to share the exact key chart with whoever you are writing to. The chart on this page shows precisely the layout this tool uses.
A worked pigpen example
Take the word CAB. C is the top-right cell of the first grid, so it keeps the line on its left and the line below it — a corner that opens toward the top-right. A is the top-left cell, the mirror-image corner that opens toward the top-left. B is the top-middle cell, a U shape open at the top. Written out, CAB becomes three little corner-and-U symbols in a row, with no letters in sight.
Decoding reverses the process: take each symbol, find the cell or wedge whose surrounding lines match it, and read off the letter — remembering that a dot means you are in the second grid or the second X. Because the pigpen cipher is a plain one-to-one substitution, the same letter always produces the same symbol, so a careful look at repeated shapes already tells you a lot about a message, exactly as with any simple substitution cipher.
History: the Freemason and Rosicrucian cipher
The pigpen cipher is centuries old and is most famously linked to Freemasonry, which is why it is so often called the Masonic or Freemason's cipher. Freemasons used it in the 18th century to keep records and correspondence private, and gravestones in Masonic cemeteries sometimes carry inscriptions written in pigpen symbols. A closely related arrangement was used by the Rosicrucians, and the Union army is said to have used the cipher to send messages during the American Civil War.
Part of the reason it spread so widely is that it needs no equipment and almost no memorisation: once you can picture the two grids and two crosses, you can encode or decode by hand on any scrap of paper. That same simplicity is why it survives today not as a serious secret-keeping tool but as a teaching cipher, a staple of puzzle hunts, and a piece of cultural shorthand for ‘secret writing’ that turns up in games, books, and films.
How secure is the pigpen cipher?
By modern standards the pigpen cipher offers essentially no security. It is a monoalphabetic substitution with a fixed mapping and no key, so anyone who recognises the symbols — or simply guesses that the shapes stand for letters — can decode a message using frequency analysis or a published chart in minutes. Replacing letters with exotic-looking symbols changes how the message looks, not how hard it is to break.
That does not make it useless; it makes it the right tool for the right job. For puzzles, games, classroom lessons, treasure hunts, and capture-the-flag challenges, the pigpen cipher is ideal: memorable, hands-on, and satisfying to crack. For anything that genuinely needs to stay secret, use a modern, peer-reviewed algorithm such as AES instead. Keep pigpen for the fun of hiding words in plain, angular sight.
Frequently asked questions
What is the pigpen cipher?
Why is it called the pigpen cipher?
How do you encode a message in pigpen?
How do you decode a pigpen cipher?
What do the dots mean in the pigpen cipher?
Is the pigpen cipher the same as the Masonic cipher?
Are there different versions of the pigpen cipher?
Can I decode a pigpen message I drew on paper?
Does the pigpen cipher keep spaces and punctuation?
Can I download or share my pigpen message?
Is the pigpen cipher secure?
Is my text sent to a server?
Related tools
Keep going with these handy tools