A book cipher is a key-text cipher: instead of a fixed algorithm, its security rests on a shared passage of text known to both the sender and the receiver. Each word of the secret message is replaced with a reference pointing to where that same word appears in the shared text. To anyone without the exact passage, the message is just a meaningless list of numbers.
How it works
This tool uses a simple line.word reference scheme. The reference text is split into lines, and each line into words. To encode, the tool takes each word of your message, searches the reference text for a matching word (case-insensitively), and emits a reference of the form line.word — for example 3.5 meaning the 5th word on the 3rd line.
To decode, each line.word reference is resolved by jumping to that line and counting along to that word, returning the original text found there. Because the lookup is positional, the two sides only need to agree on the exact same reference text — no other key is required.
Worked example
Suppose the reference text is:
the quick brown fox
jumps over the lazy dog
To encode the message the dog, the tool finds the as the 1st word on line 1 (1.1) and dog as the 5th word on line 2 (2.5), giving the ciphertext 1.1 2.5. Decoding 1.1 2.5 with the same passage walks straight back to the dog.
Notes and tips
Choose a reference text that contains every word you need — longer, varied passages cover more vocabulary. Keep the exact passage secret and identical on both ends, including line breaks, since those define the references. Avoid famous public texts if you want real secrecy. Words not present in the reference cannot be encoded and are flagged. Everything runs locally in your browser; nothing is uploaded.