Token Studio

Gemini Token Counter

Estimate tokens and cost for Gemini Pro and Flash, plus Google's open Gemma models. Everything runs locally in your browser.

Runs entirely in your browser Nothing is uploaded
Loading tokenizer…
31.8 MB · one-time
Est. cost
 
Tokens / word
 
Chars / token
 
Characters
327
58 words
Context window
Input text
327characters
270no spaces
58words
4sentences
Token breakdown
Gemini Pro · gemma-3
Loading Gemini tokenizer · 31.8 MB
Compare models — same text 2 of 28 · click to inspect
Model Tokens Cost
Gemini Pro
loading tokenizer…
—
Gemini Flash
loading tokenizer…
—

Counts come from each model's real tokenizer, running entirely in your browser. Cost and context-window figures are estimates for guidance and may vary by model version.

Counting tokens for Google models

Google does not publish Gemini's tokenizer, so this page counts with the Gemma 3 vocabulary as a proxy. Gemini Pro and Flash load by default and share the same estimate against Gemini's million-token context window, so the context bar tells you how much room a long document actually leaves. For an exact count, the Gemini API exposes a countTokens method.

Pricing and context windows

Gemini's input prices per million tokens, with the context window of each model.

ModelTokenizerPrice / 1M inputContext window
Gemini Progemma-3 *$2.001M
Gemini Flashgemma-3 *$1.501M
Gemma 4 31Bgemma-4$0.10262K
Gemma 4 26Bgemma-4$0.12262K

Marked as an estimate: Google does not publish the tokenizer for these models, so the count is a close approximation. Prices and context windows are curated metadata refreshed periodically from the providers and OpenRouter, so treat them as guidance rather than a quote. Token counts are always produced by the real tokenizer.

How Gemini tokenization works

Gemini and Gemma are separate vocabularies here, and only Gemma's is official. Google's own repositories indicate Gemini uses the tokenizer of Gemma 3, its open model family, so this tool loads the Gemma 3 vocabulary for Gemini Pro and Flash and marks the result as an estimate. Gemma 4 shipped with its own published vocabulary, so its counts are exact.

Both are large SentencePiece-derived vocabularies, which is why Gemini counts tend to run slightly above GPT counts on the same English text.

Gemma token counter

Gemma 4 is Google's open-weight family and ships a published tokenizer, so its counts are exact rather than estimated. Add a Gemma model from the compare table to count the same text with it. Its vocabulary downloads separately, since it differs from the Gemma 3 file used as the Gemini proxy.

Frequently asked questions

Is this Gemini's official tokenizer?

No. Google has not published one, so the tool uses Gemma 3 as a proxy. The proxy is close on ordinary text and the tool flags the result as an estimate. When the exact number matters, the Gemini API's countTokens method returns Google's own count for a request.

Do Gemini Pro and Flash tokenize differently?

No. The same text splits identically on both. They share a vocabulary and a million-token context window; price and latency are what set them apart. The compare table shows the shared count against each model's cost.

Is Gemma tokenized the same as Gemini?

Close, but not identical: Gemma 4 has its own vocabulary. The Gemini estimate is built on Gemma 3, while the Gemma entries in this tool count with the Gemma 4 file. Counts land near each other on English prose and can diverge on code or other languages.

How much of Gemini's 1M context will my text use?

The context bar above the editor shows the share of the window your text fills. It is measured against the selected model's window, so switching models updates it. Remember that a real request also carries your system instructions and any earlier turns, which eat into the same budget.