The Pigpen Cipher

The pigpen cipher (alternatively referred to as the masonic cipher, Freemason’s cipher, Napoleon cipher, and tic-tac-toe cipher) is a geometric simple substitution cipher, which exchanges letters for symbols which are fragments of a grid.


The example key shows one way the letters can be assigned to the grid.

The use of symbols instead of letters is no impediment to cryptanalysis, and this system is identical to that of other simple monoalphabetic substitution schemes.

Due to the simplicity of the cipher, it is often included in children’s books on ciphers and secret writing.

Source: Wikipedia

Anomie – Own work, Public Domain
IMAGE LINKED:  wikimedia Attribution 4.0 International (CC BY 4.0)

The cipher has been used by both the Rosicrucians and Freemasons, the latter using it prolifically, hence the name ‘Masonic’ or ‘Freemason’s’ cipher (Hynson, 2006).

It was predominantly used in the 18th century to keep Masonic records and rituals private and for correspondence between lodges.

In his ‘Three Books of Occult Philosophy‘ (1531), Heinrich Cornelius Agrippa (1486-1535) described a Rosicrucian cipher, which he attributed to the Jewish Kabbalah tradition.

The system used the Hebrew alphabet, as opposed to Latin, and was used for religious rather than cryptological purposes.


Heinrich Cornelius Agrippa
IMAGE LINKED:  wikimedia Attribution 4.0 International (CC BY 4.0)

According to Helena Blavatsky (‘The Theosophical Glossary, 1892’), and S. L. MacGregor Mathers (The Kabbalah Unveiled), the cipher is said to have originated with the Hebrew rabbis.

Dave Thompson, in ‘Elliptic Curve Cryptography (2016), states ‘there is evidence that suggests that the Knights Templar utilized a pigpen cipher’.

W. Kirk McNulty echoes this in his book ‘Freemasonry: symbols, secrets, significance’ (2006).

George Washington‘s army had documentation about the system, with a much more randomized form of the alphabet.

And during the American Civil War, the system was used by Union prisoners in Confederate prisons

Using the pigpen cipher key shown in the example above, the message ‘X MARKS THE SPOT’ is rendered in ciphertext as:

The core elements of this system are the grid and dots. Some systems use the X’s, but even these can be rearranged.

One commonly used method orders the symbols as shown in the above image: grid, grid, X, X.

Another commonly used system orders the symbols as grid, X, grid, X.

Another is grid, grid, grid, with each cell having a letter of the alphabet, and the last one having an ‘&’ character.

Letters from the first grid have no dot, letters from the second each have one dot, and letters from the third each have two dots.

Another variation of this last one is called the Newark Cipher, which instead of dots uses one to three short lines which may be projecting in any length or orientation.

This gives the illusion of a larger number of different characters than actually exist [Pratt, 1942].

Another system, used by the Rosicrucians, used a single grid of nine cells, and 1 to 3 dots in each cell or ‘pen’.

So ABC would be in the top left pen, followed by DEF and GHI on the first line, then groups of JKL MNO PQR on the second, and STU VWX YZ on the third [Pratt, 1942).

When enciphered, the location of the dot in each symbol (left, centre, or right), would indicate which letter in that pen was represented. 

More difficult systems use a non-standard form of the alphabet, such as writing it backwards in the grid, up and down in the columns, or a completely randomized set of letters.

The Templar cipher is a method claimed to have been used by the Knights Templar. It uses a variant of a Maltese Cross.

Trevor W. McKeown writes about ‘Purported Templar Ciphers’ here.

Text and images source: Wikipedia

In the article ‘Memento Mori’ on page 6, we briefly referred to the ‘pigpen’ or ‘Masonic’ cipher in relation to its use on a gravestone in Norwich, England.

One other far more extravagant example of its use on a headstone, is that of the grave of Thomas Brierley.

Brierly (1785-1854/5) was a Freemason from Mellor, Greater Manchester.

He was a member of Lodge of Union (originally Lancashire Lodge of Union No. 50, warrented by UGLE), he was also a member of Moon Lodge of Benevolence, and several other degrees, including Rose Croix and Mark.

It would seem Thomas was a complicated chap and the story goes that during some periods of illness, he had recourse to the sick funds of the fraternity.

It was implied by a number of members that his illnesses coincided with a slack time at Strines Printworks where he worked.

Much aggrieved by these charges, Thomas had a stone coffin made by Azariah Ollerenshaw, a local stonemason.

It was said that he lay down so that the coffin could be accurately cut for his body and head for a perfect fit.

The coffin was then placed, fully exposed, on a previously purchased grave site at St Thomas’ Church, Mellor.

