Token Counter

By JXXR1 · Updated 20 October 2026

Estimate token counts for GPT-4o, GPT-3.5 Turbo, Claude Sonnet 5, Gemini 3.1 Flash-Lite and Mistral Large. Paste text, see counts per model side-by-side. Files never leave your browser.

ModelTokensInput $/1MCost (this text)

Prices as of 20 Oct 2026. Input prices per 1M tokens, standard tier.

Prices change: check the provider's pricing page for current rates: OpenAI, Anthropic, Google Gemini, Mistral.

Estimates only. This page doesn't run any provider's real tokenizer, so every count (OpenAI, Anthropic, Google and Mistral alike) is an approximation from character counts. For exact counts, use the provider's own tokenizer or token-counting endpoint.

Why token counts vary by model

Every interaction with an LLM is metered in tokens — sub-word units that the model's tokenizer carves from your text. Tokens drive both context-window limits ("does this fit?") and pricing ("how much will this cost?"). The exact count depends on the model's tokenizer, which you usually don't have at hand. This tool gives you a fast estimate for each of the five models listed side-by-side, plus the dollar cost for the input text against each model's published per-token price.

Budget, cost, and context-window planning

Heuristic accuracy vs real tokenizers

Pricing and the output multiplier

Tokens, words, whitespace, and CJK

Sizing a batch job

Paste a 500-word prompt and the tool estimates roughly 650–700 tokens — English runs about 1.3 tokens per word — then multiplies by each model's published input price so you can see the cost per model side by side. Multiply that by the 100 inputs in your batch job and you know the bill before you spend a cent.

Accuracy, output billing, and whitespace traps

How accurate is the count? It's a heuristic, not the model's real tokenizer, so treat it as sizing rather than billing truth — we haven't measured it against every provider's tokenizer, so allow a wide margin, especially for code, JSON and non-English text.

Why do models disagree on the count? Each model carves text with its own tokenizer, so the same string splits into a different number of sub-word units — and therefore a different price.

Does this include output tokens? No — it measures your input text only. Output is billed separately and usually at a higher rate, so leave headroom in your estimate.

Do spaces and line breaks count? Yes — whitespace becomes tokens too. That's why a stray BOM marker or copy-paste noise can quietly inflate a count and trip a context-window limit.

Chars, tokens, words — the rough conversions that matter for cost

LLMs bill by token, not word, and a token is roughly a common word-chunk of about four characters of English. That gives usable back-of-envelope conversions, but the ratio shifts hard by content type:

ContentRough chars/token100 tokens ≈
Plain English prose~4~75 words
Code / JSON~3 (denser)Far fewer “words”; braces & punctuation each cost a token
Rare words, other languages, emoji<2One emoji or CJK glyph can be several tokens

Two traps: (1) whitespace and punctuation are tokens too, so minifying JSON genuinely cuts cost; (2) the same prompt tokenises differently across model families — treat any “words × 1.3” estimate as a ceiling to budget against, not an exact bill.

Context window budgeting in practice

A common mistake is sizing only the user prompt against the context limit. In reality, the window must hold the system prompt, all prior conversation turns, tool-call results, and the model's own output. Paste your system prompt here first to see its baseline cost, then add representative user messages to estimate the per-turn overhead. Reserve at least 30% of the window for the model's reply — a tight budget forces truncated or degraded output even when the input technically fits.

Comparing tokenisation across model families

The side-by-side layout is the point of this tool. A 500-word English paragraph might tokenise to 650 tokens on GPT-4 and 620 on Claude because their BPE vocabularies differ. For most planning purposes the gap is negligible, but for budget-sensitive batch workloads the difference compounds across thousands of calls. Scan the per-model row to find the cheapest option that meets your quality bar.

Estimating output cost separately

This tool measures input tokens only. Output tokens — the model’s reply — are billed at a higher per-token rate on every major provider. For a rough total-cost estimate, multiply the input cost shown here by three to five depending on expected reply length. If your application generates long structured outputs (reports, code, JSON payloads), the output share dominates the bill and deserves its own estimate.