---
title: "Qwen token counter: real Qwen3.8 tokenizer | BroadRouter"
description: "Count Qwen tokens with the official Qwen3.8 27B tokenizer in your browser. See each token, the chat-template tokens and the cost of your prompt."
url: https://broadrouter.com/tools/qwen-token-counter/
lang: en
updated: 2026-11-15
publisher: BroadRouter (a BroadNet site); API by BroadNet Inference, https://inference.broadnet.ai
---

# Qwen token counter

Updated 2026-11-15

**In short:** This counter loads the tokenizer.json from the Qwen/Qwen3.8-27B repository, so the count is what the model reads. Its vocabulary has 248,077 token IDs, one of the largest here, and it is the most compact of the five we measured on Modern Standard Arabic (about 183 tokens per 100 words).

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 countيقسّم النموذج اللغوي كل نص يصله إلى وحدات صغيرة تُسمّى الرموز قبل أن يقرأه. قد يكون الرمز كلمة كاملة أو جزءاً من كلمة أو مسافة أو رقماً أو علامة ترقيم. وتُحسب تكلفة الطلب بعدد هذه الرموز، لذلك يدفع المستخدم أكثر كلما احتاج النص إلى رموز أكثر. تحتاج اللغة العربية عادةً إلى رموز أكثر من الإنجليزية لنقل المعنى نفسه، لأن كثيراً من أدوات تقسيم النصوص دُرّبت في الأساس على نصوص إنجليزية. فالكلمة العربية تحمل السوابق واللواحق، مثل أداة التعريف وحروف العطف والضمائر المتصلة، فتتجزأ إلى عدة قطع. وكلما كانت مفردات أداة التقسيم أوسع وأكثر تنوعاً في اللغات، قلّ عدد الرموز التي تحتاجها الجملة العربية. لهذا السبب لا يكفي أن نقدّر التكلفة بقاعدة عامة مأخوذة من النصوص الإنجليزية. الأفضل أن نعدّ الرموز بأداة التقسيم الخاصة بالنموذج الذي سنستخدمه فعلاً، ثم نقارن النتائج بين النماذج المختلفة. قد يكون نموذج أرخص سعراً لكل مليون رمز أغلى في الواقع إذا احتاج إلى ضعف عدد الرموز للنص العربي نفسه. ويُقاس حجم نافذة السياق بالرموز أيضاً. فإذا كان المستند العربي طويلاً، مثل عقد أو تقرير سنوي، فعلينا التأكد من أن النص والتعليمات والإجابة المتوقعة تتسع جميعها داخل حدود النافذة.

…

tokens

Show tokens forQwen3.8 27B — Qwen3.8 27B tokenizerDeepSeek V4.1 Flash — DeepSeek V4.1 Flash tokenizerGLM 5.3 — GLM 5.3 tokenizerGemma 4 VL 26B — Gemma 4 tokenizer (Google base model)GPT (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 |
| --- | --- | --- | --- | --- |
| **Qwen3.8 27B** · Qwen3.8 27B tokenizer | … | … | … | … |
| **DeepSeek V4.1 Flash** · DeepSeek V4.1 Flash tokenizer | … | … | … | … |
| **GLM 5.3** · GLM 5.3 tokenizer | … | … | … | … |
| **Gemma 4 VL 26B** · Gemma 4 tokenizer (Google base model) | … | … | … | … |
| **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-qwen-token-counter&utm_content=tool) ·

Other counters: [DeepSeek](https://broadrouter.com/tools/deepseek-token-counter/) · [GLM](https://broadrouter.com/tools/glm-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/) · [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%20Qwen%20token%20counter&body=Page%3A%20https%3A%2F%2Fbroadrouter.com%2Ftools%2Fqwen-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 Qwen3.8 27B tokenizer is preselected and downloads once (13 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 Qwen tokenizer

Qwen3.8 uses a byte-level BPE tokenizer with 248,044 learned tokens, almost double the size of DeepSeek's. It applies NFC normalisation and keeps combining marks with their letters, which helps Arabic diacritics and Indic scripts. Unlike GLM and DeepSeek it splits numbers into single digits, so long numbers cost more tokens.

On Modern Standard Arabic sentences Qwen needs only 1.31× the tokens of the English translations, the lowest Arabic tax of the BroadNet models we measured. Its larger vocabulary means a 13 MB download the first time you use it.

| Qwen tokenizer facts |  |
| --- | --- |
| Tokenizer | Qwen3.8 27B tokenizer |
| Source | Qwen/Qwen3.8-27B (commit 3756181) |
| Token IDs | 248,077 (248,044 in the base vocabulary) |
| Context window | 262,144 tokens |
| Price per 1M tokens | $0.175 input · $2.17 output |
| English prose | 132 tokens per 100 words (rank 5 of 5) |
| Arabic | 183 tokens per 100 words (rank 1 of 5) |
| Python code | 215 tokens per 100 words (rank 4 of 5) |
| Download | 13 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 Qwen3.8 27B tokenizer splits it into 298 tokens. Sent to [Qwen3.8 27B](https://broadrouter.com/models/qwen3.8-27b/) as a prompt it costs $0.000052; written by the model as an answer it costs $0.00065. Prices are per one million tokens, so multiply the count by the price and divide by 1,000,000.

## Questions

### Which tokenizer does Qwen3.8 27B use?

A byte-level BPE tokenizer with 248,077 token IDs, published as tokenizer.json in the [Qwen/Qwen3.8-27B](https://huggingface.co/Qwen/Qwen3.8-27B) repository. This page loads that file, pinned to commit 3756181.

### Why does Qwen use more tokens for numbers?

Its pre-tokenizer splits every digit into its own piece before merging, so 2026 is four tokens. DeepSeek and GLM group up to three digits. Number-heavy JSON or tables therefore cost a little more on Qwen.

### How many tokens does the Qwen chat template add?

About 52 tokens for one user message with the official template's defaults, because the template writes a reasoning-effort instruction into the system turn. The <|im\_start|> and <|im\_end|> markers are one token each.

### Is Qwen cheaper for Arabic?

Per token it is priced at $0.175 per 1M input and $2.17 per 1M output. Its tokenizer also needs fewer tokens for Arabic than DeepSeek or GLM in our measurements, so Arabic prompts cost less than the price alone suggests. BroadNet tested it in Arabic and Gulf and Egyptian dialects: [Qwen3.8 27B](https://broadrouter.com/models/qwen3.8-27b/).

### How much fits in Qwen3.8's context window?

262,144 tokens, prompt and answer together: roughly 198.594 thousand English words. Use the [context window calculator](https://broadrouter.com/tools/context-window-calculator/) to check a file.

## Go deeper

-   [Qwen3.8 27B: price, context and setup](https://broadrouter.com/models/qwen3.8-27b/)
-   [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-qwen-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-qwen-token-counter&utm_content=sources)
-   [Qwen/Qwen3.8-27B on Hugging Face (tokenizer.json)](https://huggingface.co/Qwen/Qwen3.8-27B)