The lid was carved with some Masonic symbols and underneath the words ‘I am belied’, referring to the accusations of feigned illness.

It lay there for some years and became quite a tourist attraction until the vicar, Rev. Matthew Freeman, ordered it to be buried. Thomas then had a headstone made replete with the cipher(s) and Masonic-related symbols and had it placed over the grave.

Ultimately he was not buried in his ornate stone coffin because it was too heavy to move to the house where his body lay.

He was thus buried, on 26 July 1855, in a wooden coffin, which was presumably laid to rest beside the stone one.

The cipher on his headstone was a long-held mystery in various books and newspaper articles right into the latter part of the 20th century.

It appears that the headstone is actually written in five pigpen variations and the use of a non-standard symbol for the letter ‘S’ adds more intrigue.

The missing dates on his headstone was never completed after his death.

However, one later addition was that of a brass plaque with more cipher engraved on it – the cipher is similar but not identical.

The text at the head of the stone says: ‘Thomas Brierley made his ingress July 16th 1785, His Progress was ____ Years And his Egress___’.

The text at the foot of the stone reads ‘Holiness of the Lord’.

Square Challenge!

See how many Masonic-related symbols you can identify and whether you can decipher the remaining unexplained ‘cipher’ symbols – I’m sure we can offer a small prize to the winner!

Some text and image sources: Wikipedia, Thomas Brierley

Freemasonry: Symbols, Secrets, Significance 

By: W. Kirk MacNulty

“The Craft,” with an estimated four million Freemasons worldwide, remains the largest fraternal organization in the world. Written by an active Freemason, this book comprehensively explains Freemasonry through its fascinating visual culture, rich in mysterious and arcane symbols of life, death, and morality that have evolved over centuries of secrecy and that have profound philosophical meaning.

Ceremonial regalia, paintings, manuscripts, tracing boards, ritual swords, furniture, prints, ephemera, and architecture: the book is copiously illustrated with many specially researched items from Freemasonry archives. This unrivaled compendium will appeal both to Freemasons wishing to learn the full story of their order and to a general audience that is intensely curious about this traditionally secretive and closed movement.

The coverage includes 
• The historical and philosophical background of the order, including the Knights Templar, the medieval stonemasons’ guilds, and esoteric traditions such as Kabbalah and Hermeticism
• Its history from the earliest Masons to the present day, including famous members and scandals
• Its geographical spread from Japan to California, Sweden to South Africa
300 illustrations, 200 in color


Secret & Urgent: The Story of Codes & Ciphers

By: Fletcher Pratt

This is a reproduction, without changes, of a classic text in cryptographic literature. Fletcher Pratt has written an outstanding light- reading book concerning classical cryptography and cryptanalysis. The history of codes and ciphers is covered extensively.


Three Books of Occult Philosophy or Magic

By: Henry Cornelius Agrippa (Author), WILLIS F. WHITEHEAD (Editor) 

Three Books of Occult Philosophy (De Occulta Philosophia libri III) is Heinrich Cornelius Agrippa’s study of occult philosophy, acknowledged as a significant contribution to the Renaissance philosophical discussion concerning the powers of ritual magic, and its relationship with religion. The first book was printed in 1531 in Paris, Cologne, and Antwerp, while the full three volumes first appeared in Cologne in 1533.

The three books deal with Elemental, Celestial and Intellectual magic. The books outline the four elements, astrology, kabbalah, numbers, angels, God’s names, the virtues and relationships with each other as well as methods of utilizing these relationships and laws in medicine, scrying, alchemy, ceremonies, origins of what are from the Hebrew, Greek and Chaldean context.

These arguments were common amongst other hermetic philosophers at the time and before. In fact, Agrippa’s interpretation of magic is similar to the authors Marsilio Ficino, Pico della Mirandola and Johann Reuchlin’s synthesis of magic and religion, and emphasize an exploration of nature. Unlike many grimoires of the time, these books are more scholarly and intellectual than mysterious and foreboding. These books are often read as authoritative by those interested in the occult even today.


The Cipher Diary

By: B. Ann Angel

Write in your diary in pigpen Cipher an ancient and easy-to-learn cipher method. It was designed to communicate in secrecy. The first several pages come with a cipher key.


Recent Articles:

April 2021

Ashlars – Rough, Smooth – Story of a Stone

How we can apply the rough and smooth Ashlars with-in a masonic context  …read more

December 2020

Meaning of the Acacia

What is the meaning of the Acacia and where did it originate ?  …read more

May 2020

The North East Corner

Extracted from William Harvey – the Complete Works  …read more

masonic knowledge

making good men better

share the square with two brothers

click image to open email app on mobile device

Masonic Apparel

made to order

Share this article ....