miinideckmiinideck
PricingUse casesBlog
Sign in
How-to & formats

How many tokens does an image (or a PDF) cost an LLM? (2026)

There is no single number — it depends on the model, the image size, and whether you send a PDF as text or pixels. The per-model formulas, real measured costs, and how to count it for your own model.

By miinideck·June 2, 2026·Updated September 7, 2026·5 min read
TL;DR
  • There is no single token count for an image or a PDF — it depends on the model, the pixel dimensions, and, for PDFs, whether you send extracted text or raw pages. Anyone quoting one number is rounding off three variables.
  • A standard 1024x1024 web image lands close across the big models — roughly 1,000–1,400 tokens (≈1,024 on GPT-5.5, ≈1,032 on Gemini 3.1 Pro, ≈1,398 on Claude Opus 4.7) — but a large photo can spread from ~2,500 to ~6,600 tokens depending on the formula.
  • A PDF is the expensive way to send text: in one measured run, a 2MB PDF cost ~770,000 tokens dumped as raw base64 and ~97,000 as extracted text — versus a few hundred for the same words as clean text.
  • The reason is that the formulas differ — OpenAI counts pixel patches, Claude uses area ÷ 750, Gemini uses 768px tiles — and a PDF can make you pay for the page image and the extracted text.
  • The reliable move is not memorizing a number; it is counting your own with the provider's token tool before you send a batch.

You paste one PDF into the chat for a quick summary, and the context window is suddenly two-thirds full. The document was not even that long. What happened is that the format you sent it in decided the token bill before the model read a word — and for images and PDFs, that bill is bigger and less predictable than for plain text.

Here is the honest version of "how many tokens is an image," because the clean single-number answers floating around are all quietly wrong.

Why there is no single number

Three variables move the count, and any answer that ignores them is rounding:

  • The model. Each provider tokenizes images with a different formula. The same picture costs different amounts on GPT, Claude, and Gemini.
  • The size. Image cost scales with pixels, so a thumbnail and a full-resolution photo are nowhere near each other.
  • The format path. A PDF can reach the model as extracted text, as page images, or as raw base64 — three very different bills for the same file.

So "how many tokens is an image" has the same shape of answer as "how long is a piece of string." But the formulas are public, so you can pin down a real range instead of a myth.

What an image costs, per model

For 2026's flagship models, a plain 1024×1024 web image lands in a fairly tight band:

  • GPT-5.5 — ~1,024 tokens. OpenAI counts images in 32×32-pixel patches, capped around 2,500 patches (or a 2,048px maximum dimension in high-detail mode).
  • Gemini 3.1 Pro — ~1,032 tokens. Images with both sides ≤384px are a flat 258 tokens; larger images are cut into 768×768 tiles at 258 tokens each.
  • Claude Opus 4.7 — ~1,398 tokens. Claude approximates tokens as (width × height) ÷ 750, resizing so the long edge caps at 2,576px.

That is roughly a 1.4× spread on a standard image. Push to a large phone photo and it widens to about 2,500–6,600 tokens depending on the model, because the formulas scale differently with size. The takeaway: an image is rarely "a few hundred tokens." It is usually one to several thousand.

Why a PDF is the expensive way to send text

A PDF is the format most likely to blow up a token budget, because "send the PDF" can mean three different things — and the numbers are far apart. In one engineer's measured run on a 2MB PDF:

  • Raw base64 — ~770,000 tokens. Dumping the file's bytes. The worst path, and the easiest to trigger by accident.
  • Extracted text — ~97,000 tokens. Pulling the words out first. Far better, but still carrying extraction noise — repeated headers, broken tables.
  • Through an extraction tool — ~8,000 tokens. A roughly 12× reduction over the inline-text path. (Convert a PDF to Markdown in your browser if you want to see what the text looks like before you send it.)

And rendering each page as an image costs the per-image rates above, per page — native PDF support on some models does this and extracts the text, so you pay for both. For comparison, the same content as clean text or Markdown is a tiny fraction of any of these. That gap is the whole reason "feed it Markdown, not PDF" is the token-efficient default.

Counting tokens is the input side; the output the model hands back is usually a page someone needs to open. Drop that HTML at a private link in under 60 seconds — no card, no account, 7-day self-destruct.

Try it free (no signup)

How to count it for your own model

Do not trust a blog's number — including this one — for a production batch. The formulas change every model version, and the cheapest way to be sure is to measure:

  1. Decide the path — text, image, or raw bytes — because each is counted differently.
  2. For text, run it through the provider's tokenizer (tiktoken for OpenAI, the count-tokens endpoint for Claude) for an exact figure.
  3. For an image, apply the model's formula above, or upload it to the provider's token-counting endpoint, which returns the exact count.
  4. For a PDF, extract the text and count that; if you need the page images, count one page and multiply.
  5. Shrink before scale — a resized image or a Markdown conversion can cut the count by an order of magnitude, which compounds across a big run.

The practical takeaway

The numbers move, but the order of magnitude is stable: plain text is cheapest, an image is one to several thousand tokens, and a PDF sent carelessly is the most expensive thing you can put in a context window. So the defaults that save the most tokens are the boring ones — send text or Markdown rather than a raw PDF, extract a PDF before sending it, resize images, and count a sample before you run a batch of a thousand. The model's reasoning budget is finite; every token spent decoding a bloated format is one it cannot spend on the actual problem.

More in How-to & formats

PDF vs Markdown for AI: which saves tokens, which reads cleaner (2026)

Feeding a document to an AI? Markdown almost always costs fewer tokens and parses cleaner than the same content as a PDF. Where each format wins — and why the thing you hand a person at the end is neither.

June 2, 2026·8 min read

How do I edit a password-protected HTML page without re-encrypting it?

Client-side encryption tools turn your page into an encrypted file, so the protection and the artifact are the same object — every edit means re-running the tool and re-uploading. What that actually costs, the salt setting that decides whether your old share links survive, and when a hosted password is the better trade.

September 25, 2026·6 min read

How do I hand off client work that lives in a git repo?

Running the studio out of one folder per client is a good structure for making the work. It stops at the point where the client has to open it — a private repo needs a GitHub account, and Pages built from one is public by default. What the handover step actually needs, and how to add it without breaking the folder.

September 24, 2026·8 min read

Send your own private link.

miinideck turns a single HTML file into an unguessable link with optional password and expiry. Default-private, never indexed.

Try it free →See pricing
miinideck

HTML files, finally as links — for AI builders, agencies, and consultants. Default-noindex, default-private, default-yours.

Product

  • Pricing
  • Use cases
  • Try it free

Resources

  • Blog
  • Free tools
  • Featured on
  • Report abuse

Legal

  • Privacy
  • Terms
Listed onmiinideck listed on Product Huntmiinideck listed on Faziermiinideck listed on TheSaaSDirmiinideck listed on AIToolHuntmiinideck listed on LaunchNest
© 2026 miinideckMade for people who don't want their work indexed.