Book Cipher Decoder & Encoder

Paste the book text and your numbers. The tool works out whether they mean words, letters, lines or pages, and shows each number next to the word it points to.

Book text (the key)

0 pages · 0 lines · 0 words

To split the text into pages, put a line containing only --- (or ---PAGE---) between them.

Words starting with each letter

Useful when encoding: a letter with 0 cannot be written with the first-letter method.

  • A0
  • B0
  • C0
  • D0
  • E0
  • F0
  • G0
  • H0
  • I0
  • J0
  • K0
  • L0
  • M0
  • N0
  • O0
  • P0
  • Q0
  • R0
  • S0
  • T0
  • U0
  • V0
  • W0
  • X0
  • Y0
  • Z0

Tries every method that fits the shape of your numbers, counting from 1 and from 0, and ranks the readable results.

Advanced settings
Count from

Auto-detect tries both.

Hyphenated words

Separate entries with spaces, commas or new lines. Inside an entry use : . - or / (for example 2:4:1). A lone / marks a word break.

Auto-detect

Every method that fits your numbers, counting from 1 and from 0, ranked by how much the result reads like English. Tap one to use it.

Paste the book text first.

Decoded text

The decoded text appears here.

A book cipher replaces each letter or word of a message with numbers that point into a text both sides already own: a novel, a dictionary, a newspaper page, a song lyric. The numbers mean nothing on their own. With the right text in hand, 14 might be "the 14th word" and 3:7

might be "line 3, word 7, letter 2". Paste the text into the book cipher decoder above, paste your numbers, and it finds every word, shows the result, and highlights each word it used in the text.

What is a book cipher?

In a book cipher the key is a piece of text instead of a password or a number. Sender and reader agree on the text in advance, then the sender describes each part of the message by its position in that text. Because the positions can point to many different places, the same letter can be written in many different ways.

Book cipher
KeyA text both sides have, in the same edition
CiphertextGroups of numbers (positions in the text)
Common formsWord number; line and word; page, line and word (Ottendorf)
Famous examplesThe Beale ciphers, Benedict Arnold's letters
Main weaknessAnyone who guesses the book can read everything

Most book ciphers you meet today come from puzzles, escape rooms, geocaches and treasure-hunt stories, where the "book" is a poem, a letter or a page printed nearby.

How to use this book cipher decoder

  1. Paste the key text into the text box. Keep the original line breaks if your numbers refer to lines. If they refer to pages, put a line containing only --- wherever a new page begins. The tool shows how many pages, lines and words it found.
  2. Paste the numbers. Spaces, commas, full stops, dashes and new lines all work as separators. Inside a group, 3:7:2, 3.7.2, 3-7-2 and 3/7/2 are all read the same way.
  3. Leave the scheme on Auto, or pick one if you know it. Auto tries every scheme that fits your numbers and shows the most readable result first.
  4. Check the table. Each number is listed with the word it points to and the letter or word it gives. Tap a row to highlight that word in the text, which makes counting mistakes easy to see.
  5. Fix the settings if needed. Under advanced settings you can count from 0 instead of 1, count blank lines, and treat hyphenated words as one word or two.

To create your own message, switch to Encode: type the message, and the tool picks positions in your text for every letter or word.

Six book cipher numbering schemes

There is no single standard for book cipher numbers. The way the numbers are grouped usually tells you which scheme was used:

Numbers per groupSchemeEach group meansGives you
1Word number (Beale style)the Nth word of the whole textits first letter
1Word number, whole wordthe Nth word of the whole textthe full word
2Line : wordword W on line Lthe full word
3Line : word : letterletter C of word W on line Lone letter
3Page : line : word (Ottendorf)word W on line L of page Pthe full word
4Page : line : word : letterletter C of that wordone letter

To see how they differ, take the first two lines of the tool's sample text (press Load sample text to follow along):

