Gemini token counter

Analyze Gemini token usage.

Measure text, documents, and images against current Gemini models in your browser.

Everything stays in this browserLive

Text, code, PDF, DOCX, images, audio, or video · 12 MB per file

How it works

A measurement, not a guess disguised as fact.

Gemini text uses a deterministic Provider-Calibrated UTF-8 Token Projection. Images follow Google’s published media-token allocation guidance. Google’s countTokens API remains authoritative for a fully assembled production request.

Every result identifies its method and accuracy level. Pricing is refreshed from Models.dev with the bundled registry available as an offline fallback.

Read the complete methodology →
Google methodology

How this Google token calculator works

Gemini text uses the deterministic Provider-Calibrated UTF-8 Token Projection. Google’s countTokens API remains authoritative after the complete API request, including instructions and attached content, is assembled.

Gemini uses different tokenizer and multimodal processing semantics from GPT or Claude, so token totals should not be transferred between providers.

Image dimensions are converted with Google’s published media-token allocation guidance. The selected Gemini model determines the context window and pricing applied.

Read the official Google documentation ↗
Curated production models

Models included in this counter

Registry reviewed 2026-10-02

ModelTokenization methodContext windowInput / 1MOutput / 1M
Gemini 3.8 FlashProvider-Calibrated UTF-8 Projection1,048,576$0.75$3.75
Gemini 3.7 FlashProvider-Calibrated UTF-8 Projection1,048,576$0.75$3.75
Gemini 3.5 Flash LiteProvider-Calibrated UTF-8 Projection1,048,576$0.30$2.50
Gemini 3.6 FlashProvider-Calibrated UTF-8 Projection1,048,576$0.75$3.75
Gemini 3.1 Flash LiteProvider-Calibrated UTF-8 Projection1,048,576$0.25$1.50
Gemini 2.5 ProProvider-Calibrated UTF-8 Projection1,048,576$1.25$10.00

Rates shown are USD per 1,000,000 tokens, verified against the public pricing catalogue on 2026-10-02. The table refreshes from the same live source the calculator uses. Provider invoices and official documentation remain authoritative.

Focused counters

Measure against the model you use

Current model comparisons

Compare cost with the same real workload

Cost guides

Compare approaches, not just models

Plain answers

Frequently asked questions

Does Gemini provide a token counting API?+

Yes. Google’s countTokens API is authoritative for a fully assembled Gemini request. This privacy-first browser engine applies a deterministic provider-family UTF-8 projection without transmitting your input.

How are Gemini image tokens calculated?+

The browser reads image dimensions and applies Google’s published media-token allocation guidance. Image pixels remain on-device.

Why does Gemini tokenize text differently from GPT?+

Providers use different tokenizer vocabularies, segmentation strategies, Unicode handling, and multimodal processing rules, so identical content can produce different totals.

Can Gemini count tokens in a PDF?+

The client-side extraction pipeline converts readable PDF text and applies the Gemini projection. Scanned PDFs require OCR and are not supported.

What is a token in an AI model?+

A token is a small unit of content processed by a language model. It may be a whole word, part of a word, punctuation, whitespace, or—in multimodal models—a unit assigned to an image. Different providers can split the same input differently.

How is LLM API input cost calculated?+

Input cost is calculated as input tokens divided by one million, multiplied by the selected model’s input price per million tokens. Provider tiers, cached input, tools, and message wrappers can affect final billing.

Does this tool upload my prompt, document, or image?+

No. Text, PDF and DOCX extraction, image-dimension reading, and token calculations run in your browser. Zero prompts, document contents, or uploaded images are sent to TokenCalculator.dev or another calculation server.

Are the token counts exact?+

OpenAI text counts use the matching local BPE encoding. Other providers are clearly labeled estimates unless they publish a deterministic local formula. Image counts use provider-published rules.

How do I count tokens in a PDF or Word document?+

Attach a text-based PDF or DOCX file and the browser extracts its readable text locally, then counts it with every selected provider model. Scanned or encrypted PDFs require OCR and are not supported.

Can I calculate image tokens and vision-model cost?+

Yes. Add a PNG, JPEG, WebP, or GIF. For supported vision models, the calculator reads its pixel dimensions locally and applies the provider-published image token formula. It reports unavailable instead of inventing a value when a provider has no documented rule.

Why can the API report a slightly different count?+

Providers can add message wrappers, system instructions, tools, or model-specific processing. The accuracy badge and methodology explain what this calculator includes.