All articles
cipherpigpenfreemasonsvisual

Pigpen Cipher: The Secret Writing of the Freemasons

The Pigpen cipher decoded — the geometric symbol substitution cipher used by Freemasons. Includes the full symbol table and free online encoder/decoder.

April 20, 20268 min readBy SolveCipher Team

The Pigpen cipher turns letters into geometric symbols derived from a grid — right angles, boxes, and dots that look like an alien writing system or ancient runes. It's one of the most visually striking substitution ciphers ever created, and its connection to Freemasonry gave it an air of genuine mystery that persists centuries later.

Also known as the Freemason's cipher, the masonic cipher, or the tic-tac-toe cipher, the Pigpen cipher is instantly recognizable and remarkably easy to use once you know the grid. It's a staple of escape rooms, puzzle books, and kids' cryptography activities.

The Freemason Connection

The Pigpen cipher has been associated with Freemasonry since at least the 18th century. Masonic lodges used it to encrypt records, ritual texts, and correspondence between members. Gravestone inscriptions in Pigpen have been found in Masonic burial grounds, and the cipher appears in various Masonic manuscripts from the 1700s onward.

Whether Freemasons invented the Pigpen cipher or simply adopted it is debated. Similar geometric substitution systems appear in other contexts, and the basic idea — mapping letters to grid positions — is straightforward enough to have been invented independently multiple times. But the Masonic association is what made the cipher famous and gave it its aura of secrecy.

How the Grid Works

The Pigpen cipher uses four shapes to organize all 26 letters of the alphabet:

Grid 1 (tic-tac-toe): A 3×3 grid containing letters A through I

 A | B | C
-----------
 D | E | F
-----------
 G | H | I

Grid 2 (tic-tac-toe with dots): The same grid pattern, with dots added, containing J through R

 J.| K.| L.
-----------
 M.| N.| O.
-----------
 P.| Q.| R.

X shape 1: An X containing S, T, U, V (one letter in each triangular section)

 \S/
T X U
 /V\

X shape 2 (with dots): The same X pattern with dots, containing W, X, Y, Z

 \W./
X. X Y.
 /Z.\

Each letter's symbol is the portion of the grid or X that surrounds it. The letter A sits in the top-left corner of Grid 1, so its symbol is an open right angle: . The letter E sits in the center of Grid 1, so its symbol is a complete box: . Letters in Grid 2 use the same shapes but with a dot inside.

The Full Symbol Table

| Letter | Shape Description | Letter | Shape Description | |--------|-------------------|--------|-------------------| | A | right angle, open right/bottom | J | same as A, with dot | | B | U-shape, open bottom | K | same as B, with dot | | C | right angle, open left/bottom | L | same as C, with dot | | D | bracket, open right | M | same as D, with dot | | E | box (four sides) | N | same as E, with dot | | F | bracket, open left | O | same as F, with dot | | G | right angle, open right/top | P | same as G, with dot | | H | U-shape, open top | Q | same as H, with dot | | I | right angle, open left/top | R | same as I, with dot | | S | V-shape, points up | W | same as S, with dot | | T | arrow, points right | X | same as T, with dot | | U | V-shape, points down | Y | same as U, with dot | | V | arrow, points left | Z | same as V, with dot |

The system is elegant: 9 shapes × 2 variants (with and without dot) = 18 symbols from the grids, plus 4 shapes × 2 variants = 8 symbols from the X shapes, totaling 26 — exactly one per letter.

Encoding Step-by-Step

Let's encode the word HELLO:

H = U-shape, open top (from Grid 1, middle bottom position)
E = box, four sides (from Grid 1, center position)
L = right angle, open left/bottom, with dot (from Grid 2)
L = right angle, open left/bottom, with dot (from Grid 2)
O = bracket, open left, with dot (from Grid 2)

You draw each symbol in sequence. The result looks like a series of geometric shapes — completely unrecognizable as English to anyone without the key grid.

Decoding Step-by-Step

