Great Idea Foundry Token Counter

Count tokens and estimate AI costs

Paste a prompt, a document or a chat transcript. See how many tokens it uses, what it costs on each model, and whether it fits the context window. Your text never leaves your browser.

AI models read and bill text in tokens, not words. A token is roughly four characters of English, but code, numbers and other languages split differently, so counting is the only way to know.

Counts for OpenAI models are exact: the page uses OpenAI's open tokenizer (o200k, used from GPT-4o onwards). Anthropic, Google and open models use their own tokenizers, so their counts are estimates based on the same text, marked with a tilde.

Set the expected answer length and the number of requests to see what a feature or a batch job will really cost. Prices and context windows update automatically from a live price list, and new models appear as they are released; edit any price to match your own contract.

Prompts often contain customer data, code or unreleased plans. Counting happens on your device and nothing is uploaded.

Pick a counter

  • GPT Token Counter - Paste a prompt and get the exact token count for OpenAI's GPT models, the cost of a request and how much of the context window it uses. Nothing is uploaded.
  • Claude Token Counter - Paste a prompt to estimate its size and cost on Anthropic's Claude models. Claude's tokenizer is not published, so counts are estimates; for exact numbers use Anthropic's token-counting API.
  • Gemini Token Counter - Paste a prompt or document to estimate its token count and cost on Google's Gemini models. Gemini uses its own tokenizer, so counts are estimates based on the same text.
  • LLM Cost Calculator - Work out what a prompt costs on each model before you build. Paste the prompt, set the expected answer length and how many requests you expect, and compare models from cheapest to most expensive.
  • Context Window Checker - Paste a long document, a codebase dump or a chat history and see, for every model, how much of the context window it fills once the answer is added, and by how much it is over.

Coming soon

  • Chat message counting - Count a whole conversation with roles and system prompt.
  • Prompt slimmer - Suggestions that cut tokens without losing meaning.
  • Price history - See how a model's price has changed over time.

Frequently asked questions

How accurate are the counts?
Exact for OpenAI models, using OpenAI's o200k tokenizer. Other providers use different tokenizers, so their counts are estimates from the same text, usually within about 20%. Use the provider's own token-counting API when you need an exact figure.
How many words is a token?
In English, about three quarters of a word, or four characters. Code, numbers, emoji and many other languages use more tokens per word.
Where do the prices come from?
From OpenRouter's public model list, which shows each provider's list price and context window. Our server refreshes it every few hours and the page shows when it was last updated. Batch, cache and volume discounts are not included, so edit a price if yours differs.
Why does the answer length matter?
Models charge for the text they write as well as the text they read, and output tokens usually cost several times more. Set Answer length to the size of reply you expect.
Is my prompt uploaded?
No. The tokenizer runs in your browser, so prompts, documents and code stay on your device.