How this calculation works
Anthropic tiles an image into 28-pixel patches and charges one input token per patch: ⌈width / 28⌉ × ⌈height / 28⌉, capped at 4,784 tokens for a single image on the high-resolution tier, which is what Claude 4.7 and later reads for images with a long edge of 2,576 px or less. The rule and the tiers are published in Anthropic's vision documentation. On the standard tier the image is downscaled before the same patch arithmetic runs — until its long edge is 1,568 px or less and the grid holds no more than 1,568 patches — which is why Anthropic's published example lands a 1920 × 1080 screenshot at 1456 × 819 and 1,560 tokens.
Nothing here depends on file size, compression, or format. Two screenshots of the same pixel dimensions cost the same number of tokens whether one is 200 KB and the other is 2 MB.
Worked example
A full-screen 1920×1080 capture: ⌈1920 / 28⌉ = 69 columns, ⌈1080 / 28⌉ = 39 rows, so 69 × 39 = 2,691 tokens (calculated). That is under the 4,784 cap, so the cap does not bite. At $10 per million input tokens that image costs about $0.027 to put in front of the agent — once, for one message.
Four full-page screenshots to cover one long page: 4 × 2,691 = 10,764 tokens (calculated), before a single word of explanation. A 30-second screen recording frame-dumped at 1 frame per second is 30 × 2,691 = 80,730 tokens (calculated) — roughly 40% of a 200,000-token context window, about $0.81 at $10 per million input tokens. A complete Walkie bundle covering the same review measures about 3,500 tokens (measured, typical), about $0.04 at $10 per million input tokens.
Assumptions and limitations
- Tier matters. The 4,784 cap and the raw patch count are the high-resolution tier, Claude 4.7 and later. Standard-tier models downscale first, until the long edge is 1,568 px or less and the grid holds no more than 1,568 patches; a 1080p screenshot lands at 1,560 tokens (Anthropic's published example), never more than 1,568.
- The cap is per image, not per message. A 3840×2160 capture tiles into 138 × 78 = 10,764 patches, but the high-resolution tier bills it at 4,784 tokens. Send two of them and you pay 9,568.
- Dollars are input tokens only. The cost shown is the image's input cost at the rate you set — it excludes your prompt, the agent's output, and any tool results.
- Images are re-sent every turn. Conversation history travels with each request, so an image in a ten-turn session is paid for on each of those turns unless it is dropped or the context is compacted.
- Tokenizers differ across vendors. This page implements Anthropic's rule. OpenAI and Google count image tokens differently; do not carry these numbers across.
Related
- The visual context token cost benchmark — the same formula run across three vendors, three modalities and five resolutions, with the CSV.
- How many tokens does a screenshot cost your AI coding agent? — the measured and calculated figures behind this tool.
- How Claude calculates image tokens, explained — the patch formula worked through step by step.