StringMash.com

Pigpen cipher

Each letter becomes the walls of the box it sits in. The Freemasons' cipher, drawn.

Conversion

Pigpen comes out as a drawing, and there is no way to type the symbols back in. Read one off the chart below.

19 characters
Pigpen cipherUpdates as you type
Download as SVG

Using the pigpen tool

Type on the left and the symbols are drawn on the right as you type. There's no text box on that side, because pigpen has no letters to put in one. Download saves what you see as an SVG, so it stays sharp at any size.

Second and fourth grids switches the dots off. That turns J to R into copies of A to I, which is worth doing once to see what the dot is carrying.

This page only goes one way. You can't type a pigpen symbol, so there's nothing to paste in and the swap button is off. To read a symbol you already have, use the chart below.

Why this one is a drawing

Every other converter here produces characters. Morse has dots and dashes, runes have a Unicode block, and even upside-down text borrows real letters from other alphabets.

Pigpen has none of that. Unicode never allocated its 26 symbols, so there's no code point to produce and no font that could draw one. A font built in the Private Use Area would show up here and as empty boxes everywhere else, so the result would be useless the moment you pasted it.

Drawing it is the honest answer. The output is an SVG built from a fixed table of line coordinates, so it renders the same in any browser and scales without blurring.

Reading the grids

The alphabet is laid out across four grids. Two are noughts-and-crosses boards and two are an X, and the second of each pair carries a dot.

A letter's symbol is the walls of the cell it sits in, and the outside of the board isn't drawn. A corner cell gives you two lines, an edge cell three, and the middle cell all four. That's the whole rule.

Charts disagree with each other, and it matters. Some sources fill the dotted grid second and the X third, some swap them, and some run the X clockwise from the top while others go anticlockwise. A message written from one chart won't read against another. This page uses the commonest arrangement, which is the one in the chart below.

A-Z

All 26 symbols

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

Gravestones and prison letters

Freemasons used it from at least the 18th century to keep lodge records private, which is where the name Freemason's cipher comes from. It also turns up cut into Masonic gravestones, where the point was ornament and membership rather than secrecy.

It had one serious outing. Union prisoners held in Confederate camps during the American Civil War used it to write home, because a guard glancing at a letter saw shapes rather than words.

That's about as much as it can bear. Pigpen is a monoalphabetic substitution, which means one symbol always stands for one letter, and it falls to a frequency count exactly as fast as Atbash or a Caesar shift. The symbols look cryptic and add nothing. Anyone who recognises the grid reads it immediately, and anyone who doesn't can work it out from a page of it.

Related conversions

Bacon's cipher had the same instinct three centuries earlier, hiding a message in something that doesn't look like writing. It hides better, because the cover text reads as ordinary prose.

Tap code is the other cipher here built on a grid, and it solves the same problem for sound rather than sight.

Questions

What is the pigpen cipher?

A substitution cipher that replaces each letter with the walls of the grid cell it occupies. It's also called the Freemason's cipher, the Masonic cipher and the tic-tac-toe cipher.

How do I decode a pigpen message?

Match each symbol against the chart above. There's no way to type the symbols in, so this page draws them rather than reading them.

Why do pigpen charts disagree?

There's no standard. Sources differ over which grid gets the dots and which way round the X runs, so a message written from one chart may not read against another.

Is the pigpen cipher secure?

No. One symbol always means one letter, so a frequency count breaks it as easily as any other simple substitution. The unusual shapes add nothing.

Can I download the symbols as an image?

Yes. Download saves the drawing as an SVG, which stays sharp at any size and can be opened in any vector editor.