Count tokens with the exact GPT encoders, estimate API cost, and check context limits. Nothing you type ever leaves your browser.
Loading exact encoders…
| Model | Tokenizer | Accuracy | List input price / 1M tokens | Cost for your text |
|---|
Accuracy labels: exact runs the official OpenAI encoder bundled with this page — counts match what that encoding bills. estimate uses cl100k_base as a proxy for Claude and Gemini, whose tokenizers are proprietary; expect a few percent drift, more for CJK and code.
Data verified: prices and context windows checked against official pricing pages on 19 November 2026 (openai.com/pricing, anthropic.com/pricing, ai.google.dev/pricing). Providers change prices and add caching/batch discounts — re-check before budgeting.
| Model | Context window | ≈ tokens of your text |
|---|
Output limits, beta extensions (e.g. 1M-token Claude beta) and pricing tiers differ per model — check the official docs.
Language models don't read text character by character — they read tokens: chunks of text produced by a tokenizer. A token is roughly 4 characters or 0.75 words of English, but the ratio varies: code, numbers and rare words split into more tokens, while common words ("the", "and") are single tokens. Chinese, Japanese and Korean text usually costs around one token per character, which makes CJK prompts significantly more expensive than English ones.
Each model family uses its own tokenizer. OpenAI models ship o200k_base (GPT-6, GPT-5, GPT-4o, GPT-4.1, o-series) and cl100k_base (GPT-4, GPT-3.5). This counter uses those exact encoders locally in your browser, so the counts match what the OpenAI API will bill you for. Claude and Gemini use their own tokenizers and are approximated here.
Three practical reasons: budgeting (API bills are per-token, and long system prompts multiply across every request), context limits (exceeding the window gets your text truncated or rejected), and engineering (RAG pipelines, caching and batching all depend on accurate token math). Counting before you send is the cheapest way to avoid surprise bills and silent truncation.
Read the full guide: What are tokens & how do they map to API cost? · Compare models: GPT-6 vs Claude 5.5 token cost
For English, roughly 4 characters or 0.75 words. For Chinese/Japanese/Korean it's closer to 1 token per character. The exact split depends on the tokenizer — paste your text above for a precise count.
GPT-6, GPT-5, GPT-4o, GPT-4.1 and o-series use o200k_base. GPT-4 and GPT-3.5 use cl100k_base. Claude and Gemini run proprietary tokenizers — this tool approximates them with cl100k_base, which is usually close but not exact.
No. Both encoders run entirely in your browser as static JavaScript. Your text never leaves your device — you can even disconnect from the network after the page loads.
They use public list prices (input tokens) as of November 2026. Providers change prices and add caching/batch discounts frequently — always confirm on the official pricing page before making budget decisions.