o200k_base
The encoding used by OpenAI's current generation, including the GPT-5 family and GPT-4o. Every OpenAI model in this tool counts with o200k_base, so its token counts are Exact.
Count tokens for OpenAI models exactly, in your browser. This calculator counts with the same o200k_base encoding OpenAI's current models use (via gpt-tokenizer), so supported OpenAI counts are labeled Exact — then it estimates API cost and checks context-window fit.
Private by default · No signup · Local token counting where supported · Exact and estimated results clearly labeled
Your text is processed in your browser for supported local tokenizers. We do not store pasted prompts.
Compare the current prompt, expected output, and monthly call volume across supported OpenAI models.
| Model | Accuracy | Prompt tokens | Per-call cost | Monthly cost | Context fit |
|---|---|---|---|---|---|
| OpenAI · GPT-5.5gpt-5.5 | Exact | — | — | — | — |
| OpenAI · GPT-5.4gpt-5.4 | Exact | — | — | — | — |
| OpenAI · GPT-5.4 minigpt-5.4-mini | Exact | — | — | — | — |
| OpenAI · GPT-5.4 nanogpt-5.4-nano | Exact | — | — | — | — |
| Anthropic · Claude Fable 5claude-fable-5 | Estimated | — | — | — | — |
| Anthropic · Claude Opus 4.8claude-opus-4-8 | Estimated | — | — | — | — |
| Anthropic · Claude Sonnet 5claude-sonnet-5 | Estimated | — | — | — | — |
| Anthropic · Claude Sonnet 4.6claude-sonnet-4-6 | Estimated | — | — | — | — |
| Anthropic · Claude Opus 4.6claude-opus-4-6 | Estimated | — | — | — | — |
| Anthropic · Claude Haiku 4.5claude-haiku-4-5-20251001 | Estimated | — | — | — | — |
| Google · Gemini 3.5 Flashgemini-3.5-flash | Estimated | — | — | — | — |
| Google · Gemini 3.1 Pro Previewgemini-3.1-pro-preview | Estimated | — | — | — | — |
| Google · Gemini 3.1 Flash-Litegemini-3.1-flash-lite | Estimated | — | — | — | — |
| Google · Gemini 3 Flash Previewgemini-3-flash-preview | Estimated | — | — | — | — |
| Google · Gemini 2.5 Progemini-2.5-pro | Estimated | — | — | — | — |
| Google · Gemini 2.5 Flashgemini-2.5-flash | Estimated | — | — | — | — |
| Google · Gemini 2.5 Flash-Litegemini-2.5-flash-lite | Estimated | — | — | — | — |
| Mistral · Mistral Largemistral-large-latest | Estimated | — | — | — | — |
| Mistral · Mistral Mediummistral-medium-latest | Estimated | — | — | — | — |
| Mistral · Mistral Smallmistral-small-latest | Estimated | — | — | — | — |
| Mistral · Ministral 14Bministral-14b-latest | Estimated | — | — | — | — |
| DeepSeek · DeepSeek V4 Flashdeepseek-v4-flash | Estimated | — | — | — | — |
| DeepSeek · DeepSeek V4 Prodeepseek-v4-pro | Estimated | — | — | — | — |
| xAI · Grok 4.3grok-4.3 | Estimated | — | — | — | — |
| xAI · Grok Build 0.1grok-build-0.1 | Estimated | — | — | — | — |
| Meta · Llama 4 Scoutmeta-llama/Llama-4-Scout-17B-16E-Instruct | Estimated | — | — | — | — |
| Meta · Llama 4 Maverickmeta-llama/Llama-4-Maverick-17B-128E-Instruct | Estimated | — | — | — | — |
Estimated rows use one local OpenAI-compatible proxy token count, so real provider counts can differ. Pricing estimate based on public model pricing. Check provider pricing before production use.
gpt-tokenizer is a faithful port of OpenAI's own tokenizer. When the calculator counts an OpenAI model with its correct encoding, the result matches OpenAI's count, so the tool labels it Exact instead of Estimated. Providers without a local tokenizer stay clearly labeled Estimated.
The encoding used by OpenAI's current generation, including the GPT-5 family and GPT-4o. Every OpenAI model in this tool counts with o200k_base, so its token counts are Exact.
The encoding used by earlier models such as GPT-4, GPT-3.5 Turbo, and the text-embedding-3 models. gpt-tokenizer supports it too, so those models can be added later without a new engine.
This tool counts the raw text you paste. OpenAI's Chat Completions API adds a few tokens per message for role and formatting, so a full multi-message request runs slightly higher than the raw text count. Paste your combined prompt to plan input tokens and cost.
Answers about Exact OpenAI counting, encodings, and cost planning.
It is Exact only for supported OpenAI encodings counted locally with gpt-tokenizer. Other providers are labeled Estimated and use an OpenAI-compatible tokenizer as a proxy, so real provider counts can vary.
A token is a chunk of text a language model reads or writes. A token can be a whole word, part of a word, punctuation, whitespace, a number, or part of code.
Different model families use different tokenizers. The same prompt can split into different token pieces for OpenAI, Claude, Gemini, Llama, Mistral, DeepSeek, or Grok models.
Yes. You can paste code, JSON, Markdown, prose, or mixed documents. The calculator also shows word and character counts so you can compare text shape alongside tokens.
Input tokens are the prompt and context you send to the model. Output tokens are the model's response. Providers often price output tokens higher because generating text costs more compute than reading input.
Yes. Enter expected output tokens and calls per month. The calculator combines those values with the selected model's public pricing to estimate per-call and monthly cost.
No. Pasted text is processed in your browser. This site has no accounts, saved prompt history, analytics scripts, ad scripts, or server-side text processing.
Need every provider at once? The main LLM token calculator prices the same prompt across OpenAI, Claude, Gemini, Llama, Mistral, DeepSeek, Grok, and more.