EveryToolAI
Index

LLM Token Counter

Paste text and this tool counts its tokens with the same o200k_base tokenizer the OpenAI API uses — exact for GPT models — then estimates counts for Claude, Gemini, DeepSeek and Mistral and prices a request on each provider's official rates, per request and per month. The tokenizer loads into your browser and the counting happens there: your prompt is never uploaded, which matters when the text you are counting is the confidential part.

Built by Saad & Anas · updated

Tokens (o200k_base — exact for OpenAI)
Words
28
Characters
159
Exact for OpenAI, estimated for everyone else — and sources

OpenAI counts use the same o200k_base tokenizer the API uses, so they are exact. Anthropic, Google, DeepSeek and Mistral publish no browser tokenizer — their counts here are calibrated estimates (typically within ±20–30%; Claude's current models tokenize ~30% heavier than their predecessors). Cost math always uses official prices, dated above. For billing-grade numbers use each provider's count-tokens endpoint or the usage field in API responses.

How the counting works

Language-model APIs bill by the token — chunks of a few characters produced by a byte-pair-encoding tokenizer, roughly four characters or three-quarters of an English word each. This page runs the o200k_base tokenizer, the encoding OpenAI's current GPT models use, entirely inside your tab: the ~1 MB token table downloads once when you start typing and the text you paste is processed locally, never sent anywhere. For OpenAI models the count you see is therefore exact — the same number the API would meter.

The other providers publish no browser tokenizer, so their columns are estimates derived from the o200k count with calibrated multipliers, and the table labels them as such. The honest error bar is ±20–30%. Anthropic is the clearest case: its official position is that its last public tokenizer is no longer accurate for modern Claude models, and its pricing documentation notes that current Claude models tokenize the same text into roughly 30% more tokens than their predecessors — both facts this calculator's multipliers encode. For billing-grade counts on non-OpenAI models, use the provider's count-tokens endpoint or read the usage field the API returns with every response.

Worked example: the same prompt on five providers

Take a 1,000-token prompt (o200k count) with a 500-token reply, run 100 times a day. On GPT-5 at $1.25 per million input tokens and $10 per million output, one request costs 1,000 × $1.25/1M + 500 × $10/1M = $0.00625, and the month lands at about $18.75. On GPT-5 nano the same traffic costs about $0.75 a month; on a frontier model at $10 input / $50 output — with the ~1.5× tokenizer adjustment taking the prompt to ~1,500 tokens — the request is roughly $0.04 and the month roughly $120.

That spread — two orders of magnitude for the same workload — is the point of the comparison table. Model choice dominates every other cost decision, and the calculator makes the comparison concrete for your actual prompt rather than a hypothetical one. The per-month column simply multiplies by your requests-per-day figure across thirty days; batch and caching discounts (next section) can cut it further.

Cached input and batch pricing — where the real savings hide

Every major provider now discounts repeated input. OpenAI bills cached input at one tenth of the base rate automatically when a prompt prefix repeats. Anthropic's caching is explicit and asymmetric: writing a cache entry costs 1.25× the input rate (or 2× for hour-long entries) and reading it back costs 0.1× — so a cached system prompt pays for itself from roughly the first reuse, and everything after is a 90% discount on that prefix. Gemini adds a wrinkle: cache reads are cheap, but cached content also accrues a per-hour storage charge, so short-lived caches on high-traffic prompts are the winning shape there.

Batch APIs are the other lever: both OpenAI and Anthropic price asynchronous batch traffic at half the standard rate, input and output alike. A nightly classification job that tolerates minutes of latency should almost never run at real-time prices. The calculator's table shows standard rates — the cached-input column tells you what the discount applies to, and halving a row's per-month figure previews the batch price. DeepSeek adds time-of-day pricing (off-peak hours cost half its standard rate), which the table's footnote carries.

Edge cases and limits

Token counts here cover text. Images, audio and PDFs are metered by separate per-item or per-resolution formulas that vary by provider, and chat requests carry a few tokens of per-message overhead beyond the raw text — small, but visible on short prompts. Reasoning models add another wrinkle: their internal thinking tokens bill as output on most providers, so a terse-looking answer can meter far more output than it displays. Treat the output-tokens box as an estimate you control, and check real usage from the API's own accounting once traffic flows.

Prices move. Every rate in the table was read from the provider's official pricing page on the date stamped above it, with the source links one click away; providers shift prices or add models every couple of months, and we re-verify against those pages on each update. Where a change is already scheduled — a promotional rate with a published end date, a provider switching billing models — the table's notes say so. If the stamp looks old, the linked pages are the authority.

Frequently asked questions

How many tokens is my text?

Paste it in and read the first card — the count comes from the o200k_base tokenizer, the same encoding OpenAI's current models use, so for GPT models it is exact, not an approximation. As a rule of thumb one token is about four characters or three-quarters of an English word, so a 750-word page runs to roughly 1,000 tokens — but the rule bends for code, non-English text and unusual formatting, which is why counting with the real tokenizer beats estimating.

Why is the Claude token count different from the GPT count?

Different tokenizers split the same text differently. Anthropic does not publish a browser tokenizer for modern Claude models — its docs state the last public one is no longer accurate — and its pricing documentation notes current Claude models produce roughly 30% more tokens from the same text than their predecessors. This tool therefore shows Claude counts as labelled estimates built from the exact o200k count with a calibrated multiplier. For exact numbers, Anthropic's count-tokens endpoint or the usage field in responses is the authority.

Is my text uploaded to count the tokens?

No. The tokenizer itself — a token table of about a megabyte — downloads into your browser the first time you type, and every count after that happens locally in your tab. You can verify this the way we always suggest: open your browser's developer tools, watch the Network panel, and paste something; after the tokenizer chunk loads there are no further requests. That matters here more than most places, because the text people count is often exactly the prompt or document they treat as confidential.

How much does a million tokens cost?

It depends on the model far more than on the provider. As of the prices dated on this page, a million input tokens spans $0.05 on GPT-5 nano to $10 on a frontier Claude model — a 200× range — and output tokens typically cost four to six times input. Cached input is cheaper still: a tenth of the base rate on OpenAI and Anthropic reads. The comparison table prices your actual prompt across every model so the abstract per-million rates become a concrete per-request and per-month figure.

What are cached input tokens?

When consecutive requests share a prefix — a long system prompt, a document being questioned repeatedly — providers can serve the repeated part from cache and bill it at a discount: one tenth of the input rate on OpenAI (applied automatically) and on Anthropic cache reads, where writing the cache first costs 1.25 to 2 times input depending on lifetime. Gemini prices cache reads low but adds a per-hour storage fee. For chat-shaped workloads the cached share often dominates, so the discount routinely halves real bills.

Related tools