🪙 LLM Token Counter & Cost Calculator
Paste a prompt, count its tokens, see the cost per model — exact OpenAI counts (the real tokenizer runs locally), clearly-labelled estimates for Claude and Gemini, a context-window fit bar, and cost math with a visible "prices last verified" date.
…
tokens (o200k, exact)
36
words
229
characters
—
chars / token
Context-window fit
0 of 200,000 tokens (0.0%) — using the exact o200k count; leave headroom for the system prompt and the reply.
| Model | Input tokens | $ / MTok in · out | Cost / request | Cost / month |
|---|---|---|---|---|
| GPT-5.5 | 0EXACT | $5 · $30 | $0.0150 | $45.00 |
| GPT-5.4 | 0EXACT | $2.5 · $15 | $0.00750 | $22.50 |
| GPT-5.4 mini | 0EXACT | $0.75 · $4.5 | $0.00225 | $6.75 |
| GPT-5.4 nano | 0EXACT | $0.2 · $1.25 | $0.00063 | $1.88 |
| Claude Fable 5 | 74ESTIMATE | $10 · $50 | $0.0257 | $77.22 |
| Claude Opus 4.8 | 74ESTIMATE | $5 · $25 | $0.0129 | $38.61 |
| Claude Sonnet 5† | 74ESTIMATE | $2 · $10 | $0.00515 | $15.44 |
| Claude Haiku 4.5 | 57ESTIMATE | $1 · $5 | $0.00256 | $7.67 |
| Gemini 3.5 Flash | 57ESTIMATE | $1.5 · $9 | $0.00459 | $13.76 |
| Gemini 3.1 Pro† | 57ESTIMATE | $2 · $12 | $0.00611 | $18.34 |
| Gemini 2.5 Flash-Lite | 57ESTIMATE | $0.1 · $0.4 | $0.00021 | $0.6171 |
Prices last verified: 2026-07-07 against OpenAI pricing · Anthropic pricing · Google Gemini pricing. † Claude Sonnet 5 is introductory pricing — $3/$15 per MTok from 1 September 2026. Standard API rates; caching/batch discounts not included.
EXACT = the real OpenAI o200k_base tokenizer running in your browser. ESTIMATE = Anthropic and Google don't publish browser-runnable tokenizers; counts use the ~4-chars-per-token heuristic (×1.3 for Anthropic's newer-tokenizer models, per their docs). Your text never leaves this page.
How the llm token counter & cost calculator works
Language models don't read words — they read tokens, sub-word chunks produced by each vendor's tokenizer, and API bills are denominated in them. For OpenAI models this tool runs the genuine o200k_base tokenizer (via the gpt-tokenizer library) in your browser, so those counts are exact, not approximations. Anthropic and Google do not publish browser-runnable tokenizers, so Claude and Gemini counts are estimates from the ~4-characters-per-token heuristic — multiplied by 1.3 for Anthropic's newer models (Opus 4.7+, Fable 5, Sonnet 5), which Anthropic documents as using a tokenizer that "produces approximately 30% more tokens for the same text". Every number is badged EXACT or ESTIMATE so you always know which you're looking at. The cost panel multiplies your counted input tokens and expected output tokens by each model's per-million-token price, and scales to a monthly figure from your requests-per-day.
Two honesty notes built into the tool: prices carry a visible "last verified" date with links to the official pricing pages, because API prices change often (Claude Sonnet 5's move from $2/$10 to $3/$15 on 1 September 2026 is already pre-announced); and there is deliberately no "exact" badge on Claude or Gemini — any tool claiming exact counts for those models without calling the vendor's API is guessing. The privacy angle matters here more than most tools: the text people paste into token counters is precisely their confidential prompts and documents, and this one never transmits a byte.
Frequently asked questions
Are the token counts exact?
For OpenAI models, yes — the real o200k_base tokenizer runs in your browser via the gpt-tokenizer library, the same encoding GPT-5.x-era models use. For Claude and Gemini the counts are labelled estimates: those vendors don't publish browser-runnable tokenizers, so exact counts are only available from their APIs.
Why do Claude models show more tokens than GPT for the same text?
Anthropic documents that Opus 4.7 and later, Fable/Mythos 5 and Sonnet 5 use a newer tokenizer that "produces approximately 30% more tokens for the same text" than their previous one. This tool's Claude estimates apply that factor for the newer models — a per-token price cut can therefore cost more than it appears if token counts rise.
How is the cost calculated?
(input tokens ÷ 1,000,000 × input price) + (output tokens ÷ 1,000,000 × output price), per request — then × requests/day × 30 for the monthly figure. Standard API list prices; batch and caching discounts (often 50% and 90% respectively) are not included, so treat results as the ceiling.
Are the prices current?
The table shows the date the prices were last verified against the official OpenAI, Anthropic and Google pricing pages, with links so you can check. API pricing changes frequently — Claude Sonnet 5's increase to $3/$15 on 1 September 2026 is already scheduled — so always confirm before committing to a budget.
What is the context-window fit bar?
It shows what fraction of a chosen context size (128k to 1M tokens) your text occupies, using the exact o200k count. Remember the context window must also hold the system prompt, conversation history and the model's reply — filling it to 100% with input leaves no room to answer.
Is my text uploaded to count tokens?
No — tokenization and all cost math run in your browser, and the page works offline after loading. What people paste into token counters is usually their actual confidential prompts and documents; that's exactly why this one has no server side.