Gemma token counter
Updated
In short: This counter loads the tokenizer.json from Google's gemma-4-26B-A4B-it repository. BroadNet Gemma 4 VL 26B is built on that model; we assume its build keeps the base tokenizer. The vocabulary has 262,144 token IDs and is especially compact for Hindi (138 tokens per 100 words); English prose takes about 130.
tokens
| Model | Tokens | Chars per token | As input | As output |
|---|---|---|---|---|
| Gemma 4 VL 26B Gemma 4 tokenizer (Google base model) | … | … | … | … |
| DeepSeek V4.1 Flash DeepSeek V4.1 Flash tokenizer | … | … | … | … |
| GLM 5.3 GLM 5.3 tokenizer | … | … | … | … |
| Qwen3.8 27B Qwen3.8 27B tokenizer | … | … | … | … |
| GPT (o200k) OpenAI o200k_base | … | … | … | … |
Cost = tokens × the model's published price per 1M input or output tokens. GPT is shown for reference only (no BroadNet price). Measured ratios for every tokenizer are in the tokenizer efficiency dataset. Rows marked ≈ are estimates from measured characters per token until you load that tokenizer; loading downloads its tokenizer.json from Hugging Face once and keeps it in your browser cache.
Other counters: DeepSeek · GLM · Qwen · GPT · Llama 3 · Llama 4 · Kimi · Mistral Small · Ministral 3 · gpt-oss · Phi-4 · Gemma 3 · MiniMax · Nemotron 3 · Qwen3 · all models. Prices synced 2026-11-14.
Report a wrong price or number (email to info@broadnet.ai, with this page's link and your inputs filled in).
How it works
- Paste text into the box or pick a sample. The Gemma 4 tokenizer (Google base model) is preselected and downloads once (32 MB) when you start.
- The text appears split into tokens, a colour per token; tick "Show token IDs" to see the numbers.
- Tick "Chat format" to include the system prompt and chat-template tokens a request adds.
- Compare the table with the other models and copy the link or download CSV.
About the Gemma tokenizer
Gemma 4 uses a SentencePiece-style BPE vocabulary of 262,144 tokens, the largest of the four. Spaces become a ▁ marker that merges with the following word, and any byte not in the vocabulary falls back to a single-byte token, so no text is ever unknown.
The big multilingual vocabulary pays off outside English: Hindi takes 138 tokens per 100 words here against 455 for GLM. Code and JSON go the other way, with the most tokens of the four. The file is 32 MB, the largest download, so the counter fetches it only when you use it.
| Tokenizer | Gemma 4 tokenizer (Google base model) |
|---|---|
| Source | google/gemma-4-26B-A4B-it (commit 4d7ae49) |
| Token IDs | 262,144 (262,144 in the base vocabulary) |
| Context window | 32,768 tokens |
| Price per 1M tokens | $0.10 input · $0.22 output |
| English prose | 130 tokens per 100 words (rank 4 of 5) |
| Arabic | 203 tokens per 100 words (rank 3 of 5) |
| Python code | 234 tokens per 100 words (rank 5 of 5) |
| Download | 32 MB, once; then cached in your browser |
Tokens per 100 words measured on the open texts of our dataset with every tokenizer (2026-11-15; Arabic = Modern Standard Arabic); rank 1 = fewest tokens. All counts: tokenizer efficiency dataset. On Arabic the most compact was Qwen, on code GLM. Full table on the token counter.
The cost formula
input cost = tokens × input price per 1M ÷ 1,000,000
output cost = tokens × output price per 1M ÷ 1,000,000Worked example
The English sample in the counter is 260 words. The Gemma 4 tokenizer (Google base model) splits it into 298 tokens. Sent to BroadNet Gemma 4 VL 26B as a prompt it costs $0.000030; written by the model as an answer it costs $0.000066. Prices are per one million tokens, so multiply the count by the price and divide by 1,000,000.
Questions
Which tokenizer does Gemma 4 use?
A SentencePiece-style BPE tokenizer with 262,144 token IDs and byte fallback, published as tokenizer.json in google/gemma-4-26B-A4B-it. This page loads that file, pinned to commit 4d7ae49.
Is this the exact tokenizer of BroadNet Gemma 4 VL 26B?
It is the tokenizer of the Google model the BroadNet build is based on. Fine-tunes normally keep the base tokenizer, but BroadNet has not published its own tokenizer file, so we label this a base-model tokenizer. Check usage.prompt_tokens on a real request to confirm.
How many tokens does the Gemma chat template add?
About 13 tokens for one user message with the official template's defaults: <bos>, the turn markers, the role names and an empty thought channel. A system turn adds about 5 tokens plus its text.
How much text fits in Gemma 4 VL 26B's context?
BroadNet serves it with a 32,768-token context, prompt and answer together: about 25.206 thousand English words. Images also use context. See the context window calculator.
What does Gemma 4 VL 26B cost?
$0.10 per 1M input tokens and $0.22 per 1M output tokens, the lowest of the BroadNet chat models. It is the only model that works on the free starting credit and is also sold as a flat hourly key: Gemma 4 VL 26B.