Six Classic Codes and Ciphers You Can Learn in an Afternoon

Six classic codes and ciphers cover about 90 percent of what you’ll meet in escape rooms, mystery caches, scavenger hunts and party games, and every one of them can be learned well enough to use in a single afternoon. This guide teaches all 6 with worked examples: the Caesar shift, Atbash, the pigpen cipher, Morse code, the general substitution cipher, and the book cipher, plus the one cracking technique that defeats half of them and the honest limits of each.

In this article
  1. First, the vocabulary that trips everyone up
  2. Caesar shift: the gateway cipher
  3. Atbash: the alphabet mirrored
  4. Pigpen: the cipher you can draw
  5. Morse code: the one everyone recognizes
  6. Substitution and the technique that breaks it
  7. Book cipher: the one with a real treasure story
  8. Designing your own cipher clues
  9. Where you’ll meet them, and how to practice

First, the vocabulary that trips everyone up

A code and a cipher are different tools, and games mix them up constantly. A code replaces whole words or phrases with something else, so “meet at midnight” might become “the owl flies,” and a code needs a shared list of meanings to work. A cipher operates on letters, replacing or rearranging them one at a time, so it can hide any message ever written without a pre-agreed list. Morse code, despite its name, sits in between, since it replaces letters with dots and dashes but does it publicly, hiding nothing from anyone who knows the system. The distinction matters in practice because the tools for cracking them differ, and a hunt designer who says “crack the code” almost always means a cipher. That’s why this guide teaches ciphers.

The second piece of vocabulary is the difference between a system’s secrecy and a message’s secrecy. All 6 systems in this guide are publicly known, and every one of them has been broken by professionals within hours or less. Their value in games isn’t security, since nobody is actually defending state secrets with a pigpen grid. The value is the 10 to 20 minutes of satisfying work a solver puts in, and that work is what you’re buying when you build one into a treasure hunt. Keep that framing and you’ll use them correctly, as puzzles rather than safes.

Caesar shift: the gateway cipher

The Caesar cipher is the oldest documented cipher in the Western tradition, described by the Roman historian Suetonius around 121 AD in his account of Julius Caesar’s private correspondence. Caesar shifted every letter of the alphabet 3 positions forward, so A became D, B became E, and the message “ATTACK AT DAWN” became “DWWDFN DW GDZQ.” The Caesar cipher article on Wikipedia covers the history and the math, but the practical version fits in one sentence: agree on a shift number, slide the alphabet, and write the result. With 25 possible shifts, the system has exactly one defense, which is that the reader doesn’t know the shift, and that defense usually collapses the moment you try all 25. A patient 12-year-old can do it in about 5 minutes with pencil and paper.

The cipher’s modern descendant is ROT13, a fixed shift of 13 that became the standard spoiler-hiding convention on Usenet in the early 1980s and now hides hints across the puzzle world. If you’ve read our geocaching guide, you’ve already used it, because every geocaching hint is ROT13-encrypted on the listing page and decoded with one tap. ROT13 has a lovely self-inverse property, since applying it twice returns the original message, which means one tool both hides and reveals. For game design, the Caesar shift is the right first cipher for kids aged 8 and up, and a printed cipher wheel, 2 concentric paper discs with the alphabet on each, turns the arithmetic into a satisfying physical twist.

Cycle diagram of the Caesar cipher: write the alphabet, choose a shift number, slide each letter forward, write the result, and decode by sliding back
The Caesar shift as a cycle: one shift number turns the whole alphabet into a puzzle.

Atbash: the alphabet mirrored

Atbash is even older than Caesar and simpler to teach, because it needs no shift number at all. The system mirrors the alphabet, so the first letter swaps with the last, the second with the second-to-last, and so on: A becomes Z, B becomes Y, M becomes N. The name comes from Hebrew, where the first letter aleph swaps with the last letter tav, and scholars have long noted apparent Atbash substitutions in the Book of Jeremiah, where “Babel” appears to be written as “Sheshach,” as the Atbash article on Wikipedia lays out with the Hebrew alphabet. Like ROT13, Atbash is its own inverse, so encoding and decoding are the same operation, and that symmetry makes it the fastest cipher to teach a group of kids at a party.

Its weakness is also its teaching value. Atbash preserves the message’s letter frequencies exactly, so a long Atbash message still shows the same pattern peaks as plain English, and anyone who knows the system reads it at sight once they notice Z standing where A should be. In a game, Atbash works best as a second-layer puzzle, where solvers first realize the text is mirrored and then race to decode it, and the realization moment tends to be the best 30 seconds of the puzzle.

Pigpen: the cipher you can draw

