OlyPrep

§ TOOLS / CIPHER LAB / PIG PEN

Pig Pen cipher

The pigpen cipher swaps each letter for the shape of the space it sits in on a pair of grids and a pair of X shapes. It is one of the first symbol ciphers most children meet, and it turns up on elementary Science Olympiad Codebusters papers, where the student usually has to draw the grids from memory before decoding a word.

Free on every planNo sign-in to tryThe lab below runs this cipher only

§ THE CIPHER

What the pigpen cipher is

A pigpen cipher is a substitution cipher that uses shapes instead of letters. The twenty-six letters are written into four frames: a tic-tac-toe grid holding A to I, a second tic-tac-toe grid holding J to R with a dot in every space, an X shape holding S, T, U and V, and a second X holding W, X, Y and Z, again with dots. A letter is written as the lines that surround its space in its frame, plus the dot if its frame has one. The letter E, in the centre of the first grid, becomes a closed box; A, in the top-left corner, becomes a right edge and a bottom edge; S, at the top of the first X, becomes a V shape.

The cipher is commonly called the Masonic cipher or the Freemason’s cipher, because it is usually traced to eighteenth-century Freemasons, who are said to have used it to keep lodge records private. The name “pigpen” comes from the way the letters look penned into the little enclosures of the grid. Versions of it appear in puzzle books, in scout and camp activities and in children’s fiction, which is why many kids arrive at Codebusters already half knowing it.

Because every symbol is just a picture of a position, there is nothing to work out once the frames are drawn correctly. The whole skill is drawing the four frames accurately, keeping the dotted and undotted frames straight, and reading the shapes carefully. Common mistakes are putting the letters into the grids in the wrong order (the rows go left to right, top to bottom), forgetting which frame carries the dots, and confusing the X letters with the corners of the grids: the corner A is two straight lines meeting at a right angle, while the X letters are open V shapes pointing up, left, right or down.

§ THE METHOD

How to solve a Pig Pen cipher

Four frames: two tic-tac-toe grids and two X shapes. The second grid and the second X have a dot in every space. Each letter is written as the lines around its space, plus the dot if its frame has one.

  1. STEP 1: Draw a tic-tac-toe grid and fill in A to I, row by row.
  2. STEP 2: Draw a second grid and fill in J to R the same way. Put a dot in every space.
  3. STEP 3: Draw an X. Put S at the top, T on the left, U on the right and V at the bottom.
  4. STEP 4: Draw a second X for W (top), X (left), Y (right) and Z (bottom), with a dot in each space.
  5. STEP 5: Decode: match each symbol's lines (and its dot) to a space in your frames. A gap between symbols starts a new word.
§ WORKED EXAMPLE

A worked example

Worked example

  A | B | C       J• | K• | L•
  D | E | F       M• | N• | O•
  G | H | I       P• | Q• | R•

  X: S top · T left · U right · V bottom
  Dotted X: W top · X left · Y right · Z bottom

E sits in the middle space, so its symbol is a full box: □.
S sits in the top of the X, so its symbol is a V.
3×3 GRID (A-I, no dots)
ABC
DEF
GHI
3×3 GRID (J-R, a dot in every space)
JKL
MNO
PQR
X SHAPES (S-V, then W-Z with dots)
First X: S top · T left · U right · V bottom.
Second X, a dot in every space: W top · X left · Y right · Z bottom.

Each symbol is the lines AROUND the letter’s space: A (top left) is a right edge and a bottom edge; E (the middle) is a full box; S (the top of the X) is a V. A dot marks the second grid and the second X (J-R, W-Z).

§ ON THE TEST

Pig Pen in Codebusters

In Science Olympiad Codebusters the pigpen cipher is an elementary-level question. The rule sets OlyPrep has read that include it usually provide no table on the day, so the student is expected to build the frames from memory on scratch paper, then decode a short message. Answers are typically scored by the letters of the decoded message, which means one wrong frame can cost several letters at once; a kid who learns the layout cold tends to solve the whole question in a minute or two.

The most reliable routine is the one on the card above: draw all four frames first, every time, before reading a single symbol. Then decode the symbols in order, writing each letter underneath. Symbols printed close together belong to one word; a visible gap between symbols is a word break. If a decoded word looks wrong, the usual cause is a mix-up between the dotted and undotted frames, so check the dots before anything else.

Different tournaments draw the frames slightly differently. The version in the lab and on the card is the one most commonly used, with the dots marking the second grid and the second X. If a tournament’s own rules show the letters in another arrangement, follow that rulebook; the method of decoding is the same either way.

§ PRACTICE

Practice the Pig Pen cipher

The lab below is set to the Pig Pen cipher alone. Pick a difficulty, generate a challenge, decode it, then check your answer or reveal the solution. It runs in your browser, needs no account, and is unlimited on every OlyPrep plan.

Scoped to Pig Pen · 1 cipher type. Generate a challenge, solve it, and we'll track what you've cracked.

Grid and X-shape symbols
§ PAST CHALLENGES

Your first decode is the hardest.

Pick a cipher above and give it a shot — we'll keep track of what you've solved.

§ WHERE IT IS TESTED

Where the Pig Pen cipher is tested

The Science Olympiad rule sets OlyPrep has read that name this cipher:

Cipher lists change with each season’s rules; a tournament’s own rulebook is the authority on what it tests.

§ ABOUT THE PIG PEN CIPHER

Questions about the Pig Pen cipher.

Q·01Is the pigpen cipher the same as the Masonic cipher?
Yes. Pigpen, Masonic and Freemason’s cipher are three names for the same system of grids and X shapes. The name “pigpen” describes the letters penned into the grid’s spaces; the other two names come from the Freemasons, who are commonly credited with using it.
Q·02Do I get the pigpen grid on a Codebusters test?
Usually not. The elementary rule sets OlyPrep has read expect the student to draw the grids and the X shapes from memory on scratch paper, which is why the practice here starts with building the frames rather than looking them up.
Q·03How does the OlyPrep lab check a pigpen answer?
The lab shows the symbols, you type the decoded words, and it compares your letters against the message it encoded, ignoring spaces and punctuation. Check tells you whether they match; Reveal shows the solution and puts each letter under its symbol.
Q·04Is OlyPrep part of Science Olympiad?
No. OlyPrep is independent and is not affiliated with Science Olympiad, Inc. or any state or regional Science Olympiad organization. This page describes the cipher and offers practice for it; the rules of any tournament are set by that tournament’s organizers.