Decode a playfair cipher
Green highlight

Create and decode messages using a Playfair cipher grid with a keyword, pairing letters and applying rules to reveal secret phrases safely.

Orange shooting star
Download Guide
Collect Badge
Background blob
Challenge Image
Table of contents

Step-by-step guide to decode a Playfair cipher

Here at SafeTube, we're on a mission to create a safer and more delightful internet. 😊

Playfair Cipher

What you need
A friend to test codes (optional), colouring materials, eraser, paper, pencil, ruler

Step 1

Gather your materials.

Step 2

Pick a short secret keyword and write it at the top of your paper.

Step 3

Use your ruler and pencil to draw a 5 by 5 square grid.

Step 4

Write the letters of your keyword into the grid from left to right top to bottom skipping any letter that already appeared.

Step 5

Fill the remaining empty boxes with the rest of the alphabet from A to Z skipping J and any letters already used until the grid is full.

Step 6

On a new line write a short secret message using only letters (no spaces or punctuation).

Step 7

Change any J in your message into I.

Step 8

Break the message into letter pairs (digraphs); if a pair has the same letter put an X between them and continue pairing; if one letter is left at the end add an X to make a final pair.

Step 9

Encode each pair using the Playfair rules: if both letters are in the same row replace each with the letter to its right (wrap to the left edge if needed); if both are in the same column replace each with the letter below it (wrap to the top if needed); otherwise replace each letter with the letter in the same row but in the column of the other letter (swap columns to form a rectangle).

Step 10

Ask a friend to encode a message using your completed grid so you can practice decoding.

Step 11

Decode a message from your friend by reversing the Playfair rules: move left for same-row pairs; move up for same-column pairs; and swap columns for rectangle pairs.

Step 12

Decorate your grid and secret notes with colouring materials to make your spy code look amazing.

Step 13

Share your finished creation on DIY.org.

Final steps

You're almost there! Complete all the steps, bring your creation to life, post it, and conquer the challenge!

Complete & Share
Challenge badge placeholder

Help!?

What can I use if I don't have a ruler, pencil, or colouring materials listed in the instructions?

If you don't have a ruler or pencil, use the straight edge of a book and a pen, and substitute colouring materials with crayons, markers, or coloured paper scraps to decorate your 5x5 grid and secret notes.

I'm getting confused when pairings don't seem to match the decoding rules—what common mistakes should I check?

Check that you converted any J to I (step about changing J), that you inserted an X between identical letters when making digraphs (step about breaking the message into letter pairs), and that you applied row/column wrap rules correctly when decoding same-row or same-column pairs.

How can I adapt the activity for different age groups?

For younger kids, have an adult pre-draw the 5x5 grid on paper and help form digraphs and insert X, while older kids can make it harder by using longer secret messages or expanding to a 6x6 grid that includes J and digits.

How can we extend or personalise the Playfair cipher activity after we've decoded a few messages?

Personalise by decorating the grid with colours and stickers, use coloured pencils to mark rows and columns for faster decoding, create themed keywords for different missions, or ask friends to encode messages to post your creations on DIY.org.

Watch videos on how to decode a Playfair cipher

Here at SafeTube, we're on a mission to create a safer and more delightful internet. 😊

Playfair Cipher Explained | Step-by-Step Encryption & Decryption Tutorial with Examples-Substitution

3 Videos

Facts about classical ciphers and basic cryptography

🕵️ British forces used the Playfair cipher during the Second Boer War and World War I because it was practical for manual use.

🧩 Playfair encrypts pairs of letters (digraphs), which hides single-letter frequency patterns and makes simple frequency attacks harder.

🗝️ The cipher uses a 5×5 grid and commonly combines I and J into one cell, so the alphabet fits into 25 squares.

🔐 The Playfair cipher was invented by Charles Wheatstone in 1854 but later named after Lord Playfair who popularized it.

💻 Though easy to learn and use by hand, modern computers can crack Playfair quickly — it’s perfect for teaching code-thinking, not real-world security.

How do you decode a Playfair cipher grid step by step?

Start by choosing a keyword and build a 5×5 grid (combine I/J into one cell). Fill the grid left-to-right with the keyword’s unique letters, then the remaining alphabet. Split the secret message into letter pairs, inserting an X between duplicate letters in a pair and adding an X if one letter is leftover. To decode each pair: if they share a row, shift each letter one space left; if in the same column, shift each up one; otherwise, swap letters across the rectangle corners. Read the resulting l

What materials do I need to create and decode a Playfair cipher with kids?

You only need simple supplies: plain paper, pencils, an eraser, and a ruler to draw a 5×5 grid. Optionally print a blank grid template, have a small alphabet reference, and colored pencils for marking pairs. A list of kid-friendly keywords (names, animals) helps. For group play, use scrap paper for drafts and a timer for decoding races. No electronics are required, though a printable guide can be handy.

What ages is decoding a Playfair cipher suitable for?

This activity fits children roughly aged 8–14. Kids who know the alphabet and can spell short words will enjoy it. Younger children (6–7) can play with a grown-up using a pre-made key grid and simplified rules; older kids and teens can try longer messages, invent keywords, or compare encode/decode steps. Adjust difficulty by using shorter messages, allowing hints, or turning it into a team challenge.

What are the benefits of making and decoding Playfair cipher messages with kids?

Playfair cipher games build pattern recognition, logical thinking, and sequencing skills as children follow grid rules and debug pairs. They reinforce spelling and alphabet familiarity while practicing patience and attention to detail. It also introduces historical cryptography and teamwork when kids create and swap secret messages. The activity is low-cost, screen-free, and adaptable for single play or group challenges, supporting both individual problem-solving and cooperative learning.
DIY Yeti Character
Join Frame
Flying Text Box

One subscription, many ways to play and learn.

Try for free

Only $6.99 after trial. No credit card required

Decode a playfair cipher. Activities for Kids.