Book Cipher

Encode and decode a book cipher online with a shared reference text as the key. Choose word index, Beale, line · word, or character index addressing.

Reference text (book / key)
Input
0 chars · 0 bytes
Try:
Result
✓ Four addressing schemes: word, Beale, line·word, character ✓ Any text can serve as the key — no fixed alphabet ✓ We never store your messages ✓ Client-side processing only
Examples
Book cipher example: encode words by index
Reference text: the quick brown fox jumps over the lazy dog Addressing scheme: Word index
Input quick fox

Word-index scheme: QUICK is word 2 and FOX is word 4 in the shared reference text.

Book cipher example: decode word indexes
Reference text: the quick brown fox jumps over the lazy dog Addressing scheme: Word index
Input 2 4

Decode walkthrough: references 2 and 4 return QUICK and FOX from the same reference text.

Encode letters with the Beale scheme
Reference text: misty oaks rise slowly under autumn skies Addressing scheme: Beale (word first letter)
Input MARS

Beale scheme: M, A, R, and S point to words 1, 6, 3, and 4, whose first letters spell the message.

Encode with line · word coordinates
Reference text: red fox rests blue owl watches Addressing scheme: Line · word
Input owl fox

Line · word scheme: OWL is at 2.2 and FOX is at 1.2, so line breaks are part of the agreed reference.

How a Book Cipher works

A book cipher turns a message into references to an agreed text — the "book" or key. Rather than using a fixed alphabet, the book cipher code contains numbers or coordinates that point back into that text. The recipient enters the same reference text and addressing scheme, then uses those references to recover the message.

Choose the scheme that fits your shared text and purpose:

  • Word index replaces each message word with its 1-based position in the reference text.
  • Beale replaces each letter with the position of a word beginning with that letter.
  • Line · word uses coordinates such as 2.5 for line 2, word 5.
  • Character index replaces every character, including spaces, with its 1-based position in the reference text.

Use the delimiter selector to separate references when encoding. To decode, paste the reference text and the numbers; the tool reads numeric references automatically. Word-based schemes ignore capitalization and punctuation when they split text into words, while character index reads the reference text character by character.

Using a book cipher code reliably

For a book cipher to work, sender and recipient must agree on the same reference text and the same scheme before exchanging a message. Copy and paste the text when possible: a different edition, a missing line break, or an edited character changes the positions. Line · word depends on line breaks, and character index is especially sensitive because spaces, punctuation, and capitalization occupy positions.

When encoding with Word index or Line · word, every message word must occur in the reference text. With Beale, the reference needs at least one word for every letter you plan to send. Character index is useful when the message does not repeat the book's words, but the book must still contain every required character. The tool identifies uncovered words, letters, or characters so you can choose a better reference or another scheme.

Book ciphers are a useful historical and educational cryptography method, but they are not modern secure encryption. Do not rely on one to protect sensitive information: a known or guessable source text can reveal the message. Use this tool for learning, puzzles, and agreed-reference exercises; all processing takes place in your browser.

FAQ

Any shared passage can be the key: a book chapter, poem, public-domain text, or your own note. Both people must use the same copy and the same addressing scheme. For Line · word, preserve the same line breaks; for Character index, preserve every character. Avoid relying on a book cipher for sensitive information, because a known or guessed reference can expose the message.

The reference text does not cover part of your message. Word index and Line · word require every message word to appear in the text. Beale requires a reference word beginning with each message letter, and Character index requires every character, including a space, to be present. The tool lists what is missing; choose a longer reference, change the message, or select another scheme.

Choose Word index for messages made from words already found in the reference. Choose Beale when you want to spell a message letter by letter through word initials. Choose Line · word when fixed line coordinates are convenient or familiar to both sides. Choose Character index when you need to encode arbitrary text character by character and your reference contains all of its characters.

They are counted from 1. In Word index and Beale, 1 means the first word in the reference text. In Line · word, 1.1 means the first word on the first line. In Character index, 1 means the first character, including whitespace and punctuation.

A question mark marks a reference that cannot be resolved with the current text and scheme. The number or coordinate may be outside the available range, or the sender may have used a different copy of the reference, line breaks, or addressing scheme. Check those details and try again.

No. A book cipher is a historical manual cipher and a good learning or puzzle tool, not a replacement for modern encryption. If someone obtains or correctly guesses the reference text and scheme, they can decode the references. Use established end-to-end encryption for private or sensitive communication.
Related tools

Caesar Cipher

Classic letter-shift cipher with custom shift values.

XOR Cipher

Online XOR encryption and decryption with text or hex keys.

Playfair Cipher

Classic digraph substitution cipher with keyword matrix encryption.