AI Token Counter & Cost Calculator
Count tokens for GPT, Claude, and Gemini prompts, see token boundaries, check context-window fit, and estimate API cost per request and per month — live as you type, fully client-side.
0
GPT tokens (exact)
$0
Input cost, cheapest model
0
Words
0
Characters
Loading tokenizer (≈2 MB, once)…
Each coloured block is one GPT token (o200k). Long or unusual words split into several; common English words are usually one.
Does it fit the context window?
How much of each model's limit your prompt uses, leaving room for the output length set below.
What this prompt costs.
Per request, and per month at your volume.
| Model | Your tokens | Input $/1M | Output $/1M | Per request | Per month |
|---|
Prices per million tokens from the providers' official pricing pages, verified . Standard (≤200K-token) tier, no caching or batch discounts. GPT counts are exact (o200k tokenizer, used by GPT-4o and later); Claude and Gemini counts are estimates — those tokenizers aren't public. Promotional rates are marked ◦. Confirm current pricing with the provider before budgeting.
Why the same prompt costs 250× more on one model than another
Two things stack. Per-token prices span roughly $0.15 to $10 per million input tokens across the models in the table — a 65× spread on input alone, and wider once output is included, since output is billed at 5–6× the input rate on most families. Then each provider's tokenizer splits the same text differently: Claude's tends to produce about 10–15% more tokens than OpenAI's o200k on English prose, so a "cheaper per token" model can bill slightly more tokens. The calculator applies both effects to your actual text, which is why the per-request column is the only number worth comparing.
What counts as a token
Roughly four characters of English, or three-quarters of a word — but code, JSON, non-Latin scripts and unusual words tokenize much less efficiently. Turn on Show token boundaries above and paste a JSON payload: the punctuation and quoted keys become their own tokens, which is why a 2 KB JSON object can cost more than a 2 KB paragraph. Minifying JSON before sending it to a model typically cuts 15–30% of the tokens for free.
Context windows are not budgets
A million-token window means the model can read that much, not that you should send it. Every token in the prompt is billed on every request, and most providers charge a higher long-context rate above 200K tokens. The fit bars above show where a prompt sits against each model's limit including your expected output, so you can see when a retrieval step or a summary would pay for itself.
How to use AI Token Counter & Cost Calculator.
- 1
Paste or type your prompt into the text area
- 2
Token counts update live — exact for GPT models, estimated for Claude and Gemini
- 3
Read the per-model table to compare input costs for your prompt
- 4
Set expected output tokens and requests per day to see cost per request and per month
- 5
Toggle 'Show token boundaries' to see how the tokenizer splits your text — useful for trimming JSON and code prompts
Why use this tool.
Know what a prompt costs before you send it to the API
Compare the same prompt's cost across GPT, Claude, and Gemini models
See at a glance whether a prompt fits a 128K, 200K or 1M context window with room for the answer
Project monthly API spend from one representative prompt and your daily request volume
Safe for proprietary prompts — nothing you paste leaves your browser
No signup, no rate limits
About AI Token Counter & Cost Calculator.
True Tool Deck's AI Token Counter counts the tokens in your prompt and calculates what it costs to send to GPT, Claude, and Gemini models — live, as you type. GPT counts are exact, computed with the o200k tokenizer running in your browser; Claude and Gemini counts are clearly-labeled estimates, since those tokenizers aren't public. The cost table applies each model's current per-million-token pricing to your actual prompt, plus your expected output length, so you can compare the real cost of a request across providers before writing a line of integration code. Everything runs client-side: system prompts, proprietary context, and confidential text never leave your device.
Frequently asked questions.
What is a token?
Language models process text as tokens — chunks of roughly 3-4 English characters. 'Hello world' is 2 tokens; a typical English sentence runs 20-30. API pricing, context limits, and rate limits are all denominated in tokens, which is why counting them matters.
Are the counts exact?
GPT counts are exact — the tool runs the same o200k tokenizer OpenAI uses, directly in your browser. Claude and Gemini use proprietary tokenizers with no public browser version, so those counts are estimates (typically within ~10-15%) and are labeled as such. For exact Claude counts, use Anthropic's count_tokens API endpoint.
Why did my prompt cost jump between models?
Two reasons: per-token prices differ up to 50× between models, and different tokenizers split the same text into different token counts. The comparison table shows both effects applied to your actual prompt.
Is my prompt uploaded anywhere?
No. The tokenizer runs entirely in your browser via JavaScript. Proprietary prompts, system messages, and confidential text never leave your device — unlike most token counter sites, which send your text to a server.
Why do prompt sizes matter more now?
Average developer prompts grew roughly 4× between 2024 and 2026 as agentic workflows and long system prompts became standard. At thousands of tokens per call, small per-token prices compound quickly — tracking cost per prompt is how you catch it early.
How current are the prices?
Prices were verified on 5 September 2026 against the official OpenAI, Anthropic and Google pricing pages, at the standard (≤200K-token) tier without caching or batch discounts. Promotional rates are marked. Providers change prices; confirm against the official page before budgeting a production workload.
Why do JSON and code use more tokens than prose?
Tokenizers are trained mostly on natural language, so common English words map to single tokens while braces, quotes, colons and camelCase identifiers each become their own token. Turn on 'Show token boundaries' to see it. Minifying JSON and stripping comments from code before sending them to a model typically saves 15–30% of input tokens.
How do I estimate monthly API cost?
Paste a representative prompt, set the output tokens you typically get back, and enter your requests per day. The 'Per month' column multiplies per-request cost by 30 days of that volume for every model, so you can compare providers at your real scale rather than per token.
Guides for this tool.
- How many tokens is my prompt? GPT, Claude and Gemini counted on the same text
The four-characters-per-token rule breaks budgets. How each provider actually tokenizes English, code, JSON and other languages, why the counts differ, and how to get an exact number without sending your prompt anywhere.
- LLM API pricing compared (September 2026): what a real request costs on GPT, Claude and Gemini
Thirteen current OpenAI, Anthropic and Google models priced per million tokens and, more usefully, per request and per month. Verified against official pricing pages, with the caching, batch and long-context rules that change the answer.