Don's Tools · Developers · Token Counter & Cost Estimator

LLM token counter & cost estimator

Paste your prompt to count tokens and estimate cost across models. Exact for GPT, with live prices and context limits that update themselves, plus a context budget bar, all in your browser.

0Tokens
0Characters
0Words
Loading tokenizer...

Model & cost

Loading live pricing...
$0Input cost
$0Total
Context usage shows once a model is selected.
Pricing source: loading...
Token Counter & Cost Estimator counts the tokens in any prompt and estimates what it will cost across models. GPT counts are exact using the real tokenizers, while Claude, Gemini and others are approximated with the GPT-4o tokenizer as a labelled proxy. Model prices and context windows are fetched live from LiteLLM's open dataset, so they stay current with no manual updates, and a context budget bar shows how much of a model's window you are using. Advanced options add expected output tokens, call counts, a tokenizer selector, custom rates and a token breakdown. Your text never leaves the browser.

Frequently asked questions

Is my text uploaded anywhere?

No. Your text is tokenised and counted entirely in your browser and is never sent anywhere. The only network request is to fetch the public price list, which contains no text of yours.

How accurate are the token counts?

For GPT models the count is exact, using the real OpenAI tokenizers. Claude, Gemini and other providers have no public tokenizer, so those counts are approximate, calculated with the GPT-4o tokenizer as a close proxy and clearly labelled as such.

Where do the prices and limits come from, and are they current?

They are fetched live from LiteLLM's open, community-maintained dataset, which is updated very frequently and often on the day new models launch. Nothing needs manual updating. If it is ever unavailable you can type your own rate in the advanced options.

What does the context window bar show?

It compares your input tokens, plus any expected output tokens, against the selected model's maximum context window, so you can see how much room is left before you hit the limit.

Does it still work without the live pricing?

Yes. Token counting works on its own once the tokeniser loads. For cost, if live pricing has not loaded you can enter a custom input and output rate in the advanced options and the totals update normally.