Developer

Token Counter & Cost Calculator: GPT, Claude, Gemini, DeepSeek and more

Free token counter for 29 AI models: GPT-6, Claude, Gemini, Grok, DeepSeek, Qwen, Kimi, Mistral and more. Exact counts, API cost and context fit in-browser.

Counting runs in your browser. Text only leaves your device if you turn on Exact count for a provider model.

Counting runs in your browser and your text is never stored. It only leaves your device if you turn on Exact count, which sends it to the model's provider to count.

0

Characters

0

Words

0

GPT-4o tokens (exact)

0

Tokens / word

500 output tokens

Cost and context-fit assume the model also generates this many output tokens.

ModelTokensInput costTotal costContext fit
GPT-6 Astraestimate
OpenAI
0$0.00$0.0250—
GPT-6.1 Solestimate
OpenAI
0$0.00$0.00500—
GPT-6 Lunaestimate
OpenAI
0$0.00$0.00025—
GPT-4o
OpenAI
0$0.00$0.00500—
GPT-4o mini
OpenAI
0$0.00$0.00030—
Claude Fable 5.1estimate
Anthropic
0$0.00$0.0250—
Claude Opus 5.5estimate
Anthropic
0$0.00$0.0100—
Claude Sonnet 5.5estimate
Anthropic
0$0.00$0.00500—
Claude Haiku 4.5estimate
Anthropic
0$0.00$0.00250—
Gemini 3.1 Pro (preview)estimate
Google
0$0.00$0.00600—
Gemini 3.8 Flashestimate
Google
0$0.00$0.00187—
Gemini 3.6 Flashestimate
Google
0$0.00$0.00187—
Gemini 3.5 Flash-Liteestimate
Google
0$0.00$0.00125—
Grok 4.7estimate
xAI
0$0.00$0.00300—
Grok 4.3estimate
xAI
0$0.00$0.00125—
gpt-oss-120b
OpenAI
0n/an/a—
gpt-oss-20b
OpenAI
0n/an/a—
DeepSeek V4.1 Flashestimate
DeepSeek
0$0.00$0.00060—
DeepSeek V4 Proestimate
DeepSeek
0$0.00$0.00198—
Qwen3.8 Maxestimate
Alibaba (Qwen)
0$0.00$0.00300—
Qwen3.8 Flashestimate
Alibaba (Qwen)
0$0.00$0.00023—
GLM-5.3estimate
Z.ai
0$0.00$0.00220—
GLM-5.3 Flashestimate
Z.ai
0$0.00$0.00025—
Mistral Small 4estimate
Mistral
0$0.00$0.00030—
Mistral Medium 3.5estimate
Mistral
0$0.00$0.00375—
Kimi K3estimate
Moonshot AI
0$0.00$0.00750—
Kimi K2.6estimate
Moonshot AI
0$0.00$0.00200—
Gemma 4 31Bestimate
Google
0n/an/a—
Muse Glimmer 30Bestimate
Meta
0n/an/a—

Pricing & context limits as of 2026-10-07. Verify against each provider before relying on cost estimates.

estimate= approximate count. Open-weight models turn exact when you pick them; others via Exact count.


What is a token?

A token is the unit large language models read and bill in — not a word, not a character. It's a chunk of text produced by the model's tokenizer, often a whole short word, a word-piece, or a single punctuation mark. As a rough rule of thumb, 1 token ≈ 4 characters of English ≈ ¾ of a word, but the real number depends entirely on the text: code, emoji, and non-English scripts tokenize very differently.

This tool counts tokens the way the models actually do, using OpenAI's openly-published tokenizers, then turns that count into the two answers you really need: what it costs and whether it fits.

Why count tokens?

Two reasons, and they're the whole job of this tool:

  1. Cost. Every API charges per token — separately for the prompt you send (input) and the reply you get back (output). A prompt that looks small can get expensive at scale. Counting first means no surprise bills.
  2. Context limits. Every model has a maximum context window — the total tokens it can consider at once (input plus the reply). Go over it and the request fails or silently truncates. Counting first means no cut-off prompts.

Pick your model

Choose the model you plan to call in Count tokens for. The token count, tokens per word, cost and context headroom above the table then follow that model, and its row is highlighted in the comparison table so you can still see every other model side by side.

How to read the cost estimate

  • Input cost is your prompt's tokens × the model's input price.
  • Total cost adds the reply: it assumes the model generates the number of output tokens you reserve with the "Reserve room for the reply" buttons. Set that to your realistic expected answer length.
  • Prices are listed per million tokens by every provider; the tool does the division for you.

