TokenSave Data · Dataset
How many tokens is a PDF page? Claude vs Gemini vs Codex vs Cursor
One page of text costs 2,347 tokens as a PDF on Claude 5.5 but 728 when the same text is pasted (+222%). Gemini charges a flat 560 tokens per PDF page whatever is on it, so the same page costs 76% less there.
Measured 2026-10-18 · text, table and scanned pages · 1 to 10 pages · License CC BY 4.0 · Related: image token cost
DOI 10.5281/zenodo.23446565 · Also on Hugging Face · Kaggle · GitHub
Count the tokens in your own text → Paste your prompt and see tokens, characters and API cost on GPT, Claude and Gemini. Free and private: it runs in your browser.
Key findings
- Claude reads every PDF page twice: as text and as an image. A text page costs 2,347 tokens on Claude 5.5. A scanned page with no text layer costs 1,600, which is the image part alone; the rest is the extracted text.
- Pasting text is much cheaper on Claude. The same page pasted as text costs 728 tokens on Claude 5.5, 69% less than the PDF. If you only need the words, copy them out.
- Gemini charges a flat rate per page. Text, table and scanned pages all cost 561 tokens, and 10 pages cost 5,601, so about 560 per page.
- On Gemini a PDF can beat pasting. Our table page costs 561 tokens as a PDF but 777 pasted as CSV (28% less as a PDF). For dense pages Gemini's flat rate is cheaper than the text itself.
- Cost grows in a straight line with pages. 10 text pages cost 23,236 tokens on Claude 5.5 (about 2,324 per page) and 20,979 on Claude Haiku 4.5.
- Coding agents spend more on working out how to open a PDF than on the PDF itself. Asked to summarize a one-page PDF from disk, Codex used 92,668 input tokens and Cursor 76,220, against 29,921 and 26,600 for the same text as a .txt file (+210% and +187%). Ten pages cost about the same as one.
- Scanned PDFs broke both agents. Codex used 215,837 tokens on average and then said it could not read the page. Cursor answered both times with a summary of content that is not in the file.
All inputs
Input tokens. GPT is shown for pasted text only (see method).
| Input | Claude Opus/Sonnet 5.5 | Claude Haiku 4.5 | Gemini 3.x | GPT o200k |
|---|---|---|---|---|
| PDF, text, 1 page | 2,347 | 2,115 | 561 | – |
| PDF, text, 5 pages | 11,631 | 10,499 | 2,801 | – |
| PDF, text, 10 pages | 23,236 | 20,979 | 5,601 | – |
| PDF, table, 1 page | 2,481 | 2,278 | 561 | – |
| PDF, scanned image, 1 page | 1,600 | 1,592 | 561 | – |
| Same page pasted as text | 728 | 503 | 455 | 461 |
| Same table pasted as CSV text | 913 | 720 | 777 | 629 |
Coding agents: Codex and Cursor
Same files, read from disk by a coding agent with the prompt “Read the file … and summarize its full contents in one sentence.” Each file sat alone in an empty folder; two runs per file. Numbers are total input tokens for the whole agent session, including cached tokens and the agent’s own instructions, so they are not comparable with the Claude and Gemini counts above. With no file at all the same setup used 15,070 (Codex) and 13,022 (Cursor) tokens.
| File | Codex (gpt-6-luna) | Cursor (free, Auto) |
|---|---|---|
| Same page as a .txt file | 29,921 | 26,600 |
| PDF, text, 1 page | 92,668 | 76,220 |
| PDF, text, 5 pages | 74,710 | 78,624 |
| PDF, text, 10 pages | 114,776 | 81,750 |
| Same table as a .csv file | 30,105 (1 of 2 runs failed) | 28,560 |
| PDF, table, 1 page | 85,710 | 76,704 |
| PDF, scanned image, 1 page | 215,837 (failed) | 84,940 (wrong answer) |
- How they read PDFs: neither agent looked at the pages as images. Codex loaded a PDF skill, tried Python libraries that were not installed, then extracted the text with
pdftotext. Cursor read a PDF skill file and then used its built-in file reader, which returns the text layer. - Codex varies a lot between runs. The same 10-page PDF took 49,273 tokens once and 180,278 the next time, depending on how many tools it tried first. Cursor’s two runs were within 2% of each other on every text and table PDF.
- The scanned page has no text layer. Codex could not find an OCR tool and said so. Cursor’s file reader returned an empty page, its shell commands were not approved in print mode, and it still answered with invented text (once a “handwritten note”, once a sentence about a crow); the page is the same garden text as the other files.
Method
- A4 PDFs made with ReportLab: one page of English prose (about 420 words), the same page repeated to 5 and 10 pages, a page with a 35-row table, and a scanned version of the text page (rendered at 150 dpi and placed as an image with no text layer).
- Claude: each PDF sent through Claude Code (
claude -p, stream-json input) as a document block with a one-character message; input tokens minus the same run without the PDF. Opus 5.5 and Sonnet 5.5 gave identical counts. - Gemini: per-file token count shown by Google AI Studio for Gemini 3.8 Flash after uploading each PDF. Pasted text was measured with the prompt counter minus its one start token.
- GPT: OpenAI bills PDF input as extracted text plus an image of each page, which we could not reproduce without the API, so GPT appears only for pasted text (tiktoken,
o200k_base). - Codex: Codex CLI 0.162 on Windows, ChatGPT plan login, model gpt-6-luna at low reasoning effort,
codex exec --json -s read-only; input tokens from the final usage report. - Cursor: Cursor Agent CLI on Windows, free Hobby plan, model Auto,
cursor-agent -p --output-format stream-jsonwith default permissions; input plus cache-read tokens from the result event.
Limitations
- One page design. Pages with more text, small fonts or many images will cost more on Claude; Gemini's per-page rate should stay flat.
- Default settings; Gemini's media resolution option changes its per-page count.
- Input tokens only; the price per token differs by model.
- Codex and Cursor: two runs per file on one machine with the tools that happened to be installed; an agent with an OCR tool or shell access would behave differently.
How to cite
Free to use, quote and republish with attribution under CC BY 4.0. Please link to this page.
TokenSave (2026). PDF token cost per page: Claude vs Gemini, and PDF vs pasted text [Data set]. Zenodo. https://doi.org/10.5281/zenodo.23446565
BibTeX
@misc{tokensave_pdf_token_cost_2026,
author = {{TokenSave}},
title = {PDF token cost per page: Claude vs Gemini, and PDF vs pasted text},
year = {2026},
publisher = {Zenodo},
doi = {10.5281/zenodo.23446565},
url = {https://doi.org/10.5281/zenodo.23446565},
note = {Dataset, CC BY 4.0}
}
Embed the chart
Related
Questions or corrections: contact@jonhisking.com