Cipher LabDocket One
Cipher Lab

Pigpen Cipher

Visual geometric cipher used by Freemasons.

📜 The Origins

A geometric substitution cipher that swaps letters for fragments of a grid. Historically used by the Freemasons in the 18th century to keep their records private.

🚀 Master the Tool

Type your message to see it drawn in geometric symbols. Each shape represents a specific letter's position in a tic-tac-toe or X-grid.

The calculator
Message Encoder

🐷 Geometric Cipher

Used by Freemasons in the 18th century to keep records private. Also known as the Masonic Cipher. It replaces letters with fragments of a grid.

Pigpen Visuals
Symbols will appear here...

The Freemasons' Secret Alphabet

The Pigpen cipher is one of the most recognisable secret writing systems ever invented, and yet most people have seen it without knowing its name. If you have ever spotted a row of little boxes, corners, and dotted shapes scratched into an old gravestone or scrawled in the margin of a puzzle book, you have met it. Formally it is a monoalphabetic substitution cipher, which is a long way of saying it swaps each letter of the alphabet for a fixed symbol. What makes it special is that the symbols are not random squiggles. They are fragments of a grid, and once you understand the grid, you can read and write the whole alphabet from memory. The tool above takes whatever you type and draws it back to you in these geometric shapes.

The cipher is most famously tied to the Freemasons, who used it in the 18th century to keep lodge records and correspondence private as documents passed between chapters. For this reason it is also called the Freemason's cipher or the Rosicrucian cipher. Some accounts trace its roots back further, to medieval monastic and even Knights Templar traditions of grid-based writing, though the clean version we use today is firmly a product of Masonic record-keeping. It was never meant to defeat a determined codebreaker. It was meant to stop a casual snoop, a curious servant, or an illiterate passer-by from reading something they had no business reading.

How the Grid and Dots Work

The whole system rests on four templates that hold the 26 letters between them. Picture two tic-tac-toe grids and two large X shapes: - Grid one, a plain tic-tac-toe, holds the letters A through I, one letter per compartment. - Grid two, the same tic-tac-toe but with a dot in each compartment, holds J through R. - The first X shape holds S, T, U, and V in its four triangular wedges. - The second X shape, with a dot in each wedge, holds W, X, Y, and Z.

To encode a letter, you do not draw the whole grid. You draw only the lines that surround that letter's compartment. The letter E, sitting in the dead centre of the first tic-tac-toe grid, is boxed on all four sides, so its symbol is a complete square. The letter A, tucked in the top-left corner, only has lines on its right and bottom, so its symbol is an open corner shape that looks a little like an upside-down L. The dotted grids produce the exact same shapes as their plain counterparts, with one difference: you add a single dot inside. That dot is the entire trick for telling A from J, B from K, and so on. As the tool's own tip notes, the dot simply signals the second letter living in the same grid position.

This is why the finished writing looks like an alien language. Every character is built from straight lines, right angles, and the occasional dot, with no curves anywhere.

A Worked Example: Encoding HELLO

Walking through a single word makes the logic click. Take the message HELLO and find each letter in the first tic-tac-toe grid, reading left to right, top to bottom, as A, B, C, then D, E, F, then G, H, I. - H sits in the bottom-centre compartment. It has a line above it and a line on each side, but nothing below, so its symbol is a shape open at the bottom, like a squared-off letter U turned upside down. - E is the centre square, enclosed on all four sides, drawn as a complete box. - L lives in the dotted second grid. Counting J, K, L across the top row, L is the top-right compartment, so it is an open corner shape, and because it is in the dotted grid you place a dot inside it. - The second L is identical to the first, dot and all. - O is also in the dotted grid, sitting in the centre, so it is a full box with a dot in the middle.

Read in order, HELLO becomes: an open-bottom shape, a plain box, two dotted corners, and a dotted box. Decoding simply reverses the process. You match each drawn shape back to its compartment, check for a dot, and read off the letter.

Why It Is Weak and Why That Is Fine

Here is the honest truth about Pigpen: as security, it is almost worthless against anyone who tries. Because every E is always the same box and every T is always the same wedge, the cipher preserves all the statistical fingerprints of ordinary English. A codebreaker does not even need to know the grid. They can count which symbol appears most often, guess it is E, look for a common three-symbol word and guess the, and unravel the rest by frequency analysis in minutes. It is exactly as fragile as the Caesar cipher, just wearing a more dramatic costume.

There is a famous, slightly grisly footnote to its history. Legend holds that the pirate Olivier Levasseur, nicknamed La Buse, flung a necklace bearing a Pigpen cryptogram into the crowd at his 1730 execution and cried out for someone to find his treasure. Treasure hunters have chased that supposed message ever since, which tells you everything about the cipher's romantic reputation and nothing about its strength.

Modern Uses: Puzzles, Geocaching, and Teaching

Stripped of any real cryptographic duty, Pigpen has found a happy second life as a tool for fun and learning: - Escape rooms and treasure hunts lean on it constantly, because it looks impenetrable but can be solved by a team in minutes once they find the key. - Geocaching uses it to hide coordinates and clues in plain sight on logs and laminated cards. - Classroom cryptography loves it, because it introduces the core idea of substitution without any maths, and children memorise the grid almost instantly. - Puzzle books and tattoo design use it for its purely visual appeal, since the angular symbols simply look striking.

You can even bend the rules to make it your own. Because the cipher is just a mapping from letters to compartments, you and a friend can scramble which letter goes in which slot, creating a private key that the standard grid cannot crack. It will never be truly secure, but for passing notes, building a puzzle, or teaching someone their first real cipher, the Freemasons' old grid is hard to beat.

Pro tips
01The dots indicate the second letter in the same grid segment.
02Classic for 'treasure hunt' notes.
03Looks like an alien language to the untrained eye!

The Fine Print (FAQ)

Is it secure?
No. Like Caesar Cipher, it is a simple substitution. The symbols change, but the patterns (double letters, common words) remain.
Did pirates use it?
Legend says the pirate Olivier Levasseur ('La Buse') threw a necklace with a Pigpen cryptogram into the crowd at his execution, shouting 'Find my treasure, he who receives it!'
Can I customize it?
Yes! You can scramble the order of letters in the grid to create your own key that only your friends know.