I wrote one 150-word paragraph in English and counted its tokens with 12 different tokenizers. All 12 came back with 167 to 169 tokens. Then I counted the same paragraph in Hindi. OpenAI's o200k tokenizer, the one GPT-4o, GPT-4.1 and GPT-5 use, needed 268 tokens. Qwen3's tokenizer needed 820 for the identical text. That's 1.6 times the English count on one and 4.9 times on the other, for the same meaning.

People call this the tokenizer tax. You're billed per token and your context window is measured in tokens, but what you actually send is text. How much text fits in a token depends on the tokenizer, the language and the shape of the content. I wanted real numbers for my own work, which goes back and forth between Portuguese prompts, English docs, TypeScript and a lot of JSON. So I measured it locally, for free, without calling any API.

What I measured

The corpus has 11 samples. I wrote all of them myself for this test, so there are no licensing questions and anyone can reuse them:

  • An English paragraph (830 characters) about a weekend retry storm in a payments service.
  • The same paragraph translated by me into Brazilian Portuguese, Spanish, Japanese and Hindi. I write Portuguese natively and Spanish well. The Japanese and Hindi are careful translations, not native writing.
  • A Python retry helper with exponential backoff (1,600 characters) and the same logic in TypeScript (1,614).
  • One log-summary JSON object, saved twice from the same data: pretty-printed with a two-space indent (1,215 characters) and minified (856).
  • A markdown latency table (587 characters).
  • An emoji-heavy Slack-style recap of the same incident (389 characters).

The tokenizers were tiktoken's o200k_base and cl100k_base, plus the tokenizer.json files from these Hugging Face repos: GPT-2, Qwen2.5, Qwen3, Qwen3.8-27B, DeepSeek-V3, DeepSeek-V4.1-Flash-1017, Mistral 7B v0.3, Mistral Nemo, Mistral Small 4 and Mistral Large 4. I downloaded every file anonymously and pinned the commit hashes. I also tried Llama 3.1 and Gemma 3, but both repos are gated and returned a 401 without a login, so I left them out.

I counted the raw text only, with no special tokens and no chat template. Here are the counts for eight of the twelve. The other four turned out to be duplicates, which I'll get to.

Sample Chars o200k cl100k GPT-2 Qwen3 Qwen3.8 DeepSeek V4.1 Mistral 7B v0.3 Mistral Large 4
English prose 830 167 167 169 167 167 169 168 168
Portuguese (BR) prose 955 202 248 351 243 204 245 303 198
Spanish prose 951 205 231 328 230 205 237 278 206
Japanese prose 396 301 411 541 253 196 264 447 306
Hindi prose 859 268 896 1,297 820 383 539 924 303
Python 1,600 393 389 709 391 416 431 505 412
TypeScript 1,614 429 428 564 432 476 451 529 447
JSON, pretty (indent 2) 1,215 445 444 652 514 571 456 604 449
JSON, minified 856 294 287 314 357 357 310 409 293
Markdown table 587 268 268 259 330 338 263 345 263
Emoji-heavy message 389 162 194 199 159 193 169 239 171

English is the one place where every tokenizer agrees. Even GPT-2, from 2019, with a 50,257-entry vocabulary, lands within two tokens of the modern ones. Everything interesting happens once the text stops being plain English.

The language tax, Portuguese included

Portuguese is the case I care about most, because many of my prompts start in Portuguese. On o200k, the Portuguese paragraph took 202 tokens, 1.21 times the English count. Most of that isn't the tokenizer's fault: the Portuguese text is 955 characters against 830, so it's simply 15% longer. Per 1,000 characters, o200k spends 211.5 tokens on Portuguese and 201.2 on English, which is nearly the same.

Qwen3, DeepSeek and cl100k behave differently. All three spend about 1.45 to 1.49 times the English count on the same paragraph: 243, 245 and 248 tokens. Mistral 7B v0.3, with a 32,768-token vocabulary, needs 1.80 times. GPT-2 needs 2.08. Mistral Large 4 does best here at 198 tokens, or 1.18 times. Spanish follows almost the same pattern: 205 tokens on o200k and 230 on Qwen3.

For a Brazilian developer, then, writing the prompt in Portuguese costs about 20% more on o200k or Mistral Large 4 and about 45% more on Qwen3 or DeepSeek. I didn't expect a gap that size between vendors on a major Latin-script language.

