Update Sep 2026: OpenAI plans to retire custom GPTs on Dec 11, 2026 and move them to plugins. The same file prep applies to plugins and Projects.
Introduction
A 400-page book is a lot to hand over as one file: the index, running headers, and page numbers all come through as text alongside the chapters. The way you prepare it is the part you control.
This guide walks through how to turn a book into a custom GPT that retrieves accurately — by chapter, with citations, under ChatGPT's 20-file and 512MB limits. The steps work for nonfiction reference books, fiction, course material, technical manuals, and self-authored ebooks alike.
What "Turning a Book Into a Custom GPT" Actually Means
A custom GPT with a book attached isn't training on the book. ChatGPT doesn't fine-tune anything inside the Builder. What it does is run retrieval over the files in the knowledge tab — at query time, it pulls a few of the most relevant text snippets, drops them into the model's context, and answers from there.
This means three things shape every answer:
- How the book is split into files
- How each file is named
- How clean the text inside each file is
If you upload book.pdf as a single 400-page file, the retriever has to find the right passage out of one massive blob. Do the work upstream instead: split by chapter, strip page numbers, and give the retriever well-shaped files.
Why This Matters for Custom GPTs
A custom GPT answers from the chunks it retrieves, so a well-structured book — one chapter or section per chunk, clearly labeled — gives it clear, self-contained passages to work from.
When you turn a book into a custom GPT, the goal is the opposite: every retrieved chunk should be from the chapter that actually answers the question. That requires structuring the upload so the retriever has clear signals — chapter boundaries, descriptive filenames, no junk text from headers and page numbers polluting the embeddings.
Books are also long. A typical nonfiction book runs 60,000–90,000 words. A textbook can hit 250,000. ChatGPT custom GPTs cap the knowledge tab at 20 files and 512MB per file. Most books fit comfortably under 512MB as text — the limit you'll actually hit is the 20-file cap, which forces you to think about how to chunk a long book into useful slices.
Step-by-Step: How to Turn a Book Into a Custom GPT
Step 1: Get the Book Into Clean Text
Whatever format the book starts in — PDF, EPUB, DOCX, scanned PDF — the first job is extracting plain text. The model never sees the original file. It sees the extracted text. If extraction is messy, the answers will be messy.
What to strip out before anything else:
- Running headers (the book title repeating at the top of every page)
- Running footers (page numbers, chapter title at the bottom)
- Index entries
- Table of contents (the model can infer structure from chapter filenames)
- Copyright pages, dedications, acknowledgements — unless the user will ask about them
- Footnote markers that break mid-sentence ("the war began¹ in 1939" should not have the
¹)
For scanned books, you need OCR first. Run it through a tool that preserves paragraph structure rather than producing a wall of broken lines. Verify the output by reading a random page — if OCR mangled half the words, no amount of chunking will save the GPT.
Step 2: Split the Book by Chapter, Not by Page Count
The single biggest mistake in book-to-GPT workflows is splitting by page count or word count. Page 200 of a textbook might land in the middle of a worked example. Word 50,000 might split a quote in half. The retriever then grabs a chunk that ends mid-thought, and the model fills in the gap with whatever sounds reasonable.
Split by semantic boundary — chapter, then section if chapters are too long:
chapter-01-introduction.txt
chapter-02-the-early-years.txt
chapter-03-first-business.txt
...
chapter-18-conclusion.txt
For a book with more than 20 chapters, group adjacent short chapters into one file (chapters-01-03-foundations.txt) or split long chapters by section (chapter-07a-the-fall.txt, chapter-07b-the-recovery.txt). The 20-file cap is the constraint to plan around.
A useful rule of thumb: keep each file between 3,000 and 15,000 words. Smaller than that and you're wasting file slots. Larger than that and each file covers too much ground to check easily.
Step 3: Name Files So the Retriever Can Use Them
Filenames are not just labels. ChatGPT's retriever uses filename text as part of its scoring signal. A file called chapter-12-pricing-models.txt ranks higher for a pricing question than ch12.txt, even if the body text is identical.
Naming patterns that work:
chapter-NN-descriptive-slug.txt— chapter number for order, slug for topic matchpart-N-NN-topic.txtfor books with parts (part-2-04-execution-tactics.txt)appendix-A-glossary.txt,appendix-B-reading-list.txt
Avoid generic names like text1.txt, book-pt2.txt, final-final.txt. The model can read filenames in its system prompt; making them informative also lets the GPT cite which chapter an answer came from.
Step 4: Write a System Prompt That Forces Citation
Custom GPTs default to summarizing from retrieved chunks without saying where the chunks came from. For a book, that's a problem — the whole point is to give answers grounded in the text, not paraphrases that sound book-ish.
A working system prompt for a book-based GPT includes three instructions:
- Always cite the chapter (and section if relevant) when answering from the book
- If the retrieved chunks do not contain the answer, say "I don't see that in the book" rather than guessing from general knowledge
- Quote the exact text when the user asks for the author's wording
Example fragment:
This GPT answers questions about [Book Title] by [Author].
Rules:
- When answering, cite the chapter the answer came from (e.g., "From Chapter 4: ...").
- If the knowledge files do not contain the answer, respond: "I don't see that in the book." Do not fall back to general knowledge.
- When the user asks for an exact quote, paste the line verbatim and put it in quotation marks.
The "I don't see that in the book" line is the single most important sentence in the prompt. It tells the GPT exactly what to do when a question goes beyond the book.
Step 5: Upload, Test, Iterate
Once the chapter files are clean, named, and the prompt is set, upload them to the custom GPT's knowledge tab. Test with three categories of questions:
- Direct lookup: "What does Chapter 5 say about onboarding?" The GPT should pull from
chapter-05-*.txtand quote or summarize accurately. - Cross-chapter synthesis: "How does the author's view in Chapter 2 compare to Chapter 11?" Retrieval should pull from both, and the answer should reference each.
- Out-of-book questions: Ask something the book doesn't cover. The GPT should refuse rather than improvise. If it improvises, tighten the system prompt.
Read every answer against the actual text. Wrong citations almost always trace back to either a too-long file (split it) or a too-vague filename (rename it).
Common Mistakes to Avoid
Uploading the whole book as one PDF. This is the default mistake. A single 400-page PDF gives the retriever no semantic boundaries to work with, and answers come back stitched from random pages. Always split before uploading.
Keeping the PDF format. ChatGPT can read PDFs, but PDF text extraction is unreliable — multi-column layouts, footnote markers, and embedded fonts produce text the retriever struggles with. Convert to plain text or markdown before chunking. A clean .txt outperforms a "modern" PDF every time.
Skipping the cleanup pass. Headers, footers, and page numbers that repeat on every page get embedded as if they were content. The GPT then "knows" that "Chapter Title — Page 47" is meaningful text and will sometimes cite it as if it were a quote. Strip everything that isn't the actual prose.
No citation requirement. Without a forced-citation instruction, the GPT will paraphrase fluently and give zero hint about where an answer came from — which makes verification hard.
Ignoring copyright. If the book isn't yours and you didn't buy the rights, hosting it inside a custom GPT — even a private one — is a legal gray zone at best. Self-authored books, public-domain texts, and material you have explicit rights to are the safe inputs.
Wrapping Up
A book turns into a useful custom GPT when the upload is structured the way the retriever needs it: clean text, chapter-level files, descriptive names, a system prompt that forces citation, and a tested refusal pattern for off-book questions. Most of the work is upstream — once the files are right, the GPT mostly takes care of itself.
If you want to skip the manual chapter splitting and text cleanup, Knowledge Builder Pro handles the conversion automatically — drop in a book in any common format and get a clean, chapter-named, retrieval-ready set of files inside the 20-file ChatGPT limit. No files stored, processed in-memory, downloaded straight to your machine.