Token Calculator: Count Tokens and Model Costs
Count the tokens in your text and estimate what each API request will cost.
How Token Counting Works
A token is a piece of text a model reads. It can be a word, part of a word, a space or punctuation. Each model’s tokeniser splits text according to its own rules, so the same paragraph can use a different number of tokens on another model.
For ordinary English, 100 tokens cover roughly 75 words. Code and IDs often use more tokens because of symbols and digit groups. Other languages have different ratios, especially where words run together without spaces.
For GPT-5.4 mini, the calculator runs OpenAI’s published o200k_base encoding in your browser. That gives an exact count for the pasted text. The Claude and Gemini options estimate one token per four UTF-8 bytes because their documented token counters run through their APIs. Pasted text stays on your device.
From Tokens to Cost
Multiply input tokens by the model’s input price per million and reply tokens by its output price per million. Add the two amounts and divide by one million to get the cost per request. Multiply that amount by your monthly requests. If you select AUD, the calculator converts at the rate you enter.
Output usually costs more because the model generates each new token in sequence. For reasoning models, billable output can include reasoning tokens beyond the visible reply. Budget for those in the expected reply field when they apply.
Prompt caching can lower the input price for a repeated prompt prefix. Batch processing can lower both prices when you can wait for requests to finish. The estimate uses standard text rates before those discounts and excludes tax and tool charges.
Worked Example: A Document Summary
Select Reset example to load a fictional report about a support team’s returns pilot. The example budgets for a 500-token summary and 10,000 requests per month. It shows totals in AUD at 1.5053 AUD per US dollar.
The calculator counts 1,165 tokens in the text for GPT-5.4 mini. At OpenAI’s standard text rates of USD $0.75 per million input tokens and USD $4.5 per million output tokens, the cost is AUD $47 per month. Each request costs AUD 0.47¢.
Switch to Claude Sonnet 5.5 with the other fields unchanged. The same text shows ≈ 1,518 tokens because the calculator estimates Claude’s input count. At Anthropic’s standard text rates of USD $2 per million input tokens and USD $10 per million output tokens, the cost is AUD $121 per month. Each request costs AUD 1.21¢.
Context Windows and Long Documents
A context window limits how many tokens the model can work with in one request. Allow room for instructions, message history and the expected reply. Gemini’s published input and output limits apply separately. If a request is too large, the API can reject or truncate it, depending on your settings.
When a question needs only a few passages, retrieval can look them up and send them with the question. That uses fewer input tokens than sending the whole document each time. If the task needs a summary of the whole document, split it into sections and combine the section summaries.