Bar chart of one translated paragraph as a multiple of its English token count. Portuguese and Spanish stay near 1.2 times on o200k. Hindi runs from 1.6 times on o200k to 4.9 times on Qwen2.5 and Qwen3, and 7.7 times on GPT-2.

Hindi is where the spread blows up. These are the tokens for the same 859-character paragraph:

  • o200k: 268 (1.60x English)
  • Mistral Large 4: 303 (1.80x)
  • Mistral Nemo / Small 4: 333 (1.99x)
  • Qwen3.8: 383 (2.29x)
  • DeepSeek V3 / V4.1: 539 (3.19x)
  • Qwen2.5 / Qwen3: 820 (4.91x)
  • cl100k: 896 (5.37x)
  • Mistral 7B v0.3: 924 (5.50x)
  • GPT-2: 1,297 (7.67x)

The move from cl100k to o200k alone cut Hindi from 896 tokens to 268, a 70% drop for the same text. If you priced a Hindi feature back in the GPT-4 days, your numbers are off by roughly a factor of three.

Japanese needs a different reading. It's dense in characters: the whole paragraph is 396 characters, so "tokens per 1,000 characters" makes it look terrible on every tokenizer. Compare it to the English instead and the newer Qwen tokenizer wins clearly. Qwen3.8 needs 196 tokens (1.17x), Qwen3 needs 253 and o200k needs 301.

Code, JSON and tables

Code was less dramatic than I expected. On the Python file, o200k, cl100k and Qwen3 all land between 389 and 393 tokens. DeepSeek needs 431 and Mistral Large 4 needs 412. GPT-2 needs 709 because it has no tokens for runs of spaces, so indentation gets split one space at a time. A single line of return result indented eight spaces is 9 tokens on GPT-2 and 3 on o200k. The TypeScript file shows the same picture: 428 to 432 tokens on the first three tokenizers and 564 on GPT-2.

JSON is where I'd change my habits. It's the same data saved two ways, and pretty-printing adds 42% more characters. The token cost is worse than that:

  • o200k: 445 pretty vs 294 minified (+51%)
  • cl100k: 444 vs 287 (+55%)
  • Mistral Large 4: 449 vs 293 (+53%)
  • DeepSeek: 456 vs 310 (+47%)
  • Qwen3: 514 vs 357 (+44%)
  • Qwen3.8: 571 vs 357 (+60%)
  • GPT-2: 652 vs 314 (+108%)

The comparison that stuck with me: on o200k, pretty-printing a JSON payload costs more extra tokens (+51%) than translating my paragraph from English to Portuguese (+21%). I've spent more time worrying about the second one.

The markdown table was the densest non-CJK sample I had. On o200k it costs 456.6 tokens per 1,000 characters, 2.27 times the rate for English prose. Pipes, digits with thousands separators and short cells don't merge into long tokens. One small oddity: GPT-2 used 259 tokens on the table, fewer than o200k's 268. It was the only sample where the oldest tokenizer won.

Emoji were roughly even on the newer vocabularies. The 389-character recap took 159 tokens on Qwen3 and 162 on o200k, but 229 on Mistral Nemo and 239 on Mistral 7B.

Heatmap of token counts relative to o200k. English stays near 1.0 on every tokenizer. Hindi is the hot row, 3.34 times on cl100k and 4.84 times on GPT-2. Japanese on Qwen3.8 is 0.65 times o200k, the lowest cell.

Same tokenizer, different label, and one that changed

Three pairs of tokenizers produced identical counts on all 11 samples:

  • Qwen2.5 and Qwen3
  • DeepSeek-V3 and DeepSeek-V4.1-Flash-1017
  • Mistral Nemo and Mistral Small 4

A new model name doesn't mean a new tokenizer. If you already measured your prompts against DeepSeek-V3, those counts still hold for the V4.1 Flash model DeepSeek's API serves today.

Qwen3.8 is the exception. Its vocabulary grew from 151,669 entries to 248,077, and it's a real trade-off. Hindi dropped from 820 tokens to 383 (−53%), Japanese from 253 to 196, and Portuguese from 243 to 204. In return, Python went from 391 to 416, TypeScript from 432 to 476, pretty JSON from 514 to 571 and the emoji recap from 159 to 193. If your traffic is mostly code and JSON, switching from Qwen3 to Qwen3.8 means more tokens per request, not fewer.

What it does to the bill

