Secret Code Books for Kids and Teens: Christmas Gift Ideas
Christmas gift ideas for kids and teens who love puzzles: the best books about secret codes, ciphers and codebreaking, from The Mysterious Benedict Society at 9 to breaking real ciphers with Python as a teen.
Codes are the oldest kind of hacking. Someone hides a message, someone else wants it, and the whole contest fits on a sheet of paper. No laptop, no account, no age limit. That's why a code book is such a good present: it comes with a game the family can play the same afternoon.
It also teaches the real thing. Codebreaking runs on the same moves security people use today: look for patterns, assume the other side was lazy somewhere, try the cheap attack first. A ten-year-old breaking a sibling's substitution cipher by counting letters is doing actual cryptanalysis, just slowly.
The children's books below aren't in our catalog, which reviews adult titles. The adult ones at the end are, with full reviews.
The short version
| Age | Book | Why this one |
|---|---|---|
| 9-12 | The Mysterious Benedict Society | Puzzles and Morse code in a hugely popular adventure series |
| 8-12 | Book Scavenger | A mystery with ciphers the reader solves too |
| 10+ | Can You Crack the Code? | The best illustrated history of ciphers for kids |
| 10+ | Top Secret by Paul B. Janeczko | A workshop manual for making and breaking codes |
| 10+ | Code Girls (Young Readers Edition) | The true story of teenage codebreakers |
| 12+ | The Code Book (young-adult edition) | The whole history, from Caesar to the internet |
| 13+ | Cracking Codes with Python | Breaking ciphers with a computer |
| 15+ | The Code Book, Codebreaking | Adult books for strong readers |
Start with a story
The Mysterious Benedict Society
The Mysterious Benedict Society by Trenton Lee Stewart (2007) is the one kids already know, or will be talking about by New Year. A newspaper ad asks "Are you a gifted child looking for special opportunities?", and the four kids who pass a series of very strange tests get sent undercover into a school that is not what it seems. To report back to Mr. Benedict, they have to learn Morse code, and they use it all the way through the series.
It isn't a codes manual. It's a long, funny adventure where being clever beats being strong, which is exactly the message for a kid who likes puzzles. Readers who finish all four books usually know Morse better than their parents. It was also adapted as a TV series, which helps sell it to a reluctant reader.
Book Scavenger
Book Scavenger by Jennifer Chambliss Bertman is smaller and more hands-on. Emily moves to San Francisco, finds a hidden book, and gets pulled into a city-wide game built on clues and ciphers. The ciphers are printed in the book, so readers can crack them before the characters do, and most kids try. It's the gentlest start on this list, and the first of a series: the sequel, The Unbreakable Code, raises the difficulty.
Then learn how codes really work
Can You Crack the Code?
Can You Crack the Code? A Fascinating History of Ciphers and Cryptography by Ella Schwartz is the nonfiction book we'd hand a 10-year-old first. It moves from ancient Sparta to Enigma to the encryption in a phone, with puzzles along the way, and it won the AAAS/Subaru SB&F Prize for Excellence in Science Books in 2020. It also explains, in kid language, why every code in history was eventually broken and what changed with computers. That idea is the one that matters.
Top Secret
Top Secret: A Handbook of Codes, Ciphers and Secret Writing by Paul B. Janeczko is the workshop manual. Substitution ciphers, code wheels you cut out and assemble, invisible ink, with a page of history behind each. Less of a read-through book, more something left open on the kitchen table for a week.
Code Girls, Young Readers Edition
Code Girls by Liza Mundy tells the true story of the American women who broke enemy codes in World War II. Many were recruited straight out of school, and all of them were sworn to secrecy for decades. The young readers edition keeps the stories and cuts the length. It lands well because the people doing the codebreaking are barely older than the reader.
Ages 12 and up: the whole history
The Code Book by Simon Singh is the best book anyone has written about the history of codes: Mary Queen of Scots losing her head over a weak cipher, the Navajo code talkers, Enigma, then the public-key ideas that protect every website today. Singh also wrote a young-adult edition (published in the US as The Code Book: How to Make It, Break It, Hack It, Crack It) that keeps the stories and softens the maths.
Strong readers of 15 and up can skip straight to the adult edition. Our full review of The Code Book explains why it is still the best way into cryptography 25 years on, and which chapters have aged.
Ages 13 and up: break codes with a computer
Cracking Codes with Python by Al Sweigart (No Starch Press) is where codes meet programming, and it's the most useful book on this list for a teen who might end up in security. Each chapter builds a classic cipher in Python, then writes the program that breaks it. Caesar falls to a loop over 25 keys. Transposition falls to a dictionary check. Vigenère takes longer, and that's the lesson.
By the end, a teen understands why the cipher they invented at age ten would last about a second against a laptop, and what modern cryptography does differently. No programming experience needed, and the whole book is free on the author's website, so try a chapter before you buy.
Ages 15 and up: unsolved ciphers
Codebreaking by Elonka Dunin and Klaus Schmeh (2023) teaches how to crack classical ciphers using real historical messages and free tools. It's an adult book, and a determined teen who loved The Code Book will get through it. Some of the ciphers in it have never been solved. Putting one of those in front of a 16-year-old is about the strongest motivation we know of.
Three codes to try tonight
No book required. Each one opens a chapter in the books above.
Caesar cipher. Shift every letter by the same amount. With a shift of 3, A becomes D and HELLO becomes KHOOR. Then ask the real question: how many shifts would you need to try to break it? Only 25, which is why nobody serious has used it for two thousand years.
Pigpen. Draw two tic-tac-toe grids and two X shapes, add a dot to the second of each pair, and fill them with the alphabet. Each letter becomes the shape of the lines around it. It looks mysterious, which is all it has going for it: it's just a substitution cipher in a costume.
Keyword substitution, then break it. Pick a keyword with no repeated letters (ZEBRA), write it under A-B-C-D-E, then the rest of the alphabet without those letters. Have someone encode a paragraph, not a sentence. Then count which symbol shows up most. In English, it's probably E. That's frequency analysis, the trick that broke ciphers for a thousand years, and it only works if the message is long enough. Short messages are hard to break. Kids figure that out on their own, and it's a real insight.
For the family on Boxing Day
The Imitation Game tells the story of Alan Turing and Bletchley Park. It takes real liberties with history, and our review lists them, but it works well for older kids after Code Girls or The Code Book, mostly because they'll spot what the film got wrong.
Where to go next
Kids who love codes usually end up loving programming. Our coding and hacking books for kids covers ages 5 to 12, hacking books for teens picks up from there, and adults who caught the bug along the way can carry on with our cryptography books guide.
The books in this guide
The Code Book
Simon Singh · 1999
Still the best popular introduction to cryptography: clear, story-driven and genuinely educational, though it is an accessible survey rather than a definitive history.
Codebreaking
Elonka Dunin, Klaus Schmeh · 2023
A friendly, story-driven introduction to breaking classical ciphers, with the rare hook that some of its cases are still open; look elsewhere if you want modern cryptography.
As an Amazon Associate we earn from qualifying purchases. The links above are sponsored.
Frequently asked questions
- What is a good book about secret codes for kids?
- For ages 9 to 12, The Mysterious Benedict Society is the adventure series kids love, with Morse code at its heart, and Book Scavenger lets them crack ciphers alongside the characters. For nonfiction, Can You Crack the Code? by Ella Schwartz is the best illustrated history for kids. From about 12, the young-adult edition of Simon Singh's The Code Book tells the whole story of codebreaking.
- What is the easiest cipher to teach a child?
- The Caesar cipher: shift every letter by the same number of places, so with a shift of 3, A becomes D. It is also the easiest to break, since there are only 25 possible shifts, which makes it a good first lesson in codebreaking too.
- How can a teenager learn cryptography?
- Cracking Codes with Python by Al Sweigart builds classic ciphers in Python and then writes programs to break them, with no programming experience needed. After that, the adult edition of The Code Book and Codebreaking by Elonka Dunin and Klaus Schmeh.


