DotDashKeySupport Us

The Best Books About Codes and Ciphers

By DotDashKey · 2026-08-03

Most "best books about codes" lists are really just one book padded out with filler — usually Simon Singh's, which deserves the praise but doesn't need eight imitators around it. This list is deliberately shorter and more specific: a handful of books that each do something genuinely different with the subject, from a 19th-century short story to a wartime memoir about codes printed on silk so agents could burn the evidence.

The One-Volume Overview: The Code Book, Simon Singh

Published in 1999, The Code Book is the book most people mean when they say "I read a book about codes once." Singh moves from ancient substitution ciphers through the Enigma machine to modern public-key cryptography, and the reason it holds up two and a half decades later is structural: each chapter is built around a real historical stake — a life, a war, a fortune — rather than a dry technical walkthrough, which is what actually makes cryptanalysis interesting to a general reader instead of a specialist.

The Reference Tome: The Codebreakers, David Kahn

David Kahn's The Codebreakers, published in 1967, is a different kind of book entirely — dense, exhaustive, and closer to an encyclopedia of cryptologic history than a story-driven read. It's notable for a reason beyond its content, too: the U.S. government reportedly tried to get parts of it altered or suppressed before publication, which is itself a small piece of evidence for how seriously the subject was taken at the height of the Cold War. It's not the book to start with, but it's the book a genuinely serious reader eventually ends up reaching for anyway.

The Wartime Memoir: Between Silk and Cyanide, Leo Marks

Leo Marks ran codes for Britain's Special Operations Executive during the Second World War, and his 1998 memoir Between Silk and Cyanide is the most human of any book on this list — funny, sometimes devastating, and full of the practical problems real wartime codemaking actually involved. Marks is credited with the idea of printing one-time codes on squares of silk, which agents in the field could burn instantly after use rather than risk a paper notebook being found in a search. It's a book about the emotional cost of the work as much as the cryptography itself, and it reads nothing like a textbook.

Where the Fictional Detective Story Started: The Gold-Bug, Edgar Allan Poe

Poe's 1843 short story The Gold-Bug is short enough to read in one sitting and features one of fiction's earliest detailed depictions of solving a substitution cipher by frequency analysis — the same basic technique that cracks a Caesar shift in minutes today. It's not a technical manual, but it's a genuinely enjoyable entry point for a reader who wants to feel what codebreaking-by-hand is actually like before reading about the real history.

The One for Younger Readers: Alvin's Secret Code, Clifford B. Hicks

First published in 1963, Alvin's Secret Code follows a twelve-year-old and his best friend using cryptography to solve a genuine mystery, and it's stayed in print for over sixty years for a reason most kids' adventure books don't manage — it actually teaches real cipher techniques through the story rather than treating codes as pure decoration, including notes on cryptography in an appendix at the back for a young reader who wants to go further. It's the natural next step for a kid who's already enjoyed cracking a Caesar cipher or a pigpen puzzle and wants a story built around the same skill.

Two More for Readers Who Want a Deeper, Single-Person Story

Andrew Hodges's 1983 biography Alan Turing: The Enigma is the book the 2014 film The Imitation Game was based on, and it's a far more thorough and technically grounded account of Turing's codebreaking work than any two-hour film could manage, treating his mathematics with the same seriousness as his wartime story. Jason Fagone's 2017 The Woman Who Smashed Codes covers a codebreaker who spent decades largely written out of the popular history of the field: Elizebeth Smith Friedman, who moved from breaking Prohibition-era smuggling codes to unmasking Nazi spy networks in South America and cracking versions of the Enigma machine used by German intelligence operatives. Both books share the same appeal as Marks's memoir — a real person's whole career, not just a summary of the ciphers involved.

How to Actually Choose Between Them

A reader who wants one well-told overview of the whole subject should start with Singh. A reader who wants the emotional, human side of real wartime code work — not just the technique, but what it cost the people doing it — should go straight to Marks. A reader building a home library who eventually wants the reference book they'll actually keep on a shelf for years belongs with Kahn, even though it's not a casual read. And for a younger reader, or an adult who wants the pure puzzle-solving pleasure of codebreaking without any of the historical weight, Poe's short story or Hicks's novel are both far better starting points than jumping straight into nonfiction.

One for Fiction Readers Who Want the Real Mechanics, Not Just the History

Neal Stephenson's 1999 novel Cryptonomicon weaves real cryptographic history — Alan Turing appears as a character, and WWII codebreaking runs through the plot — together with a modern storyline about a fictional data haven, and it's dense enough with actual technical detail that some readers use it almost as an unconventional companion to the nonfiction titles above. It's a genuinely different kind of read than anything else on this list: a long, ambitious novel rather than history or memoir, for a reader who wants cryptography folded into fiction rather than presented as a subject on its own.

A Note on Buying Older Titles

Between Silk and Cyanide and Alvin's Secret Code have both been in and out of print over the decades, so a library catalog or a secondhand bookshop is often a better first stop than assuming a new copy is easy to find. None of that scarcity is a reason to skip them — both have aged noticeably better than a lot of more recent, more heavily marketed books on the same subject, and a library interlibrary loan request is often faster and cheaper than tracking down a scarce printing to buy.

Frequently Asked Questions

What's the single best book to start with if I've never read anything about codes before?

Simon Singh's The Code Book is the most common and reliable starting point — it covers the widest range of history in one accessible volume, each chapter built around a real stake rather than dry technique.

Are any of these books actually useful for learning to break real ciphers myself?

Poe's The Gold-Bug is the most hands-on for feeling out frequency analysis on a substitution cipher, and Alvin's Secret Code includes an appendix of real cipher notes for younger readers. The others are stronger on history and human stories than step-by-step technique.

Is The Codebreakers by David Kahn worth reading cover to cover?

For most readers, no — it's better used as a reference than read straight through, given its length and density. It's the right choice for someone who wants a genuinely comprehensive historical record on a shelf, not a casual introduction.