Count the tokens in a prompt and compare estimated API costs across models.
Loading tokenizer...
| Model | Input $/1M | Output $/1M | Cost per request | Per 1,000 requests |
|---|
Standard list prices checked on 27 November 2026, without batch or caching discounts. Long-prompt tiers are applied where listed. Check the official pages: Anthropic, OpenAI, Google.
Saved you some time? ☕ Buy me a coffee
Language models read text as tokens: short pieces that can be a whole word, part of a word, a space or a punctuation mark. API providers charge per token, and every model has a limit on how many tokens fit in one request, called the context window. As a rough guide, one token is about four characters of English text, but code, numbers and other languages often use more.
Paste your prompt, system instructions or document into the text box. The token, word and character counts update as you type. Then enter how many tokens you expect the model to reply with. The table shows the estimated cost of one request and of 1,000 identical requests for each model.
For a chat application, include the system prompt and the conversation history you send each time, because all of it is billed as input on every request. Tool definitions and images also add input tokens that this page does not count.
The count uses o200k_base, the open tokenizer OpenAI published for GPT-4o and related models. Other model families split text differently, so their real counts can be noticeably higher or lower. Use these figures for planning, and use your provider's token counting endpoint or the usage field in API responses for exact billing numbers.
Remove repeated instructions and unused examples, send only the parts of a document that matter, trim old conversation turns, and ask for shorter answers. Output tokens usually cost several times more than input tokens. Most providers also offer cheaper rates for cached or batched requests, and smaller models are often good enough for classification and extraction.
No. Counting happens in your browser. Only the tokenizer files are downloaded, from the esm.sh CDN.
For typical English text, about 750 words. The ratio changes with the language and with how much code the text contains.
Each model family has its own tokenizer, so the same sentence can be split into a different number of pieces.
No. They are list prices checked on the date shown under the table. Providers change prices, so confirm on the official pricing page.