Xerobit

Pigpen Cipher Encoder: Convert Text to Geometric Glyphs

The pigpen cipher replaces each letter of the alphabet with a geometric symbol derived from grid lines and dots. Enter your message below to generate the encoded glyphs as an SVG image. The encoding runs entirely in your browser, so nothing is uploaded to any server.

Only letters A-Z are encoded. Spaces become gaps; digits and punctuation are skipped.

Encoded Glyphs

  • Letters encoded
    5
  • H
    Grid 1, bottom-middle cell: top, left and right, no dot
  • E
    Grid 1, centre cell: all four, no dot
  • L
    Grid 2 (dotted), top-right cell: left and bottom, with a dot
  • O
    Grid 2 (dotted), middle-right cell: top, left and bottom, with a dot
LetterGridPositionLines drawn
AGrid 1top-left cellright and bottom, no dot
BGrid 1top-middle cellleft, right and bottom, no dot
CGrid 1top-right cellleft and bottom, no dot
DGrid 1middle-left celltop, right and bottom, no dot
EGrid 1centre cellall four, no dot
FGrid 1middle-right celltop, left and bottom, no dot
GGrid 1bottom-left celltop and right, no dot
HGrid 1bottom-middle celltop, left and right, no dot
IGrid 1bottom-right celltop and left, no dot
JGrid 2 (dotted)top-left cellright and bottom, with a dot
KGrid 2 (dotted)top-middle cellleft, right and bottom, with a dot
LGrid 2 (dotted)top-right cellleft and bottom, with a dot
MGrid 2 (dotted)middle-left celltop, right and bottom, with a dot
NGrid 2 (dotted)centre cellall four, with a dot
OGrid 2 (dotted)middle-right celltop, left and bottom, with a dot
PGrid 2 (dotted)bottom-left celltop and right, with a dot
QGrid 2 (dotted)bottom-middle celltop, left and right, with a dot
RGrid 2 (dotted)bottom-right celltop and left, with a dot
SX 1top wedgeV shape, no dot
TX 1left wedge> shape, no dot
UX 1right wedge< shape, no dot
VX 1bottom wedge^ shape, no dot
WX 2 (dotted)top wedgeV shape, with a dot
XX 2 (dotted)left wedge> shape, with a dot
YX 2 (dotted)right wedge< shape, with a dot
ZX 2 (dotted)bottom wedge^ shape, with a dot

Only letters A to Z are encoded. Spaces become gaps; digits and punctuation are skipped.

How to use the pigpen cipher

  1. Type or paste your plaintext message into the Text to encode field.
  2. Choose a White or Transparent background for the output image.
  3. Click Generate to draw the pigpen cipher glyphs as an SVG.
  4. Review the letter mapping table below the image to verify each symbol.
  5. Save or copy the SVG to share your encoded message.

How the Pigpen Cipher Works

The pigpen cipher, also called the freemason cipher or masonic cipher, is a geometric substitution system. Instead of swapping one letter for another like the caesar cipher translator does, it replaces each letter with a fragment of a grid.

There is no single official key. This tool uses the common Freemason convention, in which the alphabet is split across four shapes:

  • A tic-tac-toe grid holds A through I, reading left to right, top to bottom. The glyph is the walls of the cell that contains the letter, so A is drawn as the right and bottom walls of the top-left cell and I as the top and left walls of the bottom-right cell.
  • A second tic-tac-toe grid with a dot in every cell holds J through R.
  • An X shape holds S through V in its four wedges: S top, T left, U right, V bottom.
  • A second X shape with dots holds W through Z in the same order.

Variants exist, and some sources place the wedges of the X in a different order, so a message written with another key may not decode with this table. The layout here is the widely used one, but it is a convention rather than a documented standard.

To encode the word "HELLO": H is the bottom-middle cell of the first grid, drawn as its top, left and right walls; E is the centre cell, a full square; L is the top-right cell of the dotted grid, drawn as its left and bottom walls plus a dot; and O is the middle-right cell of the dotted grid, drawn as its top, left and bottom walls plus a dot.

Letter Mapping Reference

Use this table to read or write pigpen cipher symbols by hand. Each letter maps to one cell of a grid or one wedge of an X. The full 26-letter table is also shown under the generated image.

GridLettersShape description
Tic-tac-toe (no dot)A B C / D E F / G H IThe walls of each cell, such as right and bottom for A
Tic-tac-toe (with dot)J K L / M N O / P Q RSame walls plus a dot in the cell
X shape (no dot)S (top), T (left), U (right), V (bottom)V, >, < and ^ shaped wedges of the X
X shape (with dot)W (top), X (left), Y (right), Z (bottom)Same wedges plus a dot inside the wedge

Because the shapes are purely visual, someone looking for a keyword shift like those used in the vigenere cipher will find no alphabetical pattern here.

Historical Use of the Masonic Cipher

The cipher is commonly associated with Freemasonry, and similar grid-based symbol alphabets are reported in records from the eighteenth century, but the details of who used which key and when are not well documented, so treat any precise history with caution. The geometric symbols look like simple doodles rather than writing, which is the appeal.

It is also reported to have been used by Union prisoners during the American Civil War. Unlike mathematical ciphers such as the affine cipher, the pigpen system requires no arithmetic, making it accessible to anyone who memorizes four grids.

Today it appears in puzzles, geocaching clues, escape rooms, and educational materials about cryptography basics.

Decoding Pigpen Messages

This tool encodes plaintext into SVG glyphs. To decode a pigpen cipher message, you reverse the process: look at each drawn shape, identify which of the four grids it belongs to, determine whether a dot is present, and find the letter occupying that cell or wedge.

