> Source: https://meetrix.io/features/llm-token-counter/
> Markdown copy of that page. Cite the URL above, not this file.

# LLM Token Counter

Count tokens for Llama, Qwen, Mistral, Gemma, DeepSeek and other open-weight LLMs online - free, no sign-up, and your text never leaves your browser.

This LLM token counter shows how many tokens your text uses in Llama, Qwen, Mistral, Gemma, DeepSeek, Phi and gpt-oss, using each model's own tokenizer. It is an open-weight token counter: exact counts for the models you can run yourself, side by side, with how much of each context window the text fills. Paste your text below. It is free, and your text is counted in your browser, never uploaded.

Your text or prompt

0 characters, 0 words

 Count as a chat message   

| Model | Tokens | Chars per token | Context window used |
| --- | --- | --- | --- |

Tick a model to count with it. Each tokenizer downloads once from Hugging Face (size shown) and is cached by your browser; your text is never uploaded.

### See the tokens

Type or paste some text to see how the selected model splits it.

## Why use this LLM token counter

#### Real tokenizers, exact counts

Every count comes from the model's own tokenizer files, not a characters-divided-by-four estimate.

#### Open-weight models side by side

Compare eight model families at once and see which one packs your language, code or data into the fewest tokens.

#### Your text stays private

Tokenizing happens in your browser. Prompts with customer data, contracts or source code are never uploaded.

#### See every token

The token view colors each piece of your text, so you can see why a word, number or emoji costs more than expected.

## How to count LLM tokens

1.  **Add your text.** Type or paste a prompt, a document or code into the box, or drop a .txt, .md, .json or code file on it.
2.  **Pick the models.** Tick the models you want to compare. Llama 3, Qwen3 and Mistral 7B are on by default; the first count with each one downloads its tokenizer.
3.  **Choose raw text or a chat message.** Leave "Count as a chat message" off to count the text alone. Turn it on to add the special tokens and default system prompt the model's chat template wraps around a user message.
4.  **Compare the counts.** Each row shows the token count, characters per token and how much of the model's context window the text fills.
5.  **Look at the tokens.** Pick a model under "See the tokens" to see exactly where it splits your text. Hover a piece for its token id.

## Common LLM token counter problems and fixes

-   **A model says it couldn't download the tokenizer:** the browser could not reach huggingface.co. A company proxy, a firewall or a strict content blocker can stop it. Try another network, or allow huggingface.co and its file host.
-   **My API bill shows more tokens than this:** real requests add the chat template, the system prompt, earlier turns of the conversation and any tool definitions. Turn on "Count as a chat message" for the template, and paste the whole conversation to count the rest.
-   **Ollama or llama.cpp reports a different prompt count:** they count the prompt after applying the model's chat template, plus any system prompt in the Modelfile. Compare against the chat message count, not the raw one.
-   **Non-English text uses far more tokens:** that is how tokenizers trained mostly on English behave, and the gap differs a lot by language. In our tests Gemma 3 was the most even across languages, Qwen and DeepSeek were the most efficient on Chinese, gpt-oss and Gemma 3 on Hindi, and Mistral 7B's small vocabulary used the most tokens almost everywhere. Compare the models on your own text.
-   **The page slows down with a huge paste:** counting stays fast, but the token view only draws the first 2,000 tokens. Untick models you don't need to cut the work further.
-   **Counts for Qwen2.5 and Qwen3 look the same:** they share one vocabulary, so ordinary text gets the same count. Only the special tokens differ, which shows up in chat message mode.

