---
title: "Gemma token counter: the Gemma 4 tokenizer | BroadRouter"
description: "Count Gemma 4 tokens with Google's official Gemma 4 tokenizer, in your browser. See the token split, the chat-template tokens and the cost per prompt."
url: https://broadrouter.com/tools/gemma-token-counter/
lang: en
updated: 2026-11-15
publisher: BroadRouter (a BroadNet site); API by BroadNet Inference, https://inference.broadnet.ai
---

# Gemma token counter

Updated 2026-11-15

**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.

Free, no sign-up, runs in your browser: nothing you type is sent anywhere.

Try:

 Chat format: add a system prompt and the model's chat-template tokensSystem promptYou are a helpful assistant.Text to countEvery request you send to a language model is split into tokens before the model reads it. A token can be a whole word, part of a word, a space, a number or a punctuation mark. Common English words such as "the", "model" and "price" are usually one token each, while rare words, names and long technical terms are broken into several pieces. Because providers bill per token, the same text can cost different amounts on different models. Each model family trains its own tokenizer on its own mix of languages and code, so its vocabulary decides how efficiently a sentence is packed. A tokenizer trained mostly on English packs English tightly and spends more tokens on Arabic, Hindi or Chinese. A tokenizer with a larger vocabulary usually needs fewer tokens for the same text, but it is not a guarantee. The practical lesson is simple. Count tokens with the tokenizer of the model you will actually call, not with a rule of thumb. Rules of thumb are fine for a first budget, yet they drift by twenty or thirty percent as soon as the text is not plain English. When the bill matters, measure a real sample, keep the numbers, and check them again whenever you switch models or change your prompt template. Context windows are counted in tokens too. A model with a window of one million tokens can read a very long contract or a large code base in one request, but only if the prompt, the history and the answer all fit inside that limit together.

…

tokens

Show tokens forGemma 4 VL 26B — Gemma 4 tokenizer (Google base model)DeepSeek V4.1 Flash — DeepSeek V4.1 Flash tokenizerGLM 5.3 — GLM 5.3 tokenizerQwen3.8 27B — Qwen3.8 27B tokenizerGPT (o200k) — OpenAI o200k\_base Show token IDs Show spaces