The pigpen cipher, also called the Masonic cipher, replaces letters with the shapes of the grids they sit in, and it’s the most visually distinctive system in the classic set. Picture 2 tic-tac-toe grids and 2 X-shapes, assign one letter to each compartment, and then write each letter as the lines that surround its compartment, with a dot to distinguish the second grid of each pair. Masons used the system for correspondence and ritual documents in the 18th century, which is why it shows up on old lodge documents and gravestones. The pigpen cipher article on Wikipedia reproduces the standard grids and the historical variants.

Pigpen is usually the best cipher for younger solvers, because the work is spatial rather than arithmetic. A 9-year-old who can’t manage letter-shifting arithmetic can absolutely match shapes, and the cipher text looks wonderfully mysterious, all angles and dots, which sells the spy fantasy better than any string of shifted letters. The standard grids are so widely reproduced that most solvers eventually memorize them, so treat pigpen as a lookup puzzle rather than a hard one, and hide the grid itself somewhere in the game if you want the full two-stage experience of finding the cipher and then reading the message.

Morse code: the one everyone recognizes

Morse code is the celebrity of the group, and it’s earned the fame. Samuel Morse and Alfred Vail developed the system in the 1830s for the telegraph, and the first official message, “What hath God wrought,” traveled the 40 miles from Washington to Baltimore on May 24, 1844. The design is smarter than most people realize, because Vail assigned the shortest codes to the most common letters after studying the type cases of a Philadelphia newspaper. E is a single dot, T is a single dash, and rare letters like Q usually get long patterns like dash-dash-dot-dash. The full history, including the international standardization that produced today’s International Morse, is documented in the Morse code article on Wikipedia.

For games, Morse has 3 properties worth exploiting. First, everyone recognizes the dots and dashes on sight, so a Morse clue announces itself as a puzzle with no explanation needed. Second, the SOS pattern, 3 dots, 3 dashes, 3 dots, is known worldwide and makes a perfect aha-moment seed inside a longer message. Third, the code can be transmitted through anything, so a flashlight blinking from a window, a series of taps on a table or a pattern of short and long sounds all carry the same message, which is why Morse shows up in escape rooms more than any other system here. Learning the full alphabet takes most people about 10 hours of practice spread over a week. Reading a printed Morse clue with a chart takes 2 minutes, and the chart version is what games usually use.

Substitution and the technique that breaks it

The general substitution cipher is the Caesar shift’s bigger sibling: instead of sliding the alphabet by a fixed number, you scramble the alphabet completely, so A might become Q, B might become L, and the mapping is arbitrary. With roughly 4 times 10 to the 26th power possible alphabets, brute force is hopeless, and for centuries substitution ciphers were considered genuinely secure. They aren’t, and the reason is the single most important idea in classical cryptography: frequency analysis. In any long English text, E appears about 12.7 percent of the time, T about 9 percent, A about 8 percent, and the most frequent cipher symbol is therefore probably E. The technique was documented by the Arab polymath Al-Kindi in the 9th century, and the frequency analysis article on Wikipedia traces how it has dismantled substitution ciphers ever since.

For game purposes, substitution usually sits at the top of the difficulty range. A well-built substitution puzzle with 40 or 50 words of cipher text takes a motivated adult team 20 to 40 minutes with a pencil and a frequency table. Give solvers the frequency-order hint “ETAOINSHRDLU,” the rough order of English letter frequency, and the puzzle stays fair; withhold it and the puzzle can stall completely. Tools like dCode, a free cipher-solving site that has handled the classics since 2003, will break a substitution message automatically, which is worth knowing both as a solver and as a designer, since any cipher a website can crack in 3 seconds is a puzzle about persistence rather than secrecy.

A few historical anchors make the practice stick. The Caesar shift is named for the Roman commander Suetonius reported using it, Atbash is the Hebrew alphabet’s mirror trick, older than the Caesar cipher by centuries, and Morse code, standardized for telegraphy in the 1840s, remains the only cipher on this list you can send by flashlight, whistle, or knotted rope. Frequency analysis — the technique that breaks simple substitution — was documented by the Arab polymath al-Kindi in the ninth century, and it still works in an afternoon on any Caesar or Atbash message long enough to count letters. Free tools like cryptii.com encode and decode every cipher in this guide, which makes checking your own puzzles a ten-second job before you hand them to anyone.

Stacked ladder of the six ciphers from easiest to crack to hardest: Atbash, Caesar, pigpen, Morse, substitution, and book cipher
The crackability ladder: the bottom three fall in minutes, the top two take real work.

Book cipher: the one with a real treasure story

