Calculate the token cost of sending images to a multimodal vision-language model.
Vision-enabled LLMs like GPT-4V convert images into a fixed or resolution-dependent number of tokens before billing. Low-detail mode charges a flat token count (commonly 85 tokens) regardless of image size, while high-detail mode tiles the image into 512×512 segments and charges roughly 170 tokens per tile plus a small base. This calculator estimates total token usage and cost for a batch of images under either mode.
Tokens per image (high detail)
tokens_per_image = 85 + tiles_per_image × 170
Total cost
total_cost = images × tokens_per_image × (rate_per_1M_tokens / 1000000)
Use low detail for thumbnails, icons, or cases where fine text/detail recognition isn't needed — it's dramatically cheaper per image.
A 1024×1024 image typically needs about 4 tiles; larger or non-square images may need more. Check your provider's tiling documentation for exact counts.
The tile/token math shown mirrors OpenAI's GPT-4V-style approach; other providers (Claude, Gemini) use different image-to-token conversion schemes.