# Mismatch image token count. 11x difference?

**URL:** <https://discuss.ai.google.dev/t/mismatch-image-token-count-11x-difference/75691>\
**Category:** Gemini API\
**Tags:** gemini-flash\
**Created:** [March 28, 2025, 4:43am UTC](https://discuss.ai.google.dev/t/mismatch-image-token-count-11x-difference/75691 "2025-03-28T04:43:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hoang\_Dinh\_Thanh](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/hoang_dinh_thanh/32/47509_2.png) [@Hoang\_Dinh\_Thanh](https://discuss.ai.google.dev/u/Hoang_Dinh_Thanh)\
**Post date:** [March 28, 2025, 4:43am UTC](https://discuss.ai.google.dev/t/mismatch-image-token-count-11x-difference/75691/1 "2025-03-28T04:43:17Z")

</div>

Hi, I am using gemini flash 2 with image input. While count\_tokens return 262, the actual number of token used from the response is 2838! The size of the image is (1250, 356)  
Can anyone explain this to me.

---

<div class="post-metadata">

**Author:** ![Siva\_Sravana\_Kumar\_N](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/siva_sravana_kumar_n/32/5462_2.png) [@Siva\_Sravana\_Kumar\_N](https://discuss.ai.google.dev/u/Siva_Sravana_Kumar_N)\
**Post date:** [March 28, 2025, 4:50pm UTC](https://discuss.ai.google.dev/t/mismatch-image-token-count-11x-difference/75691/3 "2025-03-28T16:50:58Z")

</div>

Hi @Hoang_Dinh_Thanh,

Welcome to forum, Yes its a genuine bug, team is working on this issue to be fixed.

Thank you

---

<div class="post-metadata">

**Author:** ![Hoang\_Dinh\_Thanh](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/hoang_dinh_thanh/32/47509_2.png) [@Hoang\_Dinh\_Thanh](https://discuss.ai.google.dev/u/Hoang_Dinh_Thanh)\
**Post date:** [April 2, 2025, 4:38am UTC](https://discuss.ai.google.dev/t/mismatch-image-token-count-11x-difference/75691/5 "2025-04-02T04:38:51Z")

</div>

is there any update on this problem?

---

<div class="post-metadata">

**Author:** ![Siva\_Sravana\_Kumar\_N](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/siva_sravana_kumar_n/32/5462_2.png) [@Siva\_Sravana\_Kumar\_N](https://discuss.ai.google.dev/u/Siva_Sravana_Kumar_N)\
**Post date:** [April 15, 2025, 7:32pm UTC](https://discuss.ai.google.dev/t/mismatch-image-token-count-11x-difference/75691/7 "2025-04-15T19:32:12Z")

</div>

Hi @Hoang_Dinh_Thanh,

Sorry for the delay but still the fix is in WIP.

Thank you

---

<div class="post-metadata">

**Author:** ![Hoang\_Dinh\_Thanh](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/hoang_dinh_thanh/32/47509_2.png) [@Hoang\_Dinh\_Thanh](https://discuss.ai.google.dev/u/Hoang_Dinh_Thanh)\
**Post date:** [June 9, 2025, 3:37am UTC](https://discuss.ai.google.dev/t/mismatch-image-token-count-11x-difference/75691/9 "2025-06-09T03:37:59Z")

</div>

It’s been 2 months, is there any update?

---

<div class="post-metadata">

**Author:** ![Mrinal\_Ghosh](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/mrinal_ghosh/32/32599_2.png) [@Mrinal\_Ghosh](https://discuss.ai.google.dev/u/Mrinal_Ghosh)\
**Post date:** [June 9, 2025, 8:59am UTC](https://discuss.ai.google.dev/t/mismatch-image-token-count-11x-difference/75691/11 "2025-06-09T08:59:07Z")

</div>

> [@Hoang\_Dinh\_Thanh](#):
>
> 1250, 356)

Hi @Hoang_Dinh_Thanh ,

Sorry for the late response !!  
I checked from my end , the issue is fixed now. I would request you please check from your end and let us know your feedback.

Thank you !!

---

<div class="post-metadata">

**Author:** ![Kevin\_K](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/kevin_k/32/36971_2.png) [@Kevin\_K](https://discuss.ai.google.dev/u/Kevin_K)\
**Post date:** [June 28, 2025, 2:31am UTC](https://discuss.ai.google.dev/t/mismatch-image-token-count-11x-difference/75691/13 "2025-06-28T02:31:58Z")

</div>

I can confirm this is not fixed  
384x384 image is 256 tokens after processing as expected  
768x768 is 1200~ tokens

```auto
✅ Token Counting Results:

  Input Token Count (Pre-request):

  - Total Tokens: 267 (from countTokens API call)
  - Text: 9 tokens ("Describe what you see in this image.")
  - Image: 258 tokens (768x768 JPEG)

  Response Usage Metadata (Post-request):

  - Prompt Tokens: 1,298
  - Response Tokens: 40
  - Total Tokens: 1,338

```

This is with [@google](https://discuss.ai.google.dev/groups/google)/genai 1.7.0.

Can we get a confirmation that a 768x768 should process as 258 tokens as per docs or is this an estimation issue and the actual logic behind the token count is undocumented?

---

<div class="post-metadata">

**Author:** ![csekas](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/csekas/32/22760_2.png) [@csekas](https://discuss.ai.google.dev/u/csekas)\
**Post date:** [July 26, 2025, 9:41am UTC](https://discuss.ai.google.dev/t/mismatch-image-token-count-11x-difference/75691/15 "2025-07-26T09:41:55Z")

</div>

I am experiencing the same issue. In my case, the images are 768x~1200, so according to the documentation we where expecting to be charged for 2 tiles, 2x258 = 516 tokens.

Instead, I am getting charged ~1291 token for an image of resolution of 768×994  
I even get charged ~1291 tokens for an image of resolution 500×647

We are planning to fine-tune `gemini-2.0-flash` to process millions of images.

> With gemini-2.5-flash, there is no issue