The book cipher replaces every word with a coordinate into an agreed text: page 42, line 7, word 3. Both parties need the same edition of the same book, and the message becomes a list of numbers that means nothing without the source text. The system has the best documented treasure story in cryptography, the Beale ciphers, a set of 3 encrypted texts published in an 1885 pamphlet that supposedly describe a buried fortune in Bedford County, Virginia. The second Beale cipher was decoded using the Declaration of Independence as the source text and describes the treasure. The other two remain unsolved after 140 years, a standing invitation documented across the cipher literature and a favorite subject of the collection at Crypto Museum.

At home, the book cipher is often the most elegant option for a multi-day game. Choose a book everyone owns, agree on the edition, and the clue becomes a page of innocent-looking numbers that only resolves when the solver realizes which book. The failure mode to design around is edition drift, because page numbers shift between printings, and a clue built on the 2003 paperback will point at the wrong words in the 2019 reissue. Buy the copies yourself, hand them out, and the system works flawlessly.

Designing your own cipher clues

Once you know the 6 systems, writing your own clues takes about 15 minutes per clue, and 4 habits separate the good ones from the groaners. Keep messages short, 5 to 12 words, because every extra word adds solving time without adding fun. Identify the system inside the game rather than on the clue itself, so a pigpen message comes with a drawing of the grids hidden in a book, since naming the cipher on the clue does half the solver’s work for them. Match the cipher to the audience, Atbash and Caesar for kids, substitution and book ciphers for adults. And always solve your own clue cold the next morning, because a cipher you wrote yesterday reads differently today, and the mistakes you catch in that 5-minute check are the ones your players would have found the hard way.

One more design habit pays off disproportionately, and it’s the layered clue. A single cipher is a speed bump, but a cipher whose decoded message is itself a puzzle, like a Caesar-shifted note that reads “the second word of every sentence matters,” produces the double aha that players remember for years. Layer no more than 2 systems deep, though, because a triple-layered clue stops feeling clever around layer 3 and starts feeling like homework.

Where you’ll meet them, and how to practice

These 6 systems recur across every hobby this site covers, which is why they’re worth an afternoon. Escape rooms use Caesar, pigpen and Morse all the time, usually as a mid-game puzzle with the cipher chart hidden elsewhere in the room. Mystery geocaches often run on substitution and Caesar variants, and puzzle-hunt designers reach for Atbash and book ciphers when they want a second-layer solve, a territory our city puzzle hunt guide maps in more detail. Scavenger hunt designers use the top rungs of this ladder for teen and adult clues, exactly as the scavenger hunt design guide describes. Learn all 6 and you’ve essentially learned the language the entire puzzle world writes in.

The afternoon practice plan that usually works is simple, and it costs nothing. Spend about 20 minutes each on Caesar and Atbash, encoding and decoding the same 10-word message until both feel mechanical. Give pigpen 30 minutes, drawing the grids from memory until the shapes stick. Spend 30 minutes reading Morse with a chart, decoding a printed sentence and then tapping your name on the table. Finish with an hour of substitution, solving a 40-word message with a frequency table and the ETAOINSHRDLU hint, because that solve, the slow revelation of words emerging from noise, is the most satisfying hour in this entire guide. Tools like Cryptii, a free in-browser playground for the classic ciphers, let you check every attempt instantly and turn the whole afternoon into a self-marking workbook.

The six classic ciphers at a glance
Cipher How it works Age it suits Time to crack
Caesar shift Alphabet slid by a fixed number 8+ Minutes (25 shifts to try)
Atbash Alphabet mirrored, A swaps with Z 7+ Minutes once recognized
Pigpen Letters drawn as grid shapes 8+ Minutes with the grid
Morse code Letters as dots and dashes 9+ with a chart Not hidden, just encoded
Substitution Alphabet fully scrambled 13+ 20–40 minutes with frequency analysis
Book cipher Words replaced by page-line-word numbers 13+ Unbreakable without the source text

One caution belongs at the end, because it’s the mistake every new designer makes once. These systems are puzzles, not locks, and a game that treats them as locks, with a 60-word Atbash paragraph or a substitution cipher with no frequency hint, produces groaning rather than delight. Use short messages, 5 to 12 words, hide the cipher identification inside the game, and let the cipher be the fun middle of the solve rather than the wall at the end of it. It’s also worth saying plainly that nobody learns these systems from reading about them, so the practice plan above isn’t a suggestion so much as the whole point: you can’t teach a cipher you haven’t solved yourself. An afternoon with this guide and you’ll never look at a string of dots and dashes the same way again, and neither will anyone you teach.

Every classic cipher is a puzzle, not a lock. The goal is 15 minutes of satisfying work, never a wall.