---
title: "Llama 4 token counter: Maverick and Scout tokenizer | BroadRouter"
description: "Count Llama 4 Maverick and Scout tokens with Meta's own Llama 4 tokenizer, in your browser. Compare it with Llama 3 and see the cheapest API price."
url: https://broadrouter.com/tools/llama-4-token-counter/
lang: en
updated: 2026-11-15
publisher: BroadRouter (a BroadNet site); API by BroadNet Inference, https://inference.broadnet.ai
---

# Llama 4 token counter

Updated 2026-11-15

**In short:** This counter runs Meta's official Llama 4 tokenizer.json in your browser, pinned to the same commit as our tokenizer dataset. It has 201,135 token IDs and is a 28 MB download. English prose takes about 126 tokens per 100 words, Modern Standard Arabic about 219.

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 forLlama 4 Scout 17B 16E Instruct — Llama 4 tokenizer (Llama 4 Maverick)DeepSeek V4.1 Flash — DeepSeek V4.1 Flash tokenizerGLM 5.3 — GLM 5.3 tokenizerQwen3.8 27B — Qwen3.8 27B tokenizerGemma 4 VL 26B — Gemma 4 tokenizer (Google base model)GPT (o200k) — OpenAI o200k\_baseLlama 3.1 8B Instruct — Llama 3 tokenizer (Llama 3.3 70B Instruct) Show token IDs Show spaces

Tokens and cost of this text per model
| Model | Tokens | Chars per token | As input | As output |
| --- | --- | --- | --- | --- |
| **Llama 4 Scout 17B 16E Instruct** · Llama 4 tokenizer (Llama 4 Maverick) · Price: Llama 4 Scout 17B 16E Instruct at GMI Cloud, cheapest listed input price (not BroadNet) | … | … | … | … |
| **DeepSeek V4.1 Flash** · DeepSeek V4.1 Flash tokenizer | … | … | … | … |
| **GLM 5.3** · GLM 5.3 tokenizer | … | … | … | … |
| **Qwen3.8 27B** · Qwen3.8 27B tokenizer | … | … | … | … |
| **Gemma 4 VL 26B** · Gemma 4 tokenizer (Google base model) | … | … | … | … |
| **GPT (o200k)** · OpenAI o200k\_base | … | … | … | … |
| **Llama 3.1 8B Instruct** · Llama 3 tokenizer (Llama 3.3 70B Instruct) · Price: Llama 3.1 8B Instruct at DeepInfra, cheapest listed input price (not BroadNet) | … | … | … | … |