Planning to serve one of these models yourself? The [vLLM memory calculator](https://meetrix.io/features/vllm-memory-calculator/) turns a context length into GPU memory and concurrent requests, and the [GGUF viewer](https://meetrix.io/features/gguf-viewer/) shows a downloaded model's tokenizer, vocabulary and context length. The [JSON formatter](https://meetrix.io/features/json-formatter/) helps with prompts and API payloads in JSON. To run open-weight models on your own cloud, see [what self-hosted LLMs cost an enterprise](https://meetrix.io/blogs/self-hosted-llms-enterprise-cost/), or launch the [vLLM inference server](https://meetrix.io/store/vllm/) from the Meetrix store. You can also browse [all Meetrix features](https://meetrix.io/features/).

## Frequently Asked Questions

Is this LLM token counter free?

Yes. It is free, needs no account, and has no limit on how much text you count.

Is my text sent anywhere?

No. Your text is tokenized inside your browser and never uploaded. The only download is each model's public tokenizer file from Hugging Face, the first time you count with that model, and the request for it contains nothing you typed. The page records anonymous usage events (that a count ran, that counts were copied), never the text.

How accurate are the token counts?

Exact for the models listed. The counter runs each model's own tokenizer files, the same ones vLLM, Transformers and llama.cpp builds use, rather than estimating from characters or words.

Why do different models give different token counts?

Each model family has its own vocabulary, from 32,768 tokens in Mistral 7B to about 262,000 in Gemma 3. A larger vocabulary has more whole words and common phrases, so the same text usually takes fewer tokens. Code, numbers and non-English text show the biggest differences.

How many characters is one token?

For English prose, roughly 4 characters, or about three quarters of a word, with modern tokenizers. The Chars per token column shows the real ratio for your text. Code, tables, URLs and languages such as Chinese, Japanese or Hindi usually come out well under 4.

What does "Count as a chat message" add?

A chat model never sees bare text. Its chat template wraps each message in special tokens for the role and turn, and some templates add a default system prompt: Llama 3.2 adds a knowledge-cutoff and date header, and Mistral Small 3 and gpt-oss add longer system text. With the option on, the count is what a single user message really costs in a request.

Can I count tokens for GPT-4o or ChatGPT?

Use the gpt-oss row. gpt-oss uses OpenAI's o200k encoding, the same one GPT-4o uses, so ordinary text gets the same count. Chat requests to OpenAI's API add their own formatting tokens on top.

Can I count tokens for Claude or Gemini?

Not here. Their tokenizers are not published, so no browser tool can count them exactly. Anthropic and Google each offer a token counting endpoint in their APIs. For a rough figure, the gpt-oss or Gemma 3 counts are usually in the same range.

Will my prompt fit in the context window?

The Context window used column shows the share of each model's default window your text fills, and turns red over 100%. The window has to hold the prompt and the reply, so leave room for the output. When self-hosting, the window you can actually use is set by `--max-model-len`; the [vLLM memory calculator](https://meetrix.io/features/vllm-memory-calculator/) shows what fits on a given GPU.

Why is the first count slow?

The first count with each model downloads its tokenizer, between 2 MB (Mistral 7B) and 33 MB (Gemma 3). Your browser caches it, so later counts with that model are instant, even after you reload the page.

How do I count tokens in Python?

With Hugging Face Transformers: load the tokenizer with `AutoTokenizer.from_pretrained("Qwen/Qwen3-0.6B")`, then take `len(tokenizer.encode(text, add_special_tokens=False))`. For a chat message, count the output of `tokenizer.apply_chat_template(messages, add_generation_prompt=True)` instead. This page runs the JavaScript port of the same library.

Does it work with long documents?

Yes. Paste or open files up to 20 MB and every token is counted. The token view shows the first 2,000 tokens so the page stays responsive.

Meetrix Store

Self-host the open source software your team already uses, on your own AWS or Google Cloud account.

 [vLLM Serve open models on your own GPU](https://meetrix.io/store/vllm/) [Browse the store](https://meetrix.io/store/)

## Run open source tools on your own cloud

Meetrix Store has pre-configured images for Jitsi Meet, Coturn, RustDesk, OpenVPN and 40+ more open source tools, ready to launch on AWS or Google Cloud in minutes.

[Browse the store](https://meetrix.io/store/) [Talk to Us](https://meetrix.io/contact-us/)

Meetrix Store New

Open source tools, ready to launch on your own AWS or Google Cloud.

-    [vLLM Serve open models on your own GPU](https://meetrix.io/store/vllm/)
-    [OpenWebUI A private ChatGPT-style assistant](https://meetrix.io/store/openwebui/)
-    [LocalAI OpenAI-compatible text, image and audio models, on CPU or GPU](https://meetrix.io/store/localai/)
-    [Llama 4 Scout Mixture-of-Experts, 17B active parameters](https://meetrix.io/store/llama-4-scout/)
-    [Jitsi Meet Self-hosted video calls for 50 to 500 users](https://meetrix.io/store/jitsi-meet/)
-    [RustDesk Remote desktop AMI, a TeamViewer alternative](https://meetrix.io/store/rustdesk/)

[Browse all products](https://meetrix.io/store/)