Every morning the old library opens its heavy wooden doors to travellers. Maps of forgotten roads hang beside quiet windows, and visitors follow them

  • Word number: 17 7 10 1 → hang, its, doors, Every → HIDE.
  • Line : word : letter: 1:8:1 1:5:2 → line 1, word 8, letter 1 is the H of heavy; line 1, word 5, letter 2 is the I of library → HI.
  • Line : word: 2:11 1:3 2:7 2:4 → follow the quiet roads.

Worked example: decoding word numbers step by step

Decoding 17 7 10 1 with the text above means counting words across both lines, starting from 1:

NumberWordLetter
17hang (line 2: Maps is word 13, of 14, forgotten 15, roads 16, hang 17)H
7its (line 1)I
10doors (line 1)D
1Every (line 1)E

Word numbering runs straight across line breaks, so line 2 starts at word 13. That is the detail people most often miss when decoding a word-number book cipher by hand.

The Ottendorf cipher: page, line and word

An Ottendorf cipher is a book cipher written as page, line and word numbers, sometimes with a fourth number for the letter. It suits a printed book: 112.9.4 means page 112, line 9, word 4. The 2004 film National Treasure made the name widely known.

To decode an Ottendorf cipher here, paste the pages you need and separate them with a line containing ---. The pages are numbered 1, 2, 3 in the order you paste them, so if the cipher uses real page numbers such as 112, either paste from page 1 or subtract the first page number from every group. Line numbers count lines on that page only, starting again at 1 on every page.

Decoding a book cipher when you don't know the scheme

Puzzles often give you numbers and a text but not the rules. Auto keeps only the schemes that match how your numbers are grouped, decodes with each one counting from 1 and from 0, and ranks the results by how much they read like English. The best match is selected; tap any other result to switch to it.

Check the first few results, not only the top one. A single number can mean "take the first letter of word N" or "take the whole word N", and both readings often produce real English words. With the sample text, 17 7 10 1 reads hang its doors Every as whole words and HIDE as first letters; only you know which one the puzzle intended.

A few checks also narrow things down by hand:

  • No number is larger than 26. It may not be a book cipher at all. Numbers from 1 to 26 are usually the A1Z26 cipher, where 1 is A and 26 is Z.
  • Single numbers larger than the number of lines can only be word numbers.
  • A 0 anywhere means counting started at 0.
  • Small last numbers in each group, rarely above 10, suggest a letter position rather than a word position.
  • Numbers that repeat a lot suggest whole words like the and and, or a letter scheme where the sender did not vary positions.

If you are not sure what kind of cipher you have, the cipher identifier can help rule out other number ciphers first.

Why your book cipher decode comes out garbled

When the text is right but the output is nonsense, the two sides almost always counted differently. Check these in order:

  1. Edition. Different printings break lines and pages in different places. Page and line schemes only work with the exact same edition.
  2. Line breaks on screen. Text copied from a web page often has no real line breaks; the lines you see depend on the window width. Line numbers only mean something for text with fixed line breaks, such as a poem, a scanned page or a plain-text e-book.
  3. Where counting starts. Some senders count the title, chapter headings or a dedication; others start at the first sentence. Remove or keep them to match.
  4. Counting from 0 or 1. With the example text, 17 7 10 1 counted from 0 reads beside, heavy, to, morning, which gives BHTM. Flip the setting and it becomes HIDE.
  5. Hyphenated words. Well-known is one word to some people and two to others.
  6. Blank lines. For line schemes, decide whether empty lines count. The tool skips them by default.
  7. Numbers and abbreviations. A text full of dates or initials shifts word counts if one side counted "1776" or "U.S." as a word and the other did not.

A mistake early in the text shifts every later position by the same amount. If the decoded letters keep landing next to the right word, try an off-by-one fix before anything else.

How to encode a message with a book cipher

  1. Choose a text both sides can find in the same form, ideally one you can send or name exactly: a specific edition, a specific web page saved as plain text, or a printed handout.
  2. Make sure it is long enough. For word-number schemes, every letter you need must start some word in the text; X, Z and Q are often missing. The tool lists any letters it cannot find.
  3. Leave Spread the choices on (under Advanced settings). If every E became the same number, anyone could guess that the most common number is E. Varying positions spreads each letter over many numbers.
  4. Keep word breaks. The tool writes / between words so the reader gets the spaces back.
  5. Send only the numbers, and tell the reader how to count: which text, where counting starts, and whether it starts at 0 or 1.

