AI & prompting

How to Summarize a Long PDF With AI (Without Losing Pages)

To summarize a long PDF with AI, first check that the whole document fits the tool's page and token limits; if it doesn't, split it into sections of about 50 to 100 pages, summarize each section with page references, then ask for a summary of the section summaries. For short PDFs you can upload the file and ask directly, but for anything over a hundred pages the split-and-combine method is what keeps the model from silently skipping parts.

Why long PDFs go wrong

Every model reads through a fixed-size context window, measured in tokens. A PDF costs more tokens than people expect, because current APIs send each page as both text and an image:

  • Anthropic's PDF documentation says each page is converted to an image, the text is extracted alongside it, and text alone "typically uses 1,500–3,000 tokens per page depending on content density", with image tokens on top.
  • Google's Gemini documentation says "Each document page is equivalent to 258 tokens" for the page image, and that on Gemini 3 models native text is extracted as well, without charging for those text tokens.
  • OpenAI's documentation says that on vision-capable models "the API extracts both text and page images and sends both to the model", which "can increase token usage".

Do the arithmetic for a 300-page report at Anthropic's text estimate: 300 × 1,500 = 450,000 tokens at the low end, and 900,000 at the high end. That is more than many models accept in one request. When a document doesn't fit, a tool has to drop something, and a chat app won't always tell you which pages it left out. Summarizing section by section avoids that, and gives you page references you can check.

Step 1: check the limits for your tool

API limits as documented in October 2026:

APIMax file sizeMax pagesHow pages are read
Claude API32 MB per request (varies by platform)600 per request; 100 when the context window is under 1M tokensText plus page image
Gemini API50 MB1,000Page image (258 tokens) plus native text on Gemini 3
OpenAI APIUnder 50 MB per file, 50 MB per request in totalNot statedText plus page image on vision models

Anthropic adds a warning worth taking literally: dense PDFs "can fill the context window before reaching the page limit". The page limit is a ceiling, not a promise. Consumer chat apps have their own upload limits, which change more often than the API docs; check the app's help pages for the current numbers.

To estimate tokens for your document, extract the text (Step 2) and paste a few pages into a counter such as larely's token counter, then multiply by the page count.

Step 2: check the PDF actually contains text

Open the PDF and try to select a sentence. If you can't, the pages are scanned images. pypdf's documentation warns that for such pages "the extracted text may be minimal or visually empty" and points to OCR software such as Tesseract. Models that read page images can often cope with a clean scan, but OCR gives you text you can check and search, and it is much cheaper in tokens than images.

For text PDFs, extracting the text yourself with Python's pypdf lets you see exactly what the model will get, with page markers it can cite:

from pypdf import PdfReader

reader = PdfReader("report.pdf")
with open("report.txt", "w", encoding="utf-8") as out:
    for number, page in enumerate(reader.pages, start=1):
        out.write(f"\n--- page {number} ---\n")
        out.write(page.extract_text() or "")

Install it with pip install pypdf, ideally in a virtual environment. On a 120-page test PDF we generated, this produced 36,840 words of text in a fraction of a second. pypdf's documentation notes that PDF text is "absolutely positioned", so tables and multi-column layouts can come out in an odd order; check a table-heavy page before trusting it.

Step 3: split the PDF into sections

Split along the document's own structure where you can (chapters, parts), so each section is about one topic. If there is no useful structure, fixed-size chunks work. This script writes 50-page pieces:

from pypdf import PdfReader, PdfWriter

reader = PdfReader("report.pdf")
pages_per_chunk = 50

for start in range(0, len(reader.pages), pages_per_chunk):
    end = min(start + pages_per_chunk, len(reader.pages))
    writer = PdfWriter()
    for page in reader.pages[start:end]:
        writer.add_page(page)
    with open(f"report_p{start + 1}-{end}.pdf", "wb") as f:
        writer.write(f)

On the 120-page test file it wrote report_p1-50.pdf, report_p51-100.pdf and report_p101-120.pdf. Keeping the page range in the file name means the model's page numbers can be mapped back to the original.

Step 4: summarize each section with a fixed prompt

Use the same prompt for every section, so the summaries have the same shape and can be combined:

This is pages 51-100 of a 120-page annual report.
Summarize it in at most 300 words for a reader deciding whether to read the full section.
- List the main points as bullets, each ending with its page number, like (p. 63).
- Copy every figure exactly as written; do not round or recalculate.
- If something is mentioned but not explained in these pages, say so instead of guessing.

Two details matter. Anthropic's best practices list "Place PDFs before text in your requests" and "Use logical page numbers (from PDF viewer) in prompts". And telling the model which part of the whole it is reading stops it from treating page 51 as the start of the document. If you upload the same PDF repeatedly through the Claude API, Anthropic also suggests enabling prompt caching.

Step 5: combine the section summaries

Paste all the section summaries into one new request and ask for the final summary: "Here are summaries of the three sections of a 120-page report, in order. Write a one-page executive summary. Keep the page references." The combined input is a few thousand tokens instead of hundreds of thousands, so nothing gets dropped.

If you need to answer specific questions about the document rather than summarize it, summarizing is the wrong tool; a search-based setup (retrieval-augmented generation) finds the relevant pages and answers from them.

Step 6: check the summary against the PDF

Pick three or four points from the final summary, especially numbers, names and dates, and open the pages they cite. Errors in long-document summaries tend to be plausible ones: a figure from one year attached to another, or two sections blended together. The page references from Step 4 make this a two-minute check rather than a reread.

Frequently asked questions

Can ChatGPT summarize a 300-page PDF?
It can accept large files, but whether it reads all 300 pages depends on the plan's upload limits and the model's context window, which change over time. A dense page can be 1,500 to 3,000 tokens, so 300 pages can be several hundred thousand tokens. The reliable approach is to split the PDF into sections, summarize each, then combine the section summaries.
Why does the AI say my PDF has no text?
The PDF is probably a scan: each page is a picture of text rather than text. pypdf's documentation notes that text extraction from such pages may come back minimal or empty, and suggests OCR software such as Tesseract. Models that also read pages as images can often still read a scan, but OCR first gives more reliable text.
Is it safe to upload a confidential PDF to an AI chatbot?
Treat it like pasting the text into a chat: it goes to the vendor's servers, is stored for a period, and on consumer plans may be used for training depending on your settings. For contracts, medical records or anything under NDA, use an approved business plan or the API, or a local model.
How do I stop the summary from inventing things?
Ask for page references for every point, tell the model to say when something isn't in the document, and spot-check a few claims against the cited pages. Summaries of long documents are where models are most likely to blend sections or fill gaps, so checking the numbers and names matters most.

Sources