AI Token Counter & API Cost Calculator

Paste a prompt, document or code to count its tokens and compare what it costs on Claude, GPT and Gemini models. Your text is tokenized in your browser and never sent anywhere.

Runs in your browserPrices checked 27 Nov 2026Editable prices
0Tokens (o200k)
0Characters
0Words
–Chars per token
ModelInput $/1MOutput $/1MInput tokensPer requestPer month

Token counts use OpenAI's o200k tokenizer, which is exact for GPT-4o through GPT-5 models. Claude and Gemini use their own tokenizers, so their input counts are estimates scaled by the factor in brackets (edit it in the table). Prompt-cache reads are priced at 10% of the input rate here, which matches Anthropic and is close to OpenAI and Google. Always confirm prices on the provider's pricing page before budgeting.

See how the text is split into tokens

What is a token?

Language models read text as tokens: common words are one token, rarer words are split into pieces, and spaces and punctuation are usually attached to the following word. In English one token averages about four characters, or roughly three-quarters of a word. Code, numbers, non-Latin scripts and unusual formatting use more tokens per character, which is why pasting your real prompt gives a much better estimate than a word count.

API pricing is quoted per million tokens, with output tokens costing four to eight times more than input tokens. The table multiplies your token count by each model's published price and your expected volume, so you can see how a prompt change or a model switch affects your monthly bill.

Frequently asked questions

Is my text sent to OpenAI, Anthropic or Google?

No. The tokenizer is a small open-source library (js-tiktoken) that runs in your browser. Nothing you paste leaves the page, which makes it safe for confidential prompts and internal documents.

Why are Claude and Gemini counts marked as estimates?

Anthropic and Google do not publish browser tokenizers for their current models. Their tokenizers usually produce somewhat more tokens than o200k for the same English text, so the table scales the o200k count by an adjustable factor. For an exact Claude count use Anthropic's token counting API endpoint; for Gemini use the countTokens method.

Where do the prices come from?

The defaults are the standard pay-as-you-go text prices from each provider's pricing page, checked on 27 November 2026, for prompts under 200K tokens. Gemini 4 Argon is scheduled to double to $4 / $20 on 1 December 2026. Every price cell is editable, so you can plug in batch, regional or negotiated rates.

What does the prompt-cache field do?

If you resend the same long system prompt or document on every request, prompt caching bills the repeated part at a fraction of the normal input rate. Set the share of each request's input that is a cache hit to see the saving.

Last updated: 2026-11-27