Token counts only matter once you multiply them by a price. I took published input list prices for five API models whose tokenizer I could match to one I measured. The o200k match for GPT-5 comes from tiktoken's own model mapping. OpenAI's pricing page marks gpt-5 deprecated, and the input list price it still shows is $1.25 per 1M tokens. The other four prices below are current. The DeepSeek API serves DeepSeek-V4.1-Flash-1017, and Qwen3.8-27B, Mistral Large 4 and Mistral Small 4 publish their tokenizers with their open weights. These are input prices only, accessed November 16, 2026:

Multiplying my measured tokens-per-character by those published prices gives the illustrative input cost of 1 million characters of each kind of content. I made no API calls to get these.

Sample gpt-5, deprecated ($1.25/M) deepseek-flash ($0.30/M) qwen3.8-27b ($0.50/M) mistral-large-4 ($0.70/M) mistral-small-4 ($0.15/M)
English prose $0.252 $0.061 $0.101 $0.142 $0.030
Portuguese (BR) prose $0.264 $0.077 $0.107 $0.145 $0.034
Japanese prose $0.950 $0.200 $0.247 $0.541 $0.110
Hindi prose $0.390 $0.188 $0.223 $0.247 $0.058
Python $0.307 $0.081 $0.130 $0.180 $0.040
JSON, pretty (indent 2) $0.458 $0.113 $0.235 $0.259 $0.065
JSON, minified $0.429 $0.109 $0.209 $0.240 $0.066
Markdown table $0.571 $0.134 $0.288 $0.314 $0.085

Two things in this table surprised me.

First, the list price swamps the tokenizer when you compare vendors. DeepSeek's tokenizer is one of the worst for Hindi in my test at 3.19 times English. Even so, sending the Hindi version of my paragraph to deepseek-flash costs $0.195 per million English-equivalent characters, while sending the English original to gpt-5 costs $0.252. The tokenizer tax matters within one vendor's lineup and for fitting text into a context window. Across vendors, the per-token price is usually the bigger lever.

Second, cost per character can mislead. Minified JSON looks slightly more expensive per character than pretty JSON on mistral-small-4 ($0.066 vs $0.065), because minifying strips out the cheap whitespace. But the minified file has 30% fewer characters, so the same data still costs fewer tokens: 379 against 523 on Small 4's tokenizer. Japanese has the opposite problem. Per character it looks almost four times as costly as English on gpt-5, but per unit of meaning the gap is 1.80x. When you're comparing the same content in different forms, compare tokens per document, not per character.

What I'm changing

  • I minify JSON before it goes into a prompt, unless a human needs to read the log. On o200k, cl100k, DeepSeek, Qwen3.8 and both current Mistral tokenizers, minifying saved more than translating my Portuguese paragraph to English would have.
  • I count tokens with the tokenizer of the model I'm actually using. Measuring Hindi with cl100k would overstate o200k usage by 3.3x, and measuring Qwen3.8 code with Qwen3 counts would understate it.
  • I don't rewrite my Portuguese prompts in English for cost. On o200k and Mistral Large 4 the difference is about 20%, and most of it is that Portuguese is the wordier language.
  • When a vendor ships a new model, I check whether the tokenizer actually changed before re-benchmarking. In three of the pairs I tested, it hadn't.

Limitations of this test

This is one paragraph per language, about 150 English words, so the language ratios are a single data point each, not an average over a real corpus. They will move with topic: my paragraph is technical and full of loanwords like "logs" and "job", which probably helps the Portuguese count. The Japanese and Hindi translations are mine, not native writing, and a native speaker would likely phrase things differently and land on a different count. I counted raw text without the chat template, so every real request adds a fixed overhead of role and formatting tokens, which matters more for short messages. The price mapping assumes the hosted model uses exactly the tokenizer published with its open weights, or the one tiktoken maps for GPT-5. I didn't verify that against a billed request, on purpose, since this test was meant to cost $0. Llama and Gemma are missing because their repos require a login.

How to reproduce

The measurement scripts and the data they wrote are not published. The libraries are pinned, and the count itself is two lines per tokenizer:

python3 -m venv .venv && . .venv/bin/activate
pip install tiktoken==0.14.0 tokenizers==0.23.3 huggingface_hub matplotlib
len(tiktoken.get_encoding("o200k_base").encode(text, disallowed_special=()))
len(Tokenizer.from_file(path).encode(text, add_special_tokens=False).ids)

tiktoken==0.14.0 supplies o200k_base and cl100k_base. tokenizers==0.23.3 loads each Hugging Face tokenizer.json named above. Both lines count the raw text, with no special tokens and no chat template.