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.
| Model | Tokenizer | Price / 1M input | Context window |
|---|
| Gemini Pro | gemma-3 * | $2.00 | 1M |
| Gemini Flash | gemma-3 * | $1.50 | 1M |
| Gemma 4 31B | gemma-4 | $0.10 | 262K |
| Gemma 4 26B | gemma-4 | $0.12 | 262K |
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.