To decode, examine each symbol and determine:

  1. What shape is it? A right angle, U-shape, box, bracket, V, or arrow?
  2. Does it have a dot? If yes, it's from Grid 2 or X-shape 2 (letters J–R or W–Z). If no, it's from Grid 1 or X-shape 1 (letters A–I or S–V).
  3. Where in the grid does that shape appear? Match the shape to its position and read the letter.

With practice, decoding becomes fast — you'll recognize common letters (E = box, T = right-pointing arrow) at a glance.

Variations

The Pigpen cipher has spawned several variants over the centuries:

Templar cipher: An alternative arrangement where the letters are placed in the grids in a different order, sometimes following the Maltese Cross pattern associated with the Knights Templar. The grid shapes are the same, but the letter assignments differ.

Rosicrucian cipher: Another reordering of letters within the same grid system, associated with the Rosicrucian Order. Some versions use a different dot convention or add embellishments to the symbols.

Reversed assignment: Some versions fill the grids bottom-to-top instead of top-to-bottom, or right-to-left instead of left-to-right. This changes which letter maps to which symbol while keeping the visual system identical.

Custom variants: Puzzle designers sometimes create their own grid arrangements specifically so that standard Pigpen decoders won't work. In escape rooms, always check whether the room provides its own grid reference — it might not match the standard layout.

Pop Culture Appearances

National Treasure (2004): The film features a Pigpen-like cipher as one of the clues leading to hidden treasure. While the movie takes liberties with the actual cryptography, it introduced the Pigpen cipher to millions of viewers.

The Da Vinci Code (2003): Dan Brown's novel references Masonic ciphers in its broader exploration of secret societies and hidden messages. The Pigpen cipher fits naturally into this world of hidden knowledge.

Gravity Falls: The Disney series includes Pigpen-style symbol substitutions among its many hidden ciphers.

Puzzle books and games: Pigpen is one of the most frequently used ciphers in puzzle design because it looks impressive, is easy to generate, and is satisfying to decode.

How to Write in Pigpen

The Pigpen cipher is one of the few ciphers that's genuinely fun to write by hand. Here's how to get started:

  1. Draw the two grids and two X shapes with letters filled in (this is your reference key)
  2. For each letter of your message, find it in the grid
  3. Draw only the lines/angles that surround that letter
  4. Add a dot if the letter is in Grid 2 or X-shape 2
  5. Write symbols with small gaps between them (representing letter boundaries)
  6. Use larger gaps for word boundaries

Tips for clean Pigpen writing: keep your symbols small and uniform, use a fine-point pen for the dots, and practice the most common shapes (E=box, T=arrow, A=corner) until they're automatic.

Decode Pigpen Online

Our free Pigpen cipher encoder/decoder converts text to Pigpen symbols and back. Type any message to see it rendered in the geometric Pigpen alphabet, or use the decoder to identify Pigpen symbols you've encountered in a puzzle.

For other visual ciphers, explore Braille and Morse code. For identifying any unknown cipher type, use our homepage tool.

Frequently Asked Questions

Is the Pigpen cipher secure?

Not at all. The Pigpen cipher is a simple substitution cipher with a fixed, publicly known key. Anyone who recognizes the geometric shapes can decode it, and even without recognizing it, frequency analysis breaks it quickly. The Freemasons used it for mild obscurity, not serious security.

How old is the Pigpen cipher?

The earliest documented Masonic use dates to the early 1700s. Similar geometric substitution systems may be older, but concrete dating is difficult. The cipher was well-established in Masonic practice by the mid-18th century.

Do modern Freemasons still use the Pigpen cipher?

The Pigpen cipher appears in Masonic education and ceremony as a historical artifact, but it's no longer used for actual secure communication. Modern Masonic lodges don't rely on classical ciphers for privacy.

Can I create my own Pigpen-style cipher?

Absolutely. Use any two grid shapes plus two additional shapes, arrange 26 letters however you like, and you have a custom visual cipher. This is a great project for creating your own cipher — it combines creativity with cryptographic principles.