Skip to content

Pigpen Cipher

Type a message to see it written in pigpen — the grid-and-dot alphabet also called the Freemason's cipher — and download it as an SVG or a PNG. To read a pigpen message, select its symbols on a keyboard laid out like the key, and the letters appear as you go.

What do you want to do?

Your message in pigpen

13 symbols

The pigpen key

ABCDEFGHIJKLMNOPQRSTUVWXYZ

A letter's symbol is the shape of the lines around it in the key. The second grid and the second X add a dot.

  • 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

How to Use the Pigpen Cipher

  1. 1. Write or read. Write text in pigpen turns letters into symbols; Read pigpen symbols gives you a symbol keyboard for decoding.
  2. 2. Type your message. Letters become symbols and spaces stay as gaps. Accented letters are written as their base letter; digits and punctuation have no pigpen symbol, and the tool lists any it left out.
  3. 3. Choose the line length, then download the result: an SVG for print, which stays sharp at any size, or a PNG for slides, worksheets and messages.
  4. 4. To decode, select the symbols in the order they are written. Each button shows its symbol over the letter it stands for, and Space and Delete last keep the text tidy.

How the Pigpen Key Works

Pigpen is a substitution cipher that writes each letter as the shape of the lines around it in a key. The usual modern key draws two noughts-and-crosses grids and two X shapes: A to I go in the first grid, J to R in the second with a dot in every cell, S to V in the first X, and W to Z in the second X, again with dots.

The standard pigpen key

 A | B | C      J·| K·| L·        S           W·
---+---+---    ---+---+---     T ╳ U      X· ╳ Y·
 D | E | F      M·| N·| O·        V           Z·
---+---+---    ---+---+---
 G | H | I      P·| Q·| R·

A letter's symbol is the outline of its cell. A sits in the top-left corner of the first grid, closed off by a line on its right and a line below, so its symbol is the corner ⌟. E, in the middle, is boxed in on all four sides, and N is that same box with a dot. In the Xs, S at the top sits in a V, T on the left in a >, U on the right in a <, and V at the bottom in a Λ; W, X, Y and Z are the same four wedges with a dot.

In the tool's sample, X marks the spot, the X is the > wedge with a dot, M is ⊐ with a dot, A is ⌟, R is ⌜ with a dot, K is ⊔ with a dot and S is the open V. The key is the whole secret: anyone who knows it reads the message as easily as you wrote it.

History of the Pigpen Cipher

Grid ciphers of this kind go back at least to the 17th century, when Rosicrucians used a single nine-cell grid with one to three dots in each cell. The pigpen is best known, though, from the Freemasons, who used it from the early 18th century to keep their records and correspondence private — hence its other names, the Freemason's or masonic cipher. It turns up on Masonic gravestones: the 1794 headstone of James Leeson in Trinity Churchyard, New York, carries a line in a pigpen variant that reads REMEMBER DEATH. Union soldiers held in Confederate prisons used the system during the American Civil War, and today it is a favourite of puzzle books, escape rooms and children's books on secret writing.

The arrangement of letters has never been fixed. Besides the grid, grid, X, X layout this tool uses, some keys alternate grid, X, grid, X, some use three grids with up to three dots, and some scramble the alphabet inside the grids — which is why a pigpen message from an old source may need its own key.

Is the Pigpen Cipher Secure?

Not at all. Pigpen is a simple substitution that uses symbols instead of letters, so the frequency analysis that breaks any substitution breaks it too: count the symbols, match the commonest to E and T, and try short words. Worse, the standard key is so widely known that a reader may not need to break it at all — just recognise it. Scrambling the letters in the grids slows a solver down only as much as a random substitution key would. It is a cipher for puzzles, classrooms and games, not for secrets.

Frequently Asked Questions

What is the pigpen cipher?
A simple substitution cipher that replaces each letter with a symbol made of lines and, for half the alphabet, a dot. The symbols come from a key of two grids and two X shapes: each letter is drawn as the outline of the cell it sits in. It is also called the Freemason's, masonic or Rosicrucian cipher.
How do you decode a pigpen cipher?
Match each symbol to the cell in the key that has the same outline. Square-cornered shapes come from the grids and V-shaped wedges from the Xs; a dot means the second grid or the second X. With this tool, select the matching symbol buttons in order and the letters build up below. If the result is gibberish, the message may use a different key — try frequency analysis.
Why is it called the pigpen cipher?
The name is usually explained by the key: each letter sits in its own enclosure of the grid, like an animal in a pen. Its other names come from its users — the Freemasons, who used it widely from the early 18th century, and before them the Rosicrucians.
Is the pigpen cipher the same as the Freemason's cipher?
Yes — Freemason's cipher and masonic cipher are other names for the same system. Masonic sources and later puzzle books do not all arrange the letters the same way, so check which key a message was written with. This tool uses the common modern layout: A–I and J–R in two grids, S–V and W–Z in two Xs.
Can I print or share a pigpen message?
Yes. Download the message as an SVG for print — it is a vector drawing, so it stays sharp at any size — or as a PNG to drop into a slide, a worksheet or a chat. Both are drawn in black on white.
Can you write numbers or punctuation in pigpen?
The standard key covers only the 26 letters, so the tool leaves digits and punctuation out and tells you which ones. To include a number, spell it out in words before converting.

Related Tools

More in Codes & Ciphers

See all Codes & Ciphers