Secret Codes for Kids: How to Teach the Caesar Cipher and Pigpen Cipher

A girl and her younger brother in toy sunglasses decode a message with a paper decoder wheel at the kitchen table
Photo created with AI.

Kids love a message they aren’t supposed to read. Secret codes turn that curiosity into real practice with letters, spelling, and careful checking. Here’s how to teach two classic codes, the Caesar cipher and the pigpen cipher, plus an easy number code for younger kids.

At a glance

  • Grades: K–5 (start with the number code)
  • You need: a pencil, paper, and a printed key
  • Skills: alphabet order, spelling, careful checking
  • Try it now: every code below has a practice message with the answer

Why Codes Work in Class and at Home

To decode a message, a child matches each symbol to a letter, one at a time, and then checks that the letters make a word. That takes attention to detail and a good feel for the alphabet. Spelling gets a workout, too, because a misspelled word in a code message stands out right away.

Illustration of two kid secret agents with a decoder wheel and a coded message
A decoder wheel and a coded note: everything a young agent needs.

Writing a code is even better practice. Kids have to plan the message, encode each letter, and make sure a friend can read it back. When the friend can’t, they find the mistake together.

Codes also need almost nothing: a pencil, paper, and a key. They work for a whole class, a small group, or one kid at the kitchen table. They also make great puzzles inside a classroom escape room.

Start With a Number Code (Grades K–2)

The easiest code gives every letter a number: A = 1, B = 2, C = 3, and so on up to Z = 26. Print the key below, and kids can decode on their own.

Number code key: A = 1, B = 2, and so on to Z = 26
The number code key. Keep it in front of every child.

Try it: Decode this word.

3-1-20

Show the answer

CAT. 3 is C, 1 is A, and 20 is T.

One more: This one is a pet, too.

4-15-7

Show the answer

DOG. 4 is D, 15 is O, and 7 is G.

  • For kindergarten and 1st grade, use three-letter words and read the directions aloud.
  • Solve the first word together on the board.
  • For 2nd grade, send short sentences and let kids write a reply in code.

The Caesar Cipher

How It Works

In a Caesar cipher, every letter moves forward the same number of places in the alphabet. With a shift of 3, A becomes D, B becomes E, and C becomes F. At the end of the alphabet, the letters wrap around to the start: X becomes A, Y becomes B, and Z becomes C.

Caesar cipher with a shift of 3: each plain letter above its code letter, with X, Y, and Z wrapping around to A, B, and C
A shift of 3. The coral letters show the wrap-around at the end of the alphabet.

The code is named after Julius Caesar. The Roman historian Suetonius wrote that Caesar used a shift of three in his private letters. Kids usually like knowing that a code this simple once guarded real secrets.

Teach It Step by Step

  1. Write the alphabet in one line. Under it, write the alphabet again starting with B, so B sits under A. Put A at the end, under Z.
  2. Encode a short word together with a shift of 1. DOG becomes EPH.
  3. Let kids decode one on their own: DBU with a shift of 1 is CAT.
  4. Move to a shift of 3 and use the key above.
  5. Teach the wrap-around with a word that has an X, Y, or Z in it. With a shift of 3, FOX becomes IRA.
  6. Let partners trade messages. The sender writes the shift number on the back of the paper.

Try it: Decode this message with a shift of 3.

PHHW DW UHFHVV

Show the answer

MEET AT RECESS. Move each letter three places back: P goes back to M, H goes back to E.

Encode forward, decode back. To read a message with a shift of 3, move each letter three places back: D goes back to A.

Make a Decoder Wheel

Illustration of two cardstock circles joined with a paper fastener, child scissors, and a pencil

A decoder wheel makes shifting fast. Cut two paper circles, one a little smaller than the other. Write the alphabet around the edge of each circle, or use a printed template so the 26 letters line up. Push a brad (a paper fastener) through both centers.

