████████ ██████ ██ ██ ███████ ███ ██ ███████
██ ██ ██ ██ ██ ██ ████ ██ ██
██ ██ ██ █████ █████ ██ ██ ██ ███████
██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ██████ ██ ██ ███████ ██ ████ ███████
LLM Token Counter & Cost Calculator
Count exact tokens for GPT-4o / GPT-4.1 / o-series (real tiktoken) and estimate Claude, Gemini, Llama, Mistral & DeepSeek. See context-window usage and API cost — 100% in your browser, your prompt never leaves the page.
| Model | Tokens | % of window | Input cost |
|---|
OpenAI counts (GPT-4o, GPT-4.1, o-series, GPT-4, GPT-3.5) are exact via in-browser tiktoken. All other models are calibrated estimates (typically within ~10%). Pricing is illustrative, in USD per 1M tokens, as of June 2026 — always verify current rates with each provider.
LLM Pricing & Context Window Comparison
Quick reference for the token limits and API pricing used by this calculator. Prices are in USD per 1 million tokens and are illustrative as of June 2026 — always confirm current rates with each provider. OpenAI token counts are exact (real tiktoken); other models use calibrated estimates.
| Model | Vendor | Context window | Input $/1M | Output $/1M | Token count |
|---|---|---|---|---|---|
| GPT-4o | OpenAI | 128K | $2.5 | $10 | Exact (tiktoken) |
| GPT-4o mini | OpenAI | 128K | $0.15 | $0.60 | Exact (tiktoken) |
| GPT-4.1 | OpenAI | 1M | $2.0 | $8.0 | Exact (tiktoken) |
| o3 | OpenAI | 200K | $2.0 | $8.0 | Exact (tiktoken) |
| GPT-3.5 Turbo | OpenAI | 16K | $0.50 | $1.50 | Exact (tiktoken) |
| Claude Opus 4 | Anthropic | 200K | $15 | $75 | Estimate |
| Claude Sonnet 4 | Anthropic | 200K | $3 | $15 | Estimate |
| Claude Haiku | Anthropic | 200K | $0.80 | $4 | Estimate |
| Gemini 2.5 Pro | 1M | $1.25 | $10 | Estimate | |
| Gemini 2.5 Flash | 1M | $0.30 | $2.50 | Estimate | |
| Llama 3.1 405B | Meta | 128K | $0.90 | $0.90 | Estimate |
| Mistral Large | Mistral | 128K | $2 | $6 | Estimate |
| DeepSeek V3 | DeepSeek | 128K | $0.27 | $1.10 | Estimate |
FAQ — LLM token counting & cost
How are tokens counted for OpenAI models?
o200k_base; GPT-4 and GPT-3.5 use cl100k_base — the real tiktoken byte-pair encoders, loaded and run in your browser. These counts are exact, matching what the OpenAI API charges.Are Claude and Gemini counts exact?
Is my text sent to a server?
What is a context window?
Can I link directly to a token count?
?text=Hello%20world&model=gpt-4o and the page opens with the text counted. Params: text (aliases t, q, prompt) and model. The address bar stays in sync for short inputs, so AI agents and scripts can deep-link straight to a count.