Why an image costs tokens at all
A language model has no way to read a picture directly. Before it reaches the model, an
image is divided into regions, each region is encoded as a vector, and those vectors enter
the context window in the same slots that text tokens would. That is why images are billed
in tokens: they genuinely occupy context, and they consume the same compute per unit that
words do.
What differs from text is how the count is produced. A sentence goes through a byte-pair
tokenizer, so its token count can be computed exactly by anyone with the vocabulary file.
An image’s count comes from arithmetic on its dimensions — and nothing else. File size is
irrelevant. So is format, colour depth, and how heavily the JPEG was compressed. A 40 KB
screenshot and a 12 MB PNG of identical dimensions cost exactly the same. This is the
single most useful thing to know about image billing, because it means the only lever you
have is resolution.
OpenAI, ChatGPT and Azure OpenAI
OpenAI uses two schemes, and which one applies depends on the model generation rather
than anything you control. The GPT-5.x family counts patches:
the image is cut into a grid of 32×32 squares and each square
costs one token, up to a hard cap of 1,536 patches. A
1,024×1,024 image is 1,024 tokens on
GPT-5.6 Terra — $0.00205 of input, or
$2.05 for a thousand of them.
The cap is what makes the patch scheme forgiving at the top end. A 1080p screenshot and a
4K screenshot both bill 1,536 tokens, because the 4K frame
is scaled down to the patch budget before counting. Sending the larger file buys you
nothing and costs you nothing.
GPT-4o and GPT-4.1 predate patches and use tiles
instead: a base charge of 85 tokens plus 170 per
512px tile after two resize passes. The same square image is
765 tokens there. These are also the only OpenAI models that
read the detail parameter — setting it to low fixes the charge at
85 tokens no matter how large the image, which is a real optimisation
when you only need the gist of a picture. On the GPT-5.x models the parameter is accepted
and ignored, so the counter above greys the control out and says why.
If you call through Azure OpenAI, use the
matching OpenAI row. Azure hosts the same models under the same image accounting, so an
Azure OpenAI image token calculator and an OpenAI one return the same number; only your
contract rate might differ. ChatGPT itself is not billed per token at all on a consumer
plan, but the model behind it counts images exactly as the API does, which is what makes
these figures useful for estimating what a ChatGPT-style feature will cost to build.
Gemini counts tiles, and never stops
Google’s scheme has two branches. An image measuring 384px or less on
both sides is a single flat-rate unit worth 258 tokens. Anything
larger is divided into 768px tiles, each also worth
258 tokens.
The consequence is worth planning around: Gemini
applies no ceiling. Where OpenAI caps at 1,536 patches and
Anthropic caps at roughly 1,534 tokens, Gemini keeps adding tiles
for as long as you keep adding pixels. A 1,024×1,024 image is a
competitive 1,032 tokens; a
3,024×4,032 photo straight off a phone is
6,192, against
1,452 on GPT-5.6 Terra and
1,534 on Claude Sonnet 5. Gemini goes from the
cheapest option to the most expensive one purely because of the resolution you handed it.
The flip side is that Gemini is unbeatable on small images. At
256×256, Gemini 3.7 Flash costs
$0.00019 per image, and the flat rate covers everything
up to 768px on both sides — so a thumbnail pipeline that resizes to
768px or below pays one tile, once.
Claude divides pixels by 750
Anthropic skips grids altogether: tokens are total pixel area divided by
750. Two caps run first — the long edge is brought down to
1,568px, then the total area to about
1,150,000 pixels — and it is the area cap, not the edge cap, that
produces Claude’s effective ceiling of roughly 1,534 tokens per
image.
Because the formula is purely geometric, every Claude tier reports the same count. A
1,024×1,024 image is 1,399 tokens on
Opus, Sonnet and Haiku alike — the models differ only in what a token costs. That makes
tier choice unusually clean for vision work: the same image is
$0.00700 on Claude Opus 5 and
$0.00140 on Claude Haiku 4.5, a five-fold
difference with no change in how much of the picture the model receives.
How to spend less on images
Resize before you send. Since only
dimensions matter, downscaling is the whole optimisation. On the capped schemes anything
above the cap is free to discard — the provider is going to shrink it anyway, and doing it
yourself also saves upload time. On Gemini, where nothing is capped, resizing is the
difference between 6,192 tokens and
1,032.
Match resolution to the task. Reading dense
text in a screenshot needs pixels. Deciding whether a photo shows a cat does not. On GPT-4o
and GPT-4.1, detail: low settles that at a flat
85 tokens; on other models, resizing to
512×512 achieves the same thing.
Count the conversation, not the request. An
image stays in the context window for as long as the thread does, and most chat
implementations resend the whole history on every turn. An image costing
$0.00205 once costs
$0.041 across a twenty-turn conversation, before a
single word of text is counted. Check whether cached input pricing applies to your
prefix — it is typically a fraction of the standard rate.
How accurate these counts are
Image token counts are more reliable than text estimates for models whose tokenizers
are private, because the formulas here are published arithmetic rather than a
reconstruction. Feed OpenAI’s tile scheme a 512×512 image and it
returns 255 tokens, which is the figure in OpenAI’s own
documentation; 1,024×1,024 returns
765, likewise.
Two caveats. Providers change these formulas without much notice, so figures are dated to
when they were last checked against the source documentation. And the token count for the
image is not the whole request — your prompt text, any system message, and the model’s
reply are all billed on top. Use the file
token counter for documents and the main text calculator for prompts; this page covers
the pixels.