The outer wheel shows the plain letters, and the inner wheel shows the code letters. For a shift of 3, turn the inner wheel until its D lines up with A on the outer wheel. Then read each code letter straight across from its plain letter.

Cutting neat circles is hard for little hands. For younger kids, cut the circles ahead of time or print them on cardstock.

Common Mix-Ups

  • Shifting the wrong way when decoding. Remind kids: forward to encode, back to decode.
  • Forgetting to wrap around after Z.
  • Counting letters in their heads and skipping one. Point to each letter on the strip instead.

The Pigpen Cipher

How It Works

The pigpen cipher swaps each letter for a shape. Kids draw four frames and write the alphabet in them: two tic-tac-toe grids (the second one with a dot in every space) and two big X shapes (the second one with dots, too).

Pigpen cipher key: A to I in a grid, J to R in a dotted grid, S to V in an X, W to Z in a dotted X, and the word AGENT written in pigpen
The pigpen key and the word AGENT. Each letter becomes the lines around its space.

To write a letter, draw the lines around its space (its “pen”), plus the dot if it has one. E sits in the middle of the first grid, so it becomes a closed square. N sits in the middle of the dotted grid, so it becomes a square with a dot inside. The code is centuries old, and it still looks mysterious to anyone without the key.

Teach It Step by Step

  1. Draw the four frames together on the board. Kids copy them onto their own paper.
  2. Fill in the letters in order, left to right, top to bottom. In each X, go top, left, right, bottom.
  3. Have each child encode their own first name. It’s the word they know best.
  4. Decode a short message from you, such as a word from this week’s spelling list.
  5. Ask kids to check every symbol twice: are the lines right, and is the dot there or not?

Try it: Look at the five shapes under “Example” in the key. Cover the letters and decode them yourself. Then write your own name in pigpen.

Common Mix-Ups

  • Forgetting the dot. A and J have the same lines; only the dot tells them apart.
  • Mixing up mirror shapes, such as A and C, which open in opposite directions.
  • Filling in the grids in a different order than a partner. Everyone has to use the same key.

Which Code for Which Grade

GradesCodes to start withMake it harder
K–1Picture codes and the number code with a key, very short words, directions read aloudTwo-word messages
2–3Number code, pigpen with the key in view, Caesar shifts of 1 to 3 with a letter stripKids write messages for a partner
4–5Any shift, decoder wheels, pigpen from memoryCrack a Caesar message without the key by trying one shift after another until a word appears

Ways to Use Codes All Year

Once kids know a code, you can use it in small ways every week:

  • Write the morning message or a class password in code.
  • Put this week’s spelling words in pigpen and let kids decode them before they practice.
  • Add a code station to your literacy centers, next to logic puzzles for early finishers.
  • Ask an exit ticket question in code. Kids decode it, then answer it.
  • Hide a coded step inside an escape room or a detective case.
  • At home, slip a coded note into a lunchbox, or turn a birthday party into a trail of coded messages.

When a message won’t decode, check the key first. The problem is almost always a key that was copied wrong.

Secret Codes & Ciphers From Puzzle Caper

Our first code pack, Codebreaker Training, has eight secret codes for young agents in grades 2–5, from a number code to a decoder wheel, with an answer key.

Our first free printable puzzle is on the way, too. Join the list on our Free Printables page, and we’ll email it to you when it’s ready.

Keep reading

Math Mysteries for Kids: How to Run a Detective Case in Your Classroom

How to run a math mystery in grades 2–5: suspects, evidence, and elapsed time problems that point to one answer, with a worked example.

Unplugged Coding for Kids: Teach Sequences and Loops With Paper Arrows

Unplugged coding for grades K–5: arrow programs on a paper grid, a human robot game, loops, and debugging. No screens needed, at school or at home.

Puzzle Birthday Party Ideas: How to Host a Secret Agent Party

A puzzle party turns the guests into one team with one mission. Here's a 90-minute plan for a secret agent birthday party, with supplies, puzzles, and a laser maze.

Similar Posts