AI Token Cost Calculator
Estimate your GPT, Claude, and Gemini API costs before you spend a single dollar — paste your prompt, pick a model, and see the real price.
$5/1M input tokens · $30/1M output tokens · Context: 1,048,576 tokens
Used to project your monthly cost (assumes 30 days).
Input Cost
$0.0050
Output Cost
$0.0150
Total Cost / Request
$0.0200
Projected Monthly Cost
Based on your requests/day input
$60.00
Compare All Models
Cost for the same 1,000 input / 500 output tokens, cheapest first.
| Model | Provider | Input Cost | Output Cost | Total Cost | Context Window |
|---|---|---|---|---|---|
| Gemini 2.5 Flash-Lite (legacy)Cheapest | $0.0001 | $0.0002 | $0.0003 | 1,000,000 | |
| GPT-4o mini | OpenAI | $0.0002 | $0.0003 | $0.0005 | 128,000 |
| GPT-5.6 Luna | OpenAI | $0.0002 | $0.0006 | $0.0008 | 1,048,576 |
| Gemini 3.5 Flash-Lite | $0.0003 | $0.0013 | $0.0016 | 1,048,576 | |
| Claude Haiku (legacy) | Anthropic | $0.0008 | $0.0020 | $0.0028 | 200,000 |
| Claude Haiku 4.5 | Anthropic | $0.0010 | $0.0025 | $0.0035 | 200,000 |
| GPT-5.2 | OpenAI | $0.0009 | $0.0035 | $0.0044 | 400,000 |
| Gemini 3.6 Flash | $0.0015 | $0.0038 | $0.0052 | 1,048,576 | |
| Claude Sonnet 5 | Anthropic | $0.0020 | $0.0050 | $0.0070 | 1,000,000 |
| GPT-4o | OpenAI | $0.0025 | $0.0050 | $0.0075 | 128,000 |
| GPT-5.6 Terra | OpenAI | $0.0020 | $0.0060 | $0.0080 | 1,048,576 |
| Gemini 3.1 Pro | $0.0020 | $0.0060 | $0.0080 | 1,048,576 | |
| Claude Sonnet (legacy 4.6) | Anthropic | $0.0030 | $0.0075 | $0.0105 | 200,000 |
| Claude Opus 5 | Anthropic | $0.0050 | $0.0125 | $0.0175 | 1,000,000 |
| GPT-5.6 Sol | OpenAI | $0.0050 | $0.0150 | $0.0200 | 1,048,576 |
| Claude Fable 5 | Anthropic | $0.0100 | $0.0250 | $0.0350 | 1,000,000 |
| Claude Opus (legacy) | Anthropic | $0.0150 | $0.0375 | $0.0525 | 200,000 |
AI APIs are billed by token, not by request or by word, which makes real costs easy to underestimate — especially once output length, system prompts, and daily request volume are factored in. This AI token cost calculator estimates what a given prompt will actually cost across the major providers, so you can compare GPT, Claude, and Gemini pricing side by side and catch an expensive model choice before it shows up on your bill.
How the estimate is calculated
We count tokens the way providers bill them
Your text is split using each model's own tokenizer, not a word-count guess. That's the same unit OpenAI, Anthropic, and Google use to generate your invoice, so the number you see here is the number that shows up on your bill.
Input and output are priced separately
Every major provider charges more for what the model generates than for what you send it — often 3 to 5 times more. We apply each model's current published input and output rate to your exact token counts, not a blended average.
You get a real monthly number
Add your expected requests per day and the calculator projects a monthly spend, so you can catch an expensive model choice before it's baked into your product — not after the first invoice.
What actually moves your AI API bill
The headline per-token rate is only half the story. These two factors explain most of the gap between what people expect to pay and what they actually get billed.
Output length is usually the bigger lever
A short prompt with a long, detailed response often costs more than a long prompt with a one-line answer. If your bill is higher than expected, check output length before you blame input size.
Cached and repeated context costs less
If your app resends the same system prompt or reference document on every call, prompt caching can cut that portion of the input cost by 80–90% on providers that support it. This calculator estimates standard rates; check your provider's caching pricing separately.
AI API pricing changes frequently as providers release new models and adjust rates. We update this page as new pricing is announced, but for production budgeting, always cross-check against the provider's official pricing page linked from the model selector above.
Frequently Asked Questions
How accurate is this AI token calculator?
Token counts come from each provider's own tokenizer logic, so they closely match what you'd see on your actual API bill. Pricing reflects each provider's publicly listed rates at the time of writing — always confirm against the provider's official pricing page before a large-scale deployment, since rates change and providers sometimes offer volume, cached-input, or batch discounts this calculator doesn't model.
Why do GPT, Claude, and Gemini charge different prices for input vs. output tokens?
Generating text costs more compute than reading it, so every major provider prices output tokens higher than input tokens — commonly 3 to 5 times more. A short prompt that triggers a long, detailed answer can end up costing more than the input token count alone would suggest.
What's a token, in plain terms?
A token is a chunk of text — often a word or part of a word — that a model processes as one billing unit. English text averages roughly 4 characters per token, but this varies by language and content type, which is why an exact tokenizer count is more reliable than a rough word-count estimate.
Which AI model is cheapest for high-volume use?
It depends on your workload, but as a rule of thumb: lighter, faster models built for high-volume tasks (classification, extraction, routing, simple chat) are priced far below flagship reasoning models. Route the bulk of your traffic to a cheaper model and reserve the expensive flagship for tasks that genuinely need it — this single change is usually the biggest lever on your bill.
Does this calculator send my text anywhere?
No. Tokenization and cost calculation run entirely in your browser — your text isn't uploaded, logged, or stored.
Why do costs here look different from what I'm seeing in my provider dashboard?
Differences usually come from cached-input pricing, batch API discounts, system prompts or tool-call overhead not included in your test input, or a rate change on the provider's end since this page was last updated. Use this calculator for quick estimates and planning, and your provider's billing dashboard for exact spend.
LLM Token Calculator
If you're building with an LLM API, tokens aren't just a billing detail — they decide whether your prompt fits, how much history your chat can hold, and how your RAG chunks get split. Growfiy's LLM Token Calculator estimates token counts using each provider's actual tokenizer behavior, so you can check context window limits, size chunks correctly, and debug truncated responses before they hit production.
Built for developers working directly with OpenAI, Claude, Gemini, DeepSeek, Llama, and Mistral APIs — whether you're designing a RAG pipeline, fine-tuning a model, or just trying to keep a long chat session inside the context window.
How LLM Tokenization Actually Works
Most modern LLMs don't split text into whole words. Instead, they use subword tokenization — GPT models rely on a byte-pair encoding (BPE) scheme via tiktoken, while several other model families use SentencePiece or their own trained vocabularies. A common word might be a single token, while a rare word, a typo, or a technical term can be broken into two or three tokens.
This is why token counts don't map cleanly to word counts, and why the same input can tokenize differently depending on which model you send it to — the calculator accounts for this per-model difference instead of using a single universal estimate.
Context Window Planning & RAG Chunk Sizing
- Context window budgeting: add up system prompt, chat history, retrieved documents, and expected output tokens — if the total exceeds the model's limit, the oldest messages or retrieved context typically get dropped first.
- RAG chunk sizing: smaller chunks (200-500 tokens) improve retrieval precision but can lose surrounding context; larger chunks preserve context but reduce how many relevant passages fit in the window.
- Chat history truncation: long-running conversations need a strategy — sliding window, summarization, or hard cutoffs — to stay inside the context limit without losing critical earlier context.
- Fine-tuning datasets: knowing per-example token counts upfront helps estimate total training cost and catch oversized examples before a training run fails or gets truncated.
Frequently Asked Questions
Why does the same text produce different token counts on different LLMs?
Each model family uses its own tokenizer — GPT models use a BPE-based tokenizer (tiktoken), while others use SentencePiece or custom vocabularies. Different vocabularies split words, punctuation, and whitespace differently, so identical text can produce different token counts across models.
How do I know if my prompt will fit inside a model's context window?
Add your prompt tokens, any retrieved context or chat history, and your expected output tokens, then compare that total against the model's published context window. If the sum exceeds the limit, the request will either be truncated or rejected depending on the API.
What's a safe chunk size for RAG pipelines?
Most RAG setups use chunks between 200 and 500 tokens with some overlap (10-20%) to preserve context across boundaries. The right size depends on your embedding model's limits and how much surrounding context each retrieved chunk needs to stay meaningful on its own.
Does whitespace or formatting affect token count?
Yes. Extra line breaks, indentation, JSON formatting, and markdown syntax all consume tokens. Minifying structured input or removing unnecessary whitespace before sending it to the model can noticeably reduce token usage in high-volume applications.
How accurate is a token estimator compared to the actual API response?
A well-built estimator modeled on the correct tokenizer is typically within a few percent of the real count. For exact numbers before a production run, it's still good practice to check the `usage` field returned in the API response itself.
Do system prompts and function/tool definitions count toward the token limit?
Yes. System prompts, tool/function schemas, and any injected context all count as input tokens and are billed and counted the same way as the user's message, which is why verbose tool definitions can quietly eat into your available context window.