Guide · Tokens & costs
How many tokens is an image? Claude, GPT and Gemini
An image has no fixed token count: each provider turns pixels into tokens with its own rule. Claude charges one token per 28 × 28-pixel patch (up to 4,784 per image on current models), OpenAI counts 32-pixel patches times a model multiplier, and Gemini 3 gives each image a fixed budget of 1,120 tokens by default. A 1920 × 1080 screenshot costs 2,691 tokens on current Claude models.
By Tahir NazirUpdated 11 min read
On this page
- How many tokens is an image?
- How does Claude count image tokens?
- How does OpenAI count image tokens? (detail low, high and auto)
- How does Gemini count image tokens?
- Worked examples: a screenshot, a phone photo and a 4K image
- How much does an image cost?
- How many tokens does pasting an image into Claude Code use?
- How to use fewer image tokens
- Questions people ask
How many tokens is an image?
It depends on the provider, the model and the image’s size. Vision models don’t read files: they cut the image into small squares (patches or tiles), and each square becomes one or more tokens of input. The same 1920 × 1080 screenshot ranges from 173 to 2,691 tokens:
One 1,920 × 1,080 screenshot · input tokens
- Claude · High-resolution tier (4.7 and later)2,691⌈1920 / 28⌉ × ⌈1080 / 28⌉ = 69 × 39, not resized
- Claude · Standard tier (older models)1,560Shrunk to 1456 × 819 to fit 1,568 tokens
- OpenAI · GPT-5.5, detail auto2,44860 × 34 patches of 32 px, × 1.2
- OpenAI · GPT-4o, detail high1,105Scaled to 1365 × 768: 85 + 6 tiles × 170
- OpenAI · GPT-5.6, detail low173Fitted to 512 × 288 first
- Gemini · Gemini 3, default resolution1,120A fixed budget per image, whatever its size
Two things follow for every provider. Image tokens are billed at the model’s ordinary input price, so a pricier model makes every image pricier. And an image stays in the conversation: on a chat or agent that resends history, you pay for it again on each later turn (at the cached rate if prompt caching applies).
How does Claude count image tokens?
Claude sees an image as 28 × 28-pixel patches, one token each. Anthropic’s formula is ⌈width / 28⌉ × ⌈height / 28⌉ visual tokens, where ⌈ ⌉ means round up. The older “width × height ÷ 750” estimate you’ll find in many posts is no longer what the docs say. Each model also caps the size, by long edge and by tokens:
| Tier | Models | Max long edge | Max tokens per image |
|---|---|---|---|
| High-resolution | Claude 4.7 and later | 2,576 px | 4,784 |
| Standard | All other Claude models | 1,568 px | 1,568 |
From Anthropic’s vision docs, 2026-10-16. High resolution is automatic on those models: no beta header or opt-in.
A bigger image is shrunk, keeping its shape, to the largest size that fits both limits, and the token limit is usually the one that bites. That’s why a 1920 × 1080 screenshot on a standard-tier model becomes 1456 × 819 (1,560 tokens), not 1568 × 882. A small 200 × 200 image costs 64 tokens and a 1000 × 1000 image 1,296 on either tier. Anthropic says high-resolution models can use up to roughly three times the tokens for the same image, and suggests downsampling when you don’t need the extra detail.
Limits worth knowing: JPEG, PNG, GIF (first frame only) and WebP; up to 8000 × 8000 px and 10 MB per image on the API; up to 600 images per request (100 on 200K-context models), and above 20 images each must be at most 2000 px a side. The whole request must still fit the 32 MB request limit.
How does OpenAI count image tokens? (detail low, high and auto)
OpenAI uses two methods, depending on the model. Current models (GPT-5.2 and later, GPT-6 Astra, GPT-4.1 mini) cover the image in 32 × 32-pixel patches, then multiply the patch count by a per-model factor: 1.2 for the GPT-5.x and GPT-6 models, 1.62 for GPT-4.1 mini. Before counting, the image is fitted to the detail level’s pixel limit and, where one applies, shrunk to a patch budget:
| Model | `detail: low` | `detail: high` | `auto` (the default) |
|---|---|---|---|
| GPT-6 Astra, GPT-5.6 | Fits 512 × 512 | 2,500 patches | Same as original: full size, rejected above 30,000 patches |
| GPT-5.5 | Fits 512 × 512 | 2,500 patches, 2048 px | Same as original: 10,000 patches, 6000 px |
| GPT-5.4, mini, nano | 2048 px, 6,144 patches | 2,500 patches, 2048 px | Same as high |
| GPT-5.2, GPT-4.1 mini | 2048 px, 6,144 patches | Same | Same |
From OpenAI’s images and vision guide, 2026-10-16. On GPT-5.4, `low` can cost more than `high`, as OpenAI warns.
OpenAI’s own example for GPT-6 Astra at detail: high: a 1024 × 1024 image is 32 × 32 = 1,024 patches, × 1.2 = 1,229 tokens; a 2048 × 2048 image is shrunk to 1600 × 1600 to fit 2,500 patches, so 3,000 tokens.
Older models use tiles instead. GPT-4o and GPT-4.1 charge 85 base tokens plus 170 per 512-pixel tile (GPT-5.1: 70 plus 140). At detail: high the image is fitted into 2048 × 2048, its shortest side is scaled to 768 px, and the 512 px tiles that cover it are counted, so a 1024 × 1024 image is 4 tiles: 765 tokens. At detail: low every image costs just the base. One oddity: GPT-4o mini charges 2,833 base and 5,667 per tile, about 33 times as many tokens, which offsets its low per-token price.
How does Gemini count image tokens?
Gemini 3 models give each image a token budget chosen by the media_resolution setting, not a count that grows with pixels. Google lists the image figures as approximate maximums:
| Setting | Tokens per image |
|---|---|
unspecified (default) | 1,120 |
low | 280 |
medium | 560 |
high (Google’s recommendation for images) | 1,120 |
ultra_high (per image only, e.g. computer use) | 2,240 |
From Google’s media resolution docs, 2026-10-16. On Gemini 3 you can set a different resolution on each image in one request.
Google’s image and token pages also still give an older rule: 258 tokens for an image of at most 384 pixels on both sides, otherwise 258 tokens per tile, with the tile size “roughly” the shorter side ÷ 1.5. Their example, 960 × 540, works out to 3 × 2 = 6 tiles, which is 1,548 tokens. The pages don’t say which models still use it, and Google says the default count “varies significantly between Gemini 3 and earlier Gemini models”, so on older models check with count_tokens or the usage field of a real response.
Worked examples: a screenshot, a phone photo and a 4K image
Here are four common sizes, each counted with the documented rules. Claude and OpenAI shrink large images before counting, so the bigger sizes stop growing once they hit a cap:
| Image | Claude 4.7+ | Older Claude | GPT-5.5 (auto) | GPT-5.4 mini (auto) | GPT-4o (high) | Gemini 3 (default) |
|---|---|---|---|---|---|---|
| Full HD screenshot, 1920 × 1080 | 2,691 | 1,560 | 2,448 | 2,448 | 1,105 | 1,120 |
| MacBook Retina screenshot, 2880 × 1800 | 4,698 | 1,550 | 6,156 | 2,949 | 1,105 | 1,120 |
| 12 MP phone photo, 4032 × 3024 | 4,740 | 1,564 | 11,868 | 2,942 | 765 | 1,120 |
| 4K image, 3840 × 2160 | 4,784 | 1,560 | 9,792 | 2,765 | 1,105 | 1,120 |
Computed from each provider’s published rules (2026-10-16). Gemini’s figure is Google’s approximate maximum per image.
The phone photo shows why the rules matter. On GPT-5.5, auto means original, which keeps up to 10,000 patches: the photo is shrunk only to 3669 × 2752 and costs 11,868 tokens. GPT-5.4 mini’s auto means high, so the same photo becomes 1824 × 1368 and 2,942 tokens. On Claude 4.7 and later it costs 4,740, just under the 4,784 cap. Setting detail: "high" on GPT-5.5 caps it at 2,500 patches, so at most 3,000 tokens.
How much does an image cost?
Multiply the image’s tokens by the model’s input price. Anthropic’s own example: on a model at $4 per million input tokens, a 1000 × 1000 image (1,296 tokens) is about $5.18 per thousand images. With today’s prices from our data:
| Model | Rule | Input price | Full HD screenshot | 12 MP phone photo |
|---|---|---|---|---|
| Claude Sonnet 5.5 | Claude high-resolution tier | $2/M | $5.38 | $9.48 |
| Claude Haiku 4.5 | Claude standard tier | $1/M | $1.56 | $1.56 |
| GPT-5.5 | Patches, detail auto (original) | $5/M | $12.24 | $59.34 |
| GPT-5.4 Mini | Patches, detail auto (high) | $0.75/M | $1.84 | $2.21 |
| Gemini 3.8 Flash | Gemini 3 default (up to) | $0.825/M | $0.92 | $0.92 |
Images only: the prompt text and the model’s reply cost extra. Batch processing and cached input are cheaper; see each provider’s pricing.
For a whole workload, such as captioning 50,000 product photos, count one image’s tokens with the rule above, add your prompt and expected reply, and put the totals into the LLM cost calculator. Our guide to estimating LLM API costs walks through the method.
Free toolLLM API cost calculatorEnter the image tokens per request plus your prompt and reply sizes to compare the monthly cost across models.How many tokens does pasting an image into Claude Code use?
Claude Code’s docs don’t give a figure, but the image goes to the model like any other image input, so the Claude rule is the best estimate. On a current model (Claude 4.7 or later) a 1920 × 1080 screenshot is about 2,691 tokens, and a full-screen MacBook Retina screenshot (2880 × 1800) is shrunk to 2420 × 1512, about 4,698 tokens. No image costs more than 4,784.
You can drag an image into the prompt, paste it with Ctrl+V (Alt+V on Windows, Cmd+V in iTerm2), or give Claude a file path; a pasted image shows as an [Image #N] chip. The image then sits in the conversation and is resent with every later request, so a few full-screen screenshots in a long session add up. Crop to the part that matters, run /context to see what fills the window, and see how to reduce Claude Code token usage for the wider picture.
How to use fewer image tokens
- Resize before sending. It is the only way to know exactly what the model sees, and on Claude it also keeps returned coordinates aligned with your image. Shrinking a screenshot to 1456 × 819 brings it to about 1,560 tokens on any Claude model.
- Crop. Send the error dialog, not the whole desktop. Fewer pixels means fewer patches on Claude and OpenAI.
- Pick the detail level on purpose. OpenAI’s
lowfits most images into 512 × 512; Gemini’slowis 280 tokens. Keephighororiginalfor text-heavy images, small objects and computer use. - Don’t resend old images. In your own app, drop images from the history once they’ve been answered, or replace them with the model’s description.
- Mind tiny text. Downsizing a dense screenshot can make text unreadable; Anthropic also warns that heavy JPEG compression hurts legibility. Test the smallest size that still gives correct answers.
A minimal resize with Pillow:
from PIL import Image
# Fit within 1456 x 819 before sending: about 1,560 tokens on any Claude
# model, instead of 2,691 for a full 1920 x 1080 screenshot on current ones.
img = Image.open("screenshot.png")
img.thumbnail((1456, 819)) # keeps the aspect ratio, never enlarges
img.save("screenshot-small.png")To check a count before you pay, Anthropic’s free token-counting endpoint accepts images (as base64 only) and returns an estimate; Gemini’s count_tokens takes image parts too. The token counter and context window checker handle the text side of the prompt.
import base64
import anthropic
client = anthropic.Anthropic() # reads ANTHROPIC_API_KEY
with open("screenshot.png", "rb") as f:
data = base64.standard_b64encode(f.read()).decode()
count = client.messages.count_tokens(
model="claude-sonnet-5-5",
messages=[{
"role": "user",
"content": [
{"type": "image", "source": {"type": "base64", "media_type": "image/png", "data": data}},
{"type": "text", "text": "What does this error say?"},
],
}],
)
print(count.input_tokens) # an estimate: image + textFAQ
Questions people ask
How many tokens is a 1024 × 1024 image?
On Claude, 37 × 37 patches = 1,369 tokens, on any current or older model, since it fits both tiers. On GPT-4o at high detail it is 4 tiles: 765 tokens. On GPT-5.5 or GPT-6 Astra it is 1,024 patches × 1.2 = 1,229 tokens. On Gemini 3 it is about 1,120 tokens at the default resolution, whatever its size.
Do images count against the context window?
Yes. Image tokens are input tokens, so they take up space in the model’s context window like text does, and in a chat they stay there for the rest of the conversation. Many screenshots in one long session can fill the window, and the request can also hit size limits such as Anthropic’s 32 MB per request.
Is an image cheaper than describing it in text?
Usually not. A paragraph describing a screenshot is around 100 to 200 tokens, while the screenshot itself is 1,000 to 4,800 tokens on most current models. Send the image when the model needs to see layout, charts or text you can’t easily copy; paste text, such as an error message, as text.
What is the image detail parameter in the OpenAI API?
detail tells OpenAI how to resize an image before counting it: low, high, original (newer models only) or auto, which is the default. What each does depends on the model: on GPT-5.5 and GPT-5.6 auto keeps the original size, while on GPT-5.4 it means high. Set it explicitly if cost matters.
How do I count image tokens before sending a request?
For Claude, compute ⌈width/28⌉ × ⌈height/28⌉ after resizing to the tier’s limits, or call the free token-counting endpoint with the image as base64. For OpenAI, apply the patch or tile rule for your model and detail level; OpenAI also has an image cost calculator. For Gemini 3, the media resolution table gives the budget.
Why did my image cost more tokens on a newer Claude model?
Claude 4.7 and later models support high resolution: images keep up to 2576 px on the long edge and 4,784 tokens, instead of 1568 px and 1,568 tokens. Anthropic says that can mean roughly three times the tokens for the same image. Resize the image yourself if you don’t need the extra detail.
Try it
Tools from this guide
- LLM API Cost CalculatorEstimate per-request, daily and monthly API costs.
- AI Token CounterCount tokens for GPT, Claude, Gemini, DeepSeek, Qwen and more.
- Context Window CheckerSee whether your text fits each model’s context window.
- AI Model ComparisonCompare prices, context windows and features across models.
Keep reading