// tokens · context windows · api cost
████████ ██████ ██ ██ ███████ ███ ██ ███████
██ ██ ██ ██ ██ ██ ████ ██ ██
██ ██ ██ █████ █████ ██ ██ ██ ███████
██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ██████ ██ ██ ███████ ██ ████ ███████
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.
Text / promptloading exact tokenizer…
0estimate
tokens
0
words
0
characters
context window0 / 0
Input cost: $0.00
// all models — same text
| 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.
FAQ — LLM token counting & cost
How are tokens counted for OpenAI models?
GPT-4o, GPT-4.1 and o-series use
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?
No — Anthropic and Google don't publish browser tokenizers, so Claude, Gemini, Llama, Mistral and DeepSeek are calibrated estimates (usually within ~10%), clearly labelled as estimates.
Is my text sent to a server?
No. Tokenization and cost math run entirely client-side. Your prompt never leaves the page — safe for proprietary prompts.
What is a context window?
The maximum tokens a model can handle in one request (input + output combined). The gauge shows how much of the selected model's window your text uses.
Can I link directly to a token count?
Yes. Use
?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.Is it free?
Yes, completely free, no signup, no ads. One of the free browser tools at jasperbernaers.com.