Whole-word schemes produce shorter ciphertexts but need every word of your message to appear in the text. They work well with a dictionary, which is why some historical book ciphers used one.

Famous book ciphers

Illustration of an open old book with underlined lines beside a letter written in groups of numbers, a quill and a wax seal by candlelight
An artist's impression of a book cipher at work: words are counted in a shared book, and only the numbers go into the letter.

The Beale ciphers. A pamphlet published in Virginia in 1885 printed three number ciphers said to describe a buried treasure. The second one decodes with the Declaration of Independence: each number is a word, and you keep its first letter. It describes the treasure, but the other two ciphers, which would say where it is buried and who owned it, have never been solved, and many researchers think the story is a hoax. Even the solved cipher only works if you number the Declaration the same slightly irregular way the encoder did, a real example of the counting problems listed above.

Benedict Arnold and John André. In 1780, while Arnold was secretly arranging to hand the fort at West Point to the British, he and the British officer John André wrote to each other with words replaced by page, line and word numbers from an agreed edition of Blackstone's Commentaries on the Laws of England.

Puzzle and game book ciphers. Today the book cipher is a staple of escape rooms, scavenger hunts and geocaching, because the "book" can be anything placed in the room or printed on the cache page.

How secure is a book cipher?

With a long, well-chosen text and varied positions, a book cipher is hard to break from the numbers alone, because the numbers carry no fixed pattern. Its weakness is the book. A popular book is easy to guess, a short text forces numbers to repeat, and a single intercepted message with its plaintext can reveal which text was used. Both sides also have to keep the same edition for as long as they write to each other. That is why the most famous book ciphers are remembered for being solved or misread, not for staying secret.

Book cipher compared with similar ciphers

CipherWhat the book is used forWhat the ciphertext looks like
Book cipherLooking up letters or words by positionNumbers
Running key cipherA long passage used as a Vigenère keyLetters
A1Z26 cipherNo book; 1–26 stand for A–ZNumbers from 1 to 26

A running key cipher also uses a book, but differently: the letters of a passage are added to the message like a Vigenère key, so the ciphertext is letters, not positions. If you have letters, it is not a book cipher; if you have numbers above 26, it probably is.

Frequently Asked Questions About Book Ciphers

Can I decode a book cipher without the book?
Usually not. The numbers are positions in a text, so without that text they carry almost no information. In puzzles the book is nearly always close by: a poem on the page, a letter in the room, or a well-known document such as the Declaration of Independence or a Bible verse. Try the texts the puzzle mentions first.
What is the difference between a book cipher and an Ottendorf cipher?
An Ottendorf cipher is one kind of book cipher. It writes each word as page, line and word numbers, sometimes with a fourth number for the letter. Other book ciphers use a single word number, or line and word only. This decoder handles all of them; choose Auto if you are not sure.
Can I use a web page or an e-book as the key text?
Yes for word-number schemes, which ignore line breaks. Be careful with line and page schemes: on a web page or in an e-book reader, lines and pages depend on screen size and font, so two people see different numbers. Use a plain-text copy with fixed line breaks, or agree on word numbers instead.
Why does every letter come out slightly wrong?
The sender almost certainly counted differently. Try counting from 0 instead of 1, then check whether the title or headings should be included, whether blank lines count, and whether hyphenated words are one word or two. Tap rows in the result table to see which word each number landed on.
Which book was used for the Beale cipher?
The second of the three Beale ciphers decodes with the Declaration of Independence, taking the first letter of each numbered word. The other two have never been solved, and no one has found a text that decodes them.
How long should the key text be?
For letter schemes, long enough that every letter you need appears many times, so each letter can get a different number each time. A few paragraphs is the minimum for short messages; a full chapter is better. The tool lists any letters your text cannot provide.

Similar tools