Research-backed calculator guide
Claude PDF Cost: Direct Document Blocks vs Extracted Text
Compare Claude PDF token cost with extracted text, OCR, and selected page images using a reproducible input, output, and fidelity worksheet.
Quick answer
For Claude API workloads, a direct PDF document block can cost more input tokens than the same document sent as clean extracted text because Claude processes a PDF as both extracted text and page images. Anthropic’s documentation says a PDF page typically uses 1,500–3,000 text tokens, with image-token pricing applied because each page is converted into an image; it also says there is no separate PDF fee.[1] The right comparison is therefore not “PDF versus text” by file size. It is the total cost of the same task, including extraction or OCR, input tokens, output tokens, retries, and any cache operations.
If the answer depends on prose or a clean text table, extract the text and measure it. If the answer depends on a chart, scan, handwriting, color, or layout, keep the relevant pages visual. Do not assume extraction is successful merely because a converter exits without an error. A cheaper text path that drops a chart or returns an empty OCR result has failed the workload even if its token count is low.
This guide gives you a Claude PDF token cost worksheet, a worked estimate, and a fidelity gate. The numbers in the example are planning assumptions, not a quote for your file. For a file-specific result, call Anthropic’s messages/count_tokens endpoint with a base64 PDF and the exact text alternative. Anthropic notes that the endpoint returns an estimate, that URL and file document sources are not accepted there, and that PDF counting requires base64 input.[2]
What Claude charges for a direct PDF
A direct PDF request is a document block in a Messages API request. Anthropic supports URL, base64, and Files API sources for sending PDFs. Its processing description says the system converts each page into an image, extracts the page text, and provides the combination to Claude so it can answer questions about text and visual elements such as charts and diagrams.[1]
That mechanism creates two input components:
- Extracted text tokens. The vendor’s current guidance is typically 1,500–3,000 text tokens per page, depending on density.
- Image tokens. The page image is priced using the image-based calculations for the model and image dimensions. This is not a fixed “PDF surcharge,” so a sparse page, dense page, scan, and high-resolution page can behave differently.
The API then adds your question, system prompt, tools, and any other request content. Output tokens are priced separately. If you retry because the page was split incorrectly, the retry is another billable request. If you repeatedly send the same document, prompt caching may change the economics rather than eliminating the initial processing cost.
For current rates, Anthropic’s pricing page lists prices in USD per million tokens (MTok). On the page checked on November 2, 2026, Claude Sonnet 5 is listed at $2/MTok for base input and $10/MTok for output; other models have different rates, and the pricing page also lists cache and batch modifiers.[3] Use the model and platform that your account actually calls. Do not copy a rate from a different model, region, or cloud marketplace into a reconciliation.
Direct PDF versus extracted text: the cost model
Use this formula for one uncached request:
total cost = (input tokens ÷ 1,000,000 × input $/MTok) + (output tokens ÷ 1,000,000 × output $/MTok) + extraction/OCR cost + retry cost
For a direct PDF, define input tokens as:
PDF input = text tokens + page-image tokens + prompt/system/tool tokens
For an extracted-text path, define input tokens as:
text input = extracted text tokens + prompt/system/tool tokens
The fixed prompt matters when the document is short. For a long report, the document representation usually dominates. The extraction cost matters when you pay for a parser, OCR service, human cleanup, or a second model. If extraction is a local command with no paid API, its monetary line can be $0 while its engineering and latency costs remain real. Keep those dimensions visible rather than hiding them inside a “savings” percentage.
A practical measurement sequence
- Freeze the model, system prompt, user question, temperature or equivalent settings, output limit, and tool definitions.
- Keep the source PDF and question set constant. Record page count, file type, whether a text layer exists, and whether charts or layout carry meaning.
- Send the same workload as a direct base64 PDF and record the API’s actual usage.
- Extract to text or Markdown, run a character-per-page and spot-check test, then count the alternative with the same prompt.
- For scanned pages, measure OCR output separately. Do not mix OCR errors into a “text extraction” result.
- Run a fidelity check: required fields, table rows, chart conclusions, page references, and a small human-reviewed sample must pass before cost is compared.
The AI token cost calculator is useful for the arithmetic once you have measured input and output tokens. Use the Model pricing comparison when the same workload may move between Claude models. If your estimate must be matched to an invoice, use the AI API invoice reconciliation calculator and preserve the request IDs or usage export behind each row.
Worked cost example
Assume a 10-page, born-digital report and one question per run. The output target is 800 tokens. We will compare four representations. The text and image values are estimates chosen for a transparent planning example; they are not Anthropic measurements for a particular PDF.
| Path | Input assumptions | Input tokens | Output tokens | Sonnet 5 input cost at $2/MTok | Output cost at $10/MTok | Estimated request cost |
|---|---|---|---|---|---|---|
| Direct PDF block | 10 pages × 2,250 text tokens plus 10 × 1,500 planning image tokens | 37,500 | 800 | $0.0750 | $0.0080 | $0.0830 |
| Extracted Markdown | Same report represented as 12,000 clean text tokens | 12,000 | 800 | $0.0240 | $0.0080 | $0.0320 |
| OCR text | 10 pages represented as 15,000 OCR tokens after a paid or local OCR step | 15,000 | 800 | $0.0300 | $0.0080 | $0.0380 |
| Selected page images | Three visual pages × 1,500 planning image tokens plus 1,000 text tokens | 5,500 | 800 | $0.0110 | $0.0080 | $0.0190 |
The direct PDF estimate is 37,500 input tokens because it includes two planning components: 22,500 text tokens and 15,000 image tokens. At $2 per million input tokens, that is $0.075. The 800-token answer adds $0.008 at $10 per million output tokens, for $0.083 per request. The extracted-text version is $0.032 before any separate extraction charge. Under these assumptions, extraction reduces the model request by $0.051, or about 61.4%.
That percentage is not a universal Claude PDF versus text input ratio. Change the page density, image dimensions, model, output length, prompt, or extraction quality and the answer changes. The selected-image row can be cheaper still, but it is valid only if three pages contain all of the visual evidence needed by the question. Sending only the first three pages of a report is not an optimization if the missing page contains the qualifying footnote.
Suppose the report will be queried 20 times with no caching. The same assumptions produce $1.66 for direct PDF and $0.64 for extracted Markdown before extraction labor or service fees. If the document is cached, add the cache-write and cache-read prices for the chosen model and count the actual cache behavior. Anthropic describes prompt caching as reusing a prompt prefix, including a document, at a fraction of the standard input price; the exact multiplier is model- and duration-dependent.[3] Do not apply the ordinary input rate to every repeated request if your implementation actually uses cache controls, and do not assume a cache hit if the prefix or cache window changes.
The fidelity gate: when cheaper is not cheaper
Text extraction is a representation change, not a guarantee of equivalence. A born-digital PDF with paragraphs and simple tables often converts cleanly. A scanned contract may have no usable text layer. A multi-column paper can interleave columns. A chart can reduce to axis labels while losing the visual trend. A table can preserve words but scramble row and column relationships.
Before accepting the cheaper path, test the information the answer actually needs:
- Text yield: Record extracted characters per page. An empty or near-empty result on a scan should route to OCR or visual review, not silently proceed.
- Structure: Compare headings, list boundaries, table columns, footnotes, and page references against the source.
- Visual evidence: Ask whether the task requires a chart slope, color, signature, stamp, diagram, handwriting, or spatial relationship. If yes, retain the page image or send a selected image block.
- Answer agreement: Run a fixed question set and compare required facts, not just cosine similarity or response length.
- Exception rate: Count pages that need manual repair, OCR, a second parser, or visual fallback. Put that work into the total cost.
This is why an OCR path can be more expensive than clean extraction even when its final text token count is similar. OCR adds processing cost and may require human review. Conversely, OCR can be the only valid route for a scan. The goal is the lowest cost per accepted answer, not the lowest input-token number.
When to use each representation
Use direct PDF blocks when the document’s visual content is part of the question, when page-level citations or layout relationships matter, or when implementation speed is worth the extra input. Keep page count and request limits in mind; Anthropic documents a 128 MB first-party API request limit and a maximum of 600 pages per request, with limits varying by context window and platform.[1]
Use extracted text or Markdown when the document is mostly prose, the text layer is healthy, and the questions are about wording, definitions, or text-native tables. Convert once and reuse the clean representation for repeated questions. A one-time local extraction step can have no API fee, but measure engineering time and storage if you are building a production pipeline.
Use OCR text when the source is scanned and the words matter more than the page design. Add a yield check and a sample review. OCR is not the same as native text extraction, and a successful process exit does not prove that the output is useful.
Use selected page images when only a few pages contain charts, diagrams, signatures, or layout-dependent evidence. Pair them with extracted text for the rest of the document if the API request and your parser support that hybrid. The hybrid design is often a better experiment than arguing about whether every page should be visual.
How to make your own Claude PDF cost benchmark
Create a small benchmark record for each document family. Include document hash, pages, representation, extraction tool and version, OCR setting, model ID, prompt hash, question-set ID, input tokens, output tokens, retries, cache-write tokens, cache-read tokens, processing time, and fidelity score. Store the raw API usage next to the derived cost rather than overwriting it with a rounded dollar figure.
For direct PDF and text alternatives, Anthropic’s token-counting endpoint can estimate input tokens before you send the request. The count may differ slightly from actual usage, and Anthropic says system-added optimization tokens are not billed even though they may appear in counts.[2] Treat the endpoint as a preflight estimate, then reconcile the actual usage object from the Messages API response. If the document source is a URL or Files API reference, follow the endpoint’s documented limitation and use an actual request or another supported base64 test for the preflight.
Finally, recalculate when the model changes. Anthropic documents that Claude 4.7 and later models and Claude Mythos Preview use a newer tokenizer that produces approximately 30% more tokens for the same text, with the exact increase dependent on content and workload shape.[2] A benchmark captured on one tokenizer is not a permanent property of the PDF.
Run your scenario
Turn this framework into an editable estimate.
Use dated, source-linked assumptions and see cost per request, successful task and month.
FAQ
Does Claude charge a separate fee for PDF files?
No separate PDF fee is listed in Anthropic’s PDF-support guidance. The cost comes from the input representation: extracted text plus page-image processing, priced using standard token and image rules for the API.[1] Your final bill can still differ across models, cloud platforms, regions, cache modes, and batch settings, so use the pricing page for the route you actually call.
Is extracted text always cheaper than a direct PDF?
It is often cheaper for a text-led document, but not always cheaper for the whole workflow. Add extraction or OCR processing, repair time, retries, and the cost of answers that fail because a chart or table was lost. If visual evidence is required, a direct PDF or a hybrid request may have a lower cost per accepted answer even with more input tokens.
How can I measure Claude PDF token usage before sending it?
Use the messages/count_tokens endpoint with the exact model, prompt, and a base64-encoded PDF. Run the same preflight on the extracted text alternative. Anthropic says the result is an estimate, that URL and file document sources are unsupported for that endpoint, and that actual billing is represented by the request’s usage data.[2]
What is the cheapest way to ask Claude about a scanned PDF?
First determine whether the scan has a usable text layer. If it does not, native extraction may return little or nothing. OCR the pages if the question is text-led, then apply a yield and accuracy check. If the answer depends on handwriting, stamps, layout, or image content, keep the relevant page visual. The cheapest valid path is the one that passes the fidelity gate.
Does prompt caching remove direct PDF image-token cost?
Caching changes the price of repeated prompt prefixes; it does not turn a visual PDF into text or make the first cache write free. Anthropic documents separate cache-write and cache-read multipliers, which vary by model and cache duration.[3] Benchmark the first request, the cache hit, and the cache expiry separately.
Limitations and assumptions
This article’s worked numbers are estimates for a 10-page example, not vendor quotes or a promise about any specific file. The planning assumption of 1,500 image tokens per page is intentionally visible so you can replace it with a count from your model and document. The example excludes local compute, paid OCR, storage, tax, cloud-provider markups, network transfer, human review, and failed-answer business impact. It also assumes one 800-token output and no tools or long system prompt. Your production worksheet should add those fields and use actual API usage for reconciliation.
Primary sources checked
Pricing and product behavior can change. These sources support the time-sensitive claims in this guide; verify current provider terms before committing spend.