For automated decoding of other substitution systems, you might explore a general cipher decoder. However, because pigpen symbols are images rather than characters, optical recognition or manual lookup against the reference table above is required.

Spaces between words are typically preserved as gaps between glyphs. Numbers and punctuation have no standard pigpen representation, so they are usually written out or omitted.

Common Mistakes and Edge Cases

When drawing the pigpen cipher by hand, several errors frequently occur:

  • Mirroring shapes: The open side of a corner must face the correct direction. A corner for the top-left cell (A) is not the same as the corner for the bottom-right cell (I).
  • Forgetting dots: Without the dot, J through R collapse back into A through I, changing the entire message.
  • Confusing X wedges: The four triangles in the X grid must be assigned consistently. Top is S (or W), left is T (or X), right is U (or Y), bottom is V (or Z).
  • Non-alphabetic characters: Only A through Z have defined glyphs. Numbers, spaces, and punctuation need separate handling or omission.

This encoder normalizes input to uppercase, turns spaces into gaps and skips other unsupported characters, so only valid glyphs are produced.

Worked examples

ExampleInputResult
HelloText to encode: HELLO; Background: whiteLetters encoded: 5; H: Grid 1, bottom-middle cell: top, left and right, no dot; E: Grid 1, centre cell: all four, no dot; L: Grid 2 (dotted), top-right cell: left and bottom, with a dot; O: Grid 2 (dotted), middle-right cell: top, left and bottom, with a dot
FreemasonText to encode: FREEMASON; Background: whiteLetters encoded: 9; F: Grid 1, middle-right cell: top, left and bottom, no dot; R: Grid 2 (dotted), bottom-right cell: top and left, with a dot; E: Grid 1, centre cell: all four, no dot; M: Grid 2 (dotted), middle-left cell: top, right and bottom, with a dot; A: Grid 1, top-left cell: right and bottom, no dot; S: X 1, top wedge: V shape, no dot; O: Grid 2 (dotted), middle-right cell: top, left and bottom, with a dot; N: Grid 2 (dotted), centre cell: all four, with a dot
Secret messageText to encode: SECRET; Background: transparentLetters encoded: 6; S: X 1, top wedge: V shape, no dot; E: Grid 1, centre cell: all four, no dot; C: Grid 1, top-right cell: left and bottom, no dot; R: Grid 2 (dotted), bottom-right cell: top and left, with a dot; T: X 1, left wedge: > shape, no dot
Full alphabetText to encode: ABCDEFGHIJKLMNOPQRSTUVWXYZ; Background: whiteLetters encoded: 26; A: Grid 1, top-left cell: right and bottom, no dot; B: Grid 1, top-middle cell: left, right and bottom, no dot; C: Grid 1, top-right cell: left and bottom, no dot; D: Grid 1, middle-left cell: top, right and bottom, no dot; E: Grid 1, centre cell: all four, no dot; F: Grid 1, middle-right cell: top, left and bottom, no dot; G: Grid 1, bottom-left cell: top and right, no dot; H: Grid 1, bottom-middle cell: top, left and right, no dot; I: Grid 1, bottom-right cell: top and left, no dot; J: Grid 2 (dotted), top-left cell: right and bottom, with a dot; K: Grid 2 (dotted), top-middle cell: left, right and bottom, with a dot; L: Grid 2 (dotted), top-right cell: left and bottom, with a dot; M: Grid 2 (dotted), middle-left cell: top, right and bottom, with a dot; N: Grid 2 (dotted), centre cell: all four, with a dot; O: Grid 2 (dotted), middle-right cell: top, left and bottom, with a dot; P: Grid 2 (dotted), bottom-left cell: top and right, with a dot; Q: Grid 2 (dotted), bottom-middle cell: top, left and right, with a dot; R: Grid 2 (dotted), bottom-right cell: top and left, with a dot; S: X 1, top wedge: V shape, no dot; T: X 1, left wedge: > shape, no dot; U: X 1, right wedge: < shape, no dot; V: X 1, bottom wedge: ^ shape, no dot; W: X 2 (dotted), top wedge: V shape, with a dot; X: X 2 (dotted), left wedge: > shape, with a dot; Y: X 2 (dotted), right wedge: < shape, with a dot; Z: X 2 (dotted), bottom wedge: ^ shape, with a dot

FAQ

What is the pigpen cipher?

The pigpen cipher is a geometric substitution system where each letter of the alphabet is replaced by a symbol made from grid lines and optional dots. It is also known as the freemason cipher or masonic cipher. This tool follows the common Freemason key, one of several variants.

Can this tool decode pigpen cipher messages?

No, this tool only encodes text into SVG glyphs. Decoding requires visually matching each drawn symbol back to the letter mapping table provided on this page.

Is the pigpen cipher secure?

No. It is a simple monoalphabetic substitution, just drawn differently. Anyone familiar with the four grids can read it instantly. For real security, modern algorithms or at least keyed ciphers like the playfair cipher are needed.

Why is it called the freemason cipher?

It is associated with Freemasonry, which is said to have used similar grid-based symbols to keep private records from outsiders, hence the names freemason cipher and masonic cipher. The exact history is not well documented.

Do numbers have pigpen symbols?

The standard pigpen cipher only defines symbols for the 26 letters of the Latin alphabet. Numbers are typically spelled out as words or written in plain digits alongside the glyphs.

Does my text leave my computer when I use this tool?

No. The encoding logic and SVG generation run entirely in your browser. Nothing is sent to any server.