Costs are shown in USD because that's how the providers publish them. These are costs for one request. To turn them into a daily or monthly bill (requests per day, typical reply length), use the LLM Cost Calculator, which compares every priced model at once.

Context fit

The Context fit column shows whether your input — plus the reply you reserved room for — stays inside each model's window. Green means it fits, with the remaining headroom shown. Red means it exceeds the window, with the overflow amount. A bigger window (1M tokens on current Gemini and most Claude models) isn't always cheaper, so weigh fit against the cost columns.

Why some counts are "estimate"

GPT-4o and GPT-4o mini counts are exact, because their tokenizer (o200k_base) is public and runs in your browser. The newer GPT-6 models, Claude, Gemini and Grok have no tokenizer available in the browser, so their rows start from the closest open encoding and are clearly labelled estimate. Those estimates are calibrated: adjusted with factors measured against each provider's exact counts over a varied set of test texts, and re-measured regularly. Treat them as close, not as a billing guarantee; for the exact number, use Exact count below.

Exact counts for open-weight models, in your browser

DeepSeek, Qwen, GLM, Mistral, Kimi, Gemma, Meta Muse Glimmer and gpt-oss publish their tokenizers. When you pick one of these models, the Token Counter downloads that model's own tokenizer from ziptools.dev (once per visit) and counts in your browser, so the number is exact and your text never leaves your device. Every tokenizer file is checked against the official Python tokenizer on a set of test texts and must match token for token. Counts are for your raw text; a chat API adds a few tokens to wrap each message. Tokenizer files come from each model's Hugging Face repository under its own licence (shipped next to each file in /tokenizers/).

Exact counts from the provider

For models whose tokenizer isn't public, the only exact count comes from the provider's own counting API: Anthropic for Claude, OpenAI for GPT-6, Google for Gemini and xAI for Grok. Select one of those models and turn on Exact count. Your text is then sent through ziptools.dev to that provider's token-counting API each time it changes, and the exact count replaces the estimate in the cards, cost and context fit. These APIs only count; no model reads or answers your text, and ZipTools doesn't store or log it. It's off by default, and the switch is remembered on your device. Newer Claude models (4.7 and later, Fable 5.1 among them) use a tokenizer that produces roughly 30% more tokens than earlier ones, according to Anthropic's docs, so the exact count is worth checking before you budget.

FAQ

How accurate is the token count? It depends on the model. GPT-4o, GPT-4o mini, gpt-oss and the open-weight models (DeepSeek, Qwen, GLM, Mistral, Kimi, Gemma and Muse Glimmer) are exact: their own tokenizers run in your browser and are checked token for token against the official ones. GPT-6, Claude, Gemini and Grok have no public tokenizer, so they show a calibrated, labelled estimate. Turn on Exact count to get the provider's own number.

How do I count Claude, Gemini, GPT-6 or Grok tokens exactly? Pick the model, then turn on Exact count. The tool asks Anthropic, Google, OpenAI or xAI for the exact number through their own token-counting APIs. Those APIs only count: no model reads or answers your text.

Does my text get uploaded? Not unless you ask. Counting happens in your browser. The one exception is Exact count: when you turn it on, your text is sent to the selected model's provider (Anthropic, OpenAI, Google or xAI) through ziptools.dev, to its token-counting API. We don't store or log it, and no model ever reads or answers it.

Which models are supported? GPT-6 Astra, GPT-6.1 Sol, GPT-6 Luna, GPT-4o, GPT-4o mini, Claude Fable 5.1, Claude Opus 5.5, Claude Sonnet 5.5, Claude Haiku 4.5, Gemini 3.1 Pro (preview), Gemini 3.8 Flash, Gemini 3.6 Flash, Gemini 3.5 Flash-Lite, Grok 4.7, Grok 4.3, gpt-oss-120b, gpt-oss-20b, DeepSeek V4.1 Flash, DeepSeek V4 Pro, Qwen3.8 Max, Qwen3.8 Flash, GLM-5.3, GLM-5.3 Flash, Mistral Small 4, Mistral Medium 3.5, Kimi K3, Kimi K2.6, Gemma 4 31B and Muse Glimmer 30B. Open-weight models without a first-party API show the cost as n/a.

Is the Token Counter free? Yes. It's free, needs no account or signup, and the counting runs in your browser.

Why might the price be wrong? Model prices change. Every result is stamped with a "pricing as of" date. If it's old, double-check the provider's current pricing page before relying on the numbers.

Is anything stored on my device? Only one setting: whether Exact count is on, saved in your browser's local storage so it stays the way you left it. The tool keeps no history and never stores your text.

Cookies for ads only

Tool data never leaves your browser. We use cookies only for Google AdSense. Privacy.