Cost = tokens × the model's published price per 1M input or output tokens. GPT is shown for reference only (no BroadNet price). Llama 4 and Llama 3 models are not sold by BroadNet: their rows use the cheapest standard input price we hold for a model with that tokenizer, read from the provider's own pricing page. Sources and check dates are in the [real cost by language dataset](https://broadrouter.com/data/real-cost-by-language/). The chat-format option adds template tokens only for the DeepSeek, GLM, Qwen, Gemma and GPT rows; Llama 4 and Llama 3 rows count your text alone. 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-llama-4-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/) · [Gemma](https://broadrouter.com/tools/gemma-token-counter/) · [GPT](https://broadrouter.com/tools/gpt-token-counter/) · [Llama 3](https://broadrouter.com/tools/llama-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/). BroadNet prices synced 2026-11-14.

[Report a wrong price or number](mailto:info@broadnet.ai?subject=Wrong%20price%20or%20number%20on%20Llama%204%20token%20counter&body=Page%3A%20https%3A%2F%2Fbroadrouter.com%2Ftools%2Fllama-4-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 Llama 4 tokenizer (Llama 4 Maverick) is preselected and downloads once (28 MB) when you start typing.
2.  The text appears split into tokens, a colour per token; tick "Show token IDs" to see the numbers.
3.  Compare the Llama 4 count with the other tokenizers in the table; load any of them for an exact count.
4.  Copy the link or download a CSV of the counts and costs.

## About the Llama 4 tokenizer

The Llama 4 tokenizer is a byte-level BPE. It has 201,135 token IDs, 1,135 of them added or special tokens such as chat-format markers. Text is split into words, punctuation and numbers first, then merged byte by byte. Numbers are split into groups of up to three digits, so 2026 is two tokens.

On the open texts of our [tokenizer efficiency dataset](https://broadrouter.com/data/tokenizer-efficiency/) it needs 1,264 tokens per 1,000 English words (rank 2 of the 16 tokenizers we measured, 1 = fewest), 2,025 per 1,000 words of Python (rank 7 of 16) and 2,186 per 1,000 words of Modern Standard Arabic (rank 10 of 16). Its best showing here is JSON (rank 1 of 16); its weakest is Arabic MSA (rank 10 of 16).

2 models in our price database use this tokenizer: Llama 4 Maverick 17B 128E Instruct FP8 and Llama 4 Scout 17B 16E Instruct. We hold 13 standard prices for them from 9 providers. The cheapest input price is $0.08 per 1M tokens, for Llama 4 Scout 17B 16E Instruct on GMI Cloud (checked 2026-11-15). At that price 1,000 English words cost $0.00010 to send. Llama 4 models are not sold by BroadNet. That is less than BroadNet's cheapest chat model, Gemma 4 VL 26B, at $0.00013 for the same text.

| Llama 4 tokenizer facts |  |
| --- | --- |
| Tokenizer | Llama 4 tokenizer (Llama 4 Maverick), a byte-level BPE |
| Source | meta-llama/Llama-4-Maverick-17B-128E-Instruct (commit 73d1471), read from unsloth/Llama-4-Maverick-17B-128E-Instruct (byte-identical) |
| Token IDs | 201,135 (200,000 in the base vocabulary) |
| Models using it | 2: Llama 4 Maverick 17B 128E Instruct FP8 and Llama 4 Scout 17B 16E Instruct |
| Cheapest input price | $0.08 per 1M tokens (Llama 4 Scout 17B 16E Instruct, GMI Cloud, checked 2026-11-15) |
| English prose | 126 tokens per 100 words (rank 2 of 16) |
| Arabic (MSA) | 219 tokens per 100 words (rank 10 of 16) |
| Python code | 203 tokens per 100 words (rank 7 of 16) |
| Download | 28 MB, once; then cached in your browser |

Tokens per 100 words measured on the open texts of our dataset with all 16 tokenizers (2026-11-15); rank 1 = fewest tokens on the same texts. Model mapping checked 2026-11-15. Third-party prices are standard-tier prices from each provider's own page; BroadNet prices come from its pricing.json.

## How much does a Llama 4 prompt cost?

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

Worked example: "English Wikipedia: Water" in our dataset is 274 words. The Llama 4 tokenizer (Llama 4 Maverick) splits it into 348 tokens. Sent to Llama 4 Scout 17B 16E Instruct on GMI Cloud at $0.08 per 1M input tokens it costs $0.000028; the same number of tokens written as output at $0.50 per 1M costs $0.00017.

## Questions

### Which tokenizer does Llama 4 use?

A byte-level BPE with 201,135 token IDs, published as tokenizer.json in [meta-llama/Llama-4-Maverick-17B-128E-Instruct](https://huggingface.co/meta-llama/Llama-4-Maverick-17B-128E-Instruct). This page loads that file pinned to commit 73d1471, the commit our dataset measured. The official repo is gated (it needs a Hugging Face account and licence acceptance), so the file is read from [unsloth/Llama-4-Maverick-17B-128E-Instruct](https://huggingface.co/unsloth/Llama-4-Maverick-17B-128E-Instruct). Our dataset checks that the mirror's file is byte-identical to the official one: same SHA-256 and the same Git object ID that the official repo lists.

### Which models use the Llama 4 tokenizer?

[Llama 4 Maverick 17B 128E Instruct FP8](https://broadrouter.com/llm-api-pricing/llama-4-maverick/) and [Llama 4 Scout 17B 16E Instruct](https://broadrouter.com/llm-api-pricing/llama-4-scout/). Each was checked against the model's own Hugging Face repo on 2026-11-15: same tokenizer file, or the same vocabulary and rules with identical counts on every dataset text.

### What is the cheapest Llama 4 API price per token?

Of the 13 standard prices we hold for Llama 4 models, the lowest input price is $0.08 per 1M tokens (output $0.50), for Llama 4 Scout 17B 16E Instruct on GMI Cloud, read from [the provider's pricing page](https://console.gmicloud.ai/model/llm/llama-4-scout-17b-16e-instruct/169f3961-e31c-4829-8008-2a3a05184fa8) on 2026-11-15. Promotional prices are not ranked. Prices differ by model size and provider: each model's price page lists every provider we hold.

### How many tokens does Arabic take with Llama 4?

Modern Standard Arabic sentences take 1.59× the tokens of their English translations with this tokenizer (rank 10 of 16 on the same texts). Hindi takes 1.65× and Chinese 1.07×. Measured on parallel sentences in our open dataset (2026-11-15). Paste your own text above, or use the [Arabic token counter](https://broadrouter.com/tools/arabic-token-counter/).

### Is the Llama 4 tokenizer the same as Llama 3?

No. On the 52 texts of our dataset they gave the same count on 2; in total Llama 4 needs 16% fewer tokens, and up to 44% on a single text. See the [Llama 3 counter](https://broadrouter.com/tools/llama-token-counter/).

### Does the count include chat-template tokens?

No. For Llama 4 this page counts your text only, as our dataset does. A chat request also adds the chat template's role markers and special tokens, so the billed prompt is a little longer than your text. Read `usage.prompt_tokens` on a real response to see the exact figure.

## Go deeper

-   [Llama 4 Scout 17B 16E Instruct API pricing by provider](https://broadrouter.com/llm-api-pricing/llama-4-scout/)
-   [All-model token counter](https://broadrouter.com/tools/token-counter/)
-   [Tokenizer efficiency dataset](https://broadrouter.com/data/tokenizer-efficiency/)
-   [Real cost by language dataset](https://broadrouter.com/data/real-cost-by-language/)
-   [Arabic token counter](https://broadrouter.com/tools/arabic-token-counter/)
-   [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-llama-4-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-llama-4-token-counter&utm_content=sources)
-   [meta-llama/Llama-4-Maverick-17B-128E-Instruct on Hugging Face (tokenizer.json, commit 73d1471)](https://huggingface.co/meta-llama/Llama-4-Maverick-17B-128E-Instruct/tree/73d14711bcc77c16df3470856949c3764056b617)
-   [unsloth/Llama-4-Maverick-17B-128E-Instruct: byte-identical ungated copy (commit 86c5ecb)](https://huggingface.co/unsloth/Llama-4-Maverick-17B-128E-Instruct/resolve/86c5ecb6f2fbddf604c60120125fb202e09f2556/tokenizer.json)
-   [GMI Cloud pricing for Llama 4 Scout 17B 16E Instruct (checked 2026-11-15)](https://console.gmicloud.ai/model/llm/llama-4-scout-17b-16e-instruct/169f3961-e31c-4829-8008-2a3a05184fa8)
