BroadRouter

Llama 3 token counter

Updated

In short: This counter runs Meta's official Llama 3 tokenizer.json in your browser, pinned to the same commit as our tokenizer dataset. It has 128,256 token IDs and is a 17 MB download. English prose takes about 129 tokens per 100 words, Modern Standard Arabic about 228.

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

Try:

… tokens

Tokens and cost of this text per model
ModelTokensChars per tokenAs inputAs output
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)
…………
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 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)
…………

Cost = tokens × the model's published price per 1M input or output tokens. GPT is shown for reference only (no BroadNet price). Llama 3 and Llama 4 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. The chat-format option adds template tokens only for the DeepSeek, GLM, Qwen, Gemma and GPT rows; Llama 3 and Llama 4 rows count your text alone. 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.

Create an account ($5 starting credit)

Other counters: DeepSeek · GLM · Qwen · Gemma · GPT · Llama 4 · Kimi · Mistral Small · Ministral 3 · gpt-oss · Phi-4 · Gemma 3 · MiniMax · Nemotron 3 · Qwen3 · all models. BroadNet 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

  1. Paste text into the box or pick a sample. The Llama 3 tokenizer (Llama 3.3 70B Instruct) is preselected and downloads once (17 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 3 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 3 tokenizer

The Llama 3 tokenizer is a byte-level BPE. It has 128,256 token IDs, 256 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 it needs 1,289 tokens per 1,000 English words (rank 6 of the 16 tokenizers we measured, 1 = fewest), 2,004 per 1,000 words of Python (rank 2 of 16) and 2,283 per 1,000 words of Modern Standard Arabic (rank 12 of 16). Its best showing here is Python (rank 2 of 16); its weakest is Arabic MSA (rank 12 of 16).

7 models in our price database use this tokenizer: Llama 3.3 70B, Llama 3.1 8B Instruct, Llama 3.1 Instruct (70B), Llama 3.2 1B Instruct, Llama 3.2 3B Instruct, Llama 3 8B Instruct and 1 more. We hold 35 standard prices for them from 14 providers. The cheapest input price is $0.02 per 1M tokens, for Llama 3.1 8B Instruct on DeepInfra (checked 2026-11-14). At that price 1,000 English words cost $0.000026 to send. Llama 3 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 3 tokenizer facts
TokenizerLlama 3 tokenizer (Llama 3.3 70B Instruct), a byte-level BPE
Sourcemeta-llama/Llama-3.3-70B-Instruct (commit 6f6073b), read from unsloth/Llama-3.3-70B-Instruct (byte-identical)
Token IDs128,256 (128,000 in the base vocabulary)
Models using it7: Llama 3.3 70B, Llama 3.1 8B Instruct, Llama 3.1 Instruct (70B), Llama 3.2 1B Instruct, Llama 3.2 3B Instruct, Llama 3 8B Instruct and 1 more
Cheapest input price$0.02 per 1M tokens (Llama 3.1 8B Instruct, DeepInfra, checked 2026-11-14)
English prose129 tokens per 100 words (rank 6 of 16)
Arabic (MSA)228 tokens per 100 words (rank 12 of 16)
Python code200 tokens per 100 words (rank 2 of 16)
Download17 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 3 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 3 tokenizer (Llama 3.3 70B Instruct) splits it into 364 tokens. Sent to Llama 3.1 8B Instruct on DeepInfra at $0.02 per 1M input tokens it costs $0.0000073; the same number of tokens written as output at $0.04 per 1M costs $0.000015.

Questions

Which tokenizer does Llama 3 use?

A byte-level BPE with 128,256 token IDs, published as tokenizer.json in meta-llama/Llama-3.3-70B-Instruct. This page loads that file pinned to commit 6f6073b, 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-3.3-70B-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 3 tokenizer?

Llama 3.3 70B, Llama 3.1 8B Instruct, Llama 3.1 Instruct (70B), Llama 3.2 1B Instruct, Llama 3.2 3B Instruct, Llama 3 8B Instruct and Llama 3 Instruct (70B). 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. Not covered: Llama 3.2 11B Vision Instruct (gated, tokenizer.json differs from the measured file, and no byte-identical ungated mirror was found) and Llama 3.2 Instruct (90B) (gated, tokenizer.json differs from the measured file, and no byte-identical ungated mirror was found).

What is the cheapest Llama 3 API price per token?

Of the 35 standard prices we hold for Llama 3 models, the lowest input price is $0.02 per 1M tokens (output $0.04), for Llama 3.1 8B Instruct on DeepInfra, read from the provider's pricing page on 2026-11-14. 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 3?

Modern Standard Arabic sentences take 1.66× the tokens of their English translations with this tokenizer (rank 12 of 16 on the same texts). Hindi takes 2.53× and Chinese 1.29×. Measured on parallel sentences in our open dataset (2026-11-15). Paste your own text above, or use the Arabic token counter.

Is the Llama 3 tokenizer the same as Llama 4?

No. On the 52 texts of our dataset they gave the same count on 2; in total Llama 3 needs 19.1% more tokens, and up to 79% on a single text. See the Llama 4 counter.

Does the count include chat-template tokens?

No. For Llama 3 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

Read as MarkdownAsk ChatGPTAsk ClaudeAsk Perplexity