PDF token and cost estimator
Estimate a PDF's tokens and cost on each model whose provider documents PDF input, and check its page and size limits — read in your browser.
What it does
Open a PDF and, for every model in Salyro's catalogue, see:
- whether the provider's page says it takes a PDF, and whether yours fits its page and size limits;
- about how many tokens the PDF is: the text estimated, and the page images at their ceiling;
- what the requests you describe cost, the PDF alone.
The PDF is read in your browser, in a Web Worker, by the same PDF reader as Document to Markdown. Only its page count and the length of its text come back to the page; the text itself never leaves the Worker, and nothing is uploaded.
Try it: a three-page PDF report or a scanned page with no text layer. Both are made up for the examples.
How it counts
Anthropic documents how a PDF is counted. Its PDF support page says "The system converts each page of the document into an image" and "The text from each page is extracted and provided alongside each page's image", and that "the same image-based cost calculations are applied" to those images. So the estimator adds up two parts:
- The text layer, estimated at one token for every four characters. This is the same rule Salyro's own token estimate uses. Claude's tokenizer does not run in the browser, and Anthropic's text extraction may differ from PDF.js's, so this part is an estimate.
- Each page as an image, at most the model's image-token ceiling: 1,568 tokens on the standard tier, 4,784 on the high-resolution tier, from Anthropic's vision page. The PDF page does not say at what resolution a page is rendered, so a page's real image tokens are not known. What is known is that the vision resize holds every image to that ceiling.
Only the images are a bound. The text is an estimate of one token per four characters, which can be far too low — Chinese, Japanese or Korean text, code and dense symbols are where it is most often off — or too high, and the provider extracts text its own way. So the total is an estimate, with the page images at their ceiling, and the real count can be higher or lower. Under "Text token costs", the same page says "Each page typically uses 1,500–3,000 tokens per page depending on content density", and the detail for a model shows that range of typical text tokens for your page count too.
The limits come from the same page: 600 pages a request, or 100 when the model's context window is under 1M tokens; 32 MB for the whole request; and a standard PDF, with no password or encryption. A PDF travels in a request as base64, a third larger than the file, so that is the size checked. The 32 MB is for the whole request, so the prompt and anything else sent with the PDF count too.
OpenAI, Google Gemini and xAI: their pages on PDF input could not be read when this tool was built. Their limits and token counts are shown as unknown, not worked out from a formula remembered from elsewhere.
The cost: the tokens are billed as input. The estimator prices them with Salyro's own cost arithmetic on today's price list, one request at a time, then multiplies by the number of requests. The cost is an estimate as the tokens are, and it covers the PDF alone, not your prompt or the answer.
What it does not know
- The resolution a page is rendered at, and so each page's real image tokens. The ceiling is the most a page can be.
- Claude's exact text count. The provider's token counting endpoint gives the exact figure, and calling it needs a key and a network call, which this page never makes.
- Text in images. A scanned page has no text layer. It is still sent as an image, and nothing here reads the text in it.
- Other providers' rules, as above.
Salyro's own API takes text and images, not PDFs, so these figures describe sending a PDF to the provider directly.
FAQ
Why is the total so much higher than the text?
Every page is also sent as an image, and the image of a page can cost more tokens than its text. The estimator counts each page at its ceiling because the rendering resolution is not documented, so the image part is likely lower than shown. The text part is only estimated and can be higher. The provider's token counting gives the exact figure.
Why does a scanned PDF still cost tokens?
Its pages have no text layer, so the text part is small or zero, but each page is still converted into an image and priced as one.
Is my PDF uploaded?
No. It is read in a Web Worker in this page, with nothing to fetch. A shared link holds the number of requests and the model chosen, never the PDF or anything read from it.
Sources
Anthropic, PDF support — how a PDF is counted and its limits — and Vision, for the image-token ceilings. Context windows are from the providers' model pages, as recorded in the site's reference data. Prices are from Salyro's price list. PDF text: PDF.js.
Where the numbers come from
- Model and pricing data is a snapshot of the catalogue Salyro itself uses, taken when this site was built.
- Facts about models and providers that are not in that catalogue carry their own source and the date they were checked, and are shown as unknown where no reliable source exists.
