Paste any text to instantly estimate token count and API costs across GPT-4o, Claude, Gemini, and more.
| Model | Input Cost (this text) | Cost × 1,000 req/day / mo |
|---|
LLMs don't process text character by character — they use tokens, which are chunks of text. The exact size varies: common words are usually 1 token, rare or long words might be 2-4 tokens, and special characters/code often tokenize differently.
English prose: ~4 characters per token or ~0.75 words per token
Code: ~3-4 characters per token (symbols and brackets are often individual tokens)
Numbers: Each digit is often 1 token; large numbers can be 2-4 tokens
Non-English: CJK characters are often 2-3 tokens each; European languages similar to English
Most current models support 128K-200K token context windows. Claude supports 200K. GPT-4o supports 128K. You pay for every token in your context window on each request — long conversations get expensive quickly.
Practical optimizations: (1) Be concise in system prompts — every word costs money at scale. (2) Use structured output formats (JSON) rather than verbose descriptions. (3) Truncate conversation history — only keep the last N turns. (4) Compress retrieved documents before including them in context.
This tool estimates tokens using a 4-characters-per-token heuristic, which is accurate to within ~10% for typical English text. For exact counts, use the official tokenizers: tiktoken for OpenAI models, anthropic.tokenizer for Claude. The heuristic is less accurate for code, non-English text, and text with many special characters.
Yes. Every token in your context window (system prompt + conversation history + current message) is billed as input tokens on every request. A 200-token system prompt costs 200 tokens × number of daily requests. For 10,000 daily requests, that's 2M extra input tokens per day.
GPT-4o: 128,000 tokens. GPT-4o-mini: 128,000 tokens. GPT-4.1: 1,047,576 tokens. Claude Sonnet 4.5: 200,000 tokens (1M in beta on some tiers). Gemini 2.5 Pro: 1,000,000 tokens. Gemini 2.5 Flash: 1,000,000 tokens. Mistral Large: 128,000 tokens. Llama 3.1 70B: 128,000 tokens.
In 2026, a common budgeting mistake is counting only visible prompt + output tokens. Many newer reasoning models also consume hidden deliberation/reasoning tokens, and some providers now expose them separately in usage metadata while still charging for them. If your app suddenly looks 20–60% more expensive than your token estimate, check whether the model adds internal reasoning or tool-planning tokens. For accurate forecasts, compare this page’s token count with the provider’s returned usage fields from a real API call, not just the raw text length.
Prices change often and some figures on this page may be out of date. Confirm the current price on the provider's website before you decide. Company and product names belong to their owners and are used only to identify them; this site is not affiliated with them.