Tokens and cost of this text per model
| 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](https://broadrouter.com/data/tokenizer-efficiency/). 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.

[Create an account ($5 starting credit)](https://inference.broadnet.ai/?utm_source=broadrouter&utm_medium=referral&utm_campaign=tools-gemma-token-counter&utm_content=tool) ·

Other counters: [DeepSeek](https://broadrouter.com/tools/deepseek-token-counter/) · [GLM](https://broadrouter.com/tools/glm-token-counter/) · [Qwen](https://broadrouter.com/tools/qwen-token-counter/) · [GPT](https://broadrouter.com/tools/gpt-token-counter/) · [Llama 3](https://broadrouter.com/tools/llama-token-counter/) · [Llama 4](https://broadrouter.com/tools/llama-4-token-counter/) · [Kimi](https://broadrouter.com/tools/kimi-token-counter/) · [Mistral Small](https://broadrouter.com/tools/mistral-token-counter/) · [Ministral 3](https://broadrouter.com/tools/ministral-token-counter/) · [gpt-oss](https://broadrouter.com/tools/gpt-oss-token-counter/) · [Phi-4](https://broadrouter.com/tools/phi-4-token-counter/) · [Gemma 3](https://broadrouter.com/tools/gemma-3-token-counter/) · [MiniMax](https://broadrouter.com/tools/minimax-token-counter/) · [Nemotron 3](https://broadrouter.com/tools/nemotron-token-counter/) · [Qwen3](https://broadrouter.com/tools/qwen3-token-counter/) · [all models](https://broadrouter.com/tools/token-counter/). Prices synced 2026-11-14.

[Report a wrong price or number](mailto:info@broadnet.ai?subject=Wrong%20price%20or%20number%20on%20Gemma%20token%20counter&body=Page%3A%20https%3A%2F%2Fbroadrouter.com%2Ftools%2Fgemma-token-counter%2F%0A%0AWhat%20looks%20wrong%20(model%2C%20figure%20shown%2C%20correct%20figure%20and%20a%20source%20link%20if%20you%20have%20one)%3A%0A) (email to info@broadnet.ai, with this page's link and your inputs filled in).

## How it works

1.  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.
2.  The text appears split into tokens, a colour per token; tick "Show token IDs" to see the numbers.
3.  Tick "Chat format" to include the system prompt and chat-template tokens a request adds.
4.  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.

| Gemma tokenizer facts |  |
| --- | --- |
| 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](https://broadrouter.com/data/tokenizer-efficiency/). On Arabic the most compact was Qwen, on code GLM. Full table on the [token counter](https://broadrouter.com/tools/token-counter/).

## The cost formula

```
input cost  = tokens × input price per 1M  ÷ 1,000,000
output cost = tokens × output price per 1M ÷ 1,000,000
```

## Worked 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](https://broadrouter.com/models/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](https://huggingface.co/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](https://broadrouter.com/tools/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](https://broadrouter.com/models/gemma-4-vl-26b/).

## Go deeper

-   [BroadNet Gemma 4 VL 26B: price, context and setup](https://broadrouter.com/models/gemma-4-vl-26b/)
-   [All-model token counter](https://broadrouter.com/tools/token-counter/)
-   [Arabic token counter](https://broadrouter.com/tools/arabic-token-counter/)
-   [Context window calculator](https://broadrouter.com/tools/context-window-calculator/)
-   [What is a token?](https://broadrouter.com/glossary/token/)

## More free tools

-   [**LLM API cost calculator**Price a workload on every model at once, with cache hits, reasoning and a flat-plan check.](https://broadrouter.com/tools/llm-api-cost-calculator/)
-   [**Speech-to-text cost calculator**Hours, calls or voice notes to a monthly transcription bill, against your current provider.](https://broadrouter.com/tools/speech-to-text-cost-calculator/)
-   [**LLM token counter**Exact token counts with each model's real tokenizer, with a token view and cost.](https://broadrouter.com/tools/token-counter/)
-   [**Arabic token counter**Arabic vs English token counts per tokenizer: the "Arabic tax" in tokens and money.](https://broadrouter.com/tools/arabic-token-counter/)
-   [**Tokens to words converter**Tokens ↔ words ↔ characters ↔ pages, by language and content type.](https://broadrouter.com/tools/tokens-to-words/)
-   [**Context window calculator**Will it fit? Window used per model, room left for output, cost to send.](https://broadrouter.com/tools/context-window-calculator/)
-   [**Flat-rate vs per-token LLM cost calculator**Break-even between an unlimited plan and paying per token, per agent.](https://broadrouter.com/tools/flat-rate-vs-per-token-calculator/)
-   [**Prompt caching savings calculator**Bill with and without caching, by prefix share and hit rate.](https://broadrouter.com/tools/prompt-caching-calculator/)
-   [**Image token calculator**Tokens and cost per image under each model's documented rule. Drop an image; nothing is uploaded.](https://broadrouter.com/tools/image-token-calculator/)
-   [**Self-hosting vs API cost calculator**GPU rental against your current API and BroadNet per-token and flat-plan prices: cost per 1M tokens and break-even volume.](https://broadrouter.com/tools/self-hosting-vs-api-calculator/)
-   [**Embedding cost calculator**Index, update and query costs for a corpus at OpenAI, Google, Voyage, Mistral and Jina list prices.](https://broadrouter.com/tools/embedding-cost-calculator/)
-   [**LLM rate limit and concurrency calculator**Which limit binds first: RPM, TPM or concurrency, with Little's law.](https://broadrouter.com/tools/llm-rate-limit-calculator/)
-   [**JSON schema generator for LLM structured output**Sample JSON to strict schema, Pydantic, Zod and a ready request.](https://broadrouter.com/tools/json-schema-generator/)
-   [**OpenAI-compatible API request builder**One request, copied as curl, Python, Node or the OpenAI SDKs.](https://broadrouter.com/tools/api-request-builder/)
-   [**Audio file splitter for speech-to-text limits**Chunk count, overlap and copy-ready ffmpeg commands to fit a transcription file-size limit.](https://broadrouter.com/tools/audio-splitter-ffmpeg/)
-   [**Agent run cost estimator**Context growth per step, total tokens and cost of one agent run, with a DeepSeek session comparison.](https://broadrouter.com/tools/agent-run-cost-estimator/)
-   [**OpenAI to BroadNet migration helper**Paste OpenAI SDK code; get base URL, key and model edits, a diff and the checks that remain.](https://broadrouter.com/tools/openai-to-broadnet-migration/)
-   [**Arabic text normalizer**Tashkeel, tatweel, alef, ya, ta marbuta, digits and invisible characters, with a matching Python function.](https://broadrouter.com/tools/arabic-text-normalizer/)
-   [**RAG chunking calculator**Chunks, embedding tokens, input per query, context check and monthly LLM cost for a RAG pipeline.](https://broadrouter.com/tools/rag-chunking-calculator/)
-   [**max\_tokens calculator for reasoning models**Answer length + reasoning budget + margin = a max\_tokens that does not cut the answer off.](https://broadrouter.com/tools/reasoning-token-budget/)
-   [**LLM batch job planner**Run time, binding limit, cost per model and the flat sessions needed to finish a big job by a deadline.](https://broadrouter.com/tools/llm-batch-job-planner/)
-   [**LLM JSON output validator**Parse errors by line and column, safe repairs, cut-off detection and JSON Schema checks for model output.](https://broadrouter.com/tools/llm-json-output-validator/)
-   [**Prompt token diff**Two prompt versions side by side: changed lines, exact token delta and the monthly cost difference.](https://broadrouter.com/tools/prompt-token-diff/)

Try it on your real workload. New accounts start with $5 of credit for Gemma and transcription. DeepSeek, GLM and Qwen3.8 need a top-up.

[Get started](https://inference.broadnet.ai/account/?utm_source=broadrouter&utm_medium=referral&utm_campaign=tools-gemma-token-counter&utm_content=page-cta) ·

**Sources**

-   [BroadNet Inference machine-readable prices (pricing.json)](https://inference.broadnet.ai/pricing.json?utm_source=broadrouter&utm_medium=referral&utm_campaign=tools-gemma-token-counter&utm_content=sources)
-   [google/gemma-4-26B-A4B-it on Hugging Face (tokenizer.json)](https://huggingface.co/google/gemma-4-26B-A4B-it)
