Token Counter & Cost Calculator
Count tokens for different LLM models and calculate the estimated cost for your text.
This is an estimation based on average character-to-token ratios. For precise tokenization, consider using official tokenizer libraries like tiktoken (OpenAI) or the respective model's tokenizer.
Input tokens are for prompts, output tokens are for responses
💡 Pro Tips for Token Optimization
- • Use concise language to reduce token count and costs
- • Different models have different tokenization (try multiple models)
- • GPT-5 mini, Gemini 3 Flash, and Claude Haiku 4.5 offer great price-to-performance
- • Consider the Batch API for 50% savings on large, non-urgent workloads
- • Use our Token Optimizer tool to reduce prompt size automatically
Understanding token counting and cost
Large language models don't read characters or words — they read tokens. A token is a chunk of text, usually around four characters or roughly three-quarters of an English word. Common words become a single token, while rare words, code, numbers, and non-English text often split into several. Because every API charges by the token, knowing how many tokens your text contains is the first step to predicting cost and staying inside a model's context window.
This token counter estimates the token count for a piece of text and multiplies it by a model's per-token price to show what a request would cost. Input tokens (your prompt) are usually billed at a lower rate than output tokens (the model's response), so the tool lets you switch between the two and even override the price to match a custom or negotiated rate. The estimate uses average character-to-token ratios per model family — handy for planning, though the official tokenizer is the source of truth for exact billing.
How to use this tool
- Pick the model you're targeting from the list — pricing and tokenization differ between GPT-5, Claude, Gemini, and others.
- Paste your prompt or sample text into the box and read the live token, character, and word counts.
- Toggle between input and output token pricing, and click edit to enter a custom price per million tokens if yours differs.
- Copy the result, or multiply the per-request cost by your expected request volume to project monthly spend.
Frequently asked questions
How many characters are in a token?+
On average about four characters, or roughly ¾ of an English word, but it varies. Code, numbers, punctuation, and other languages tend to use more tokens per character, so always measure your real text rather than assuming a fixed ratio.
Is this token count exact?+
It's a close estimate based on average ratios for each model family, which is ideal for cost planning. For exact, billable counts, use the provider's official tokenizer (such as tiktoken for OpenAI or the count-tokens endpoint for Claude).
Why are output tokens more expensive than input tokens?+
Generating tokens is more computationally expensive than reading them, so most providers charge two to five times more for output. That's why trimming verbose responses often saves more money than shortening prompts.