About This Calculator
The Prompt Cost Calculator estimates how many tokens your text prompt uses and what it costs to send to any of 100+ AI language models available via OpenRouter. It is useful for developers, product teams, and researchers who want to understand the cost of their prompts before running them at scale.
How Token Estimation Works
AI language models process text as tokens — chunks of characters produced by a tokenisation algorithm. This calculator uses the standard English approximation of 1 token per 4 characters, which is accurate to within ±10% for typical English prose. Actual token counts depend on the specific tokeniser used by each model:
- GPT models (OpenAI) use the cl100k_base BPE tokeniser. Common English words are usually 1 token; longer or rare words may be 2–3 tokens.
- Claude models (Anthropic) use a similar BPE approach with slightly different vocabulary, giving counts within a few percent of GPT.
- Open-source models (Llama, Mistral, etc.) often use SentencePiece tokenisers, which can produce different counts for the same text.
For code, non-Latin scripts (Arabic, Chinese, Japanese), or heavily punctuated text, token counts per character tend to be higher than the English average.
Input vs Output Costs
This calculator shows the cost of your input prompt only. The model's response (output tokens) is billed separately at the output rate, which is typically 2–5× higher than the input rate. To also estimate output costs, use the AI Model Cost Calculator.
Frequently Asked Questions
How are tokens counted from a prompt? This calculator uses the approximation of 1 token per 4 characters of English text. For a 100-word paragraph (roughly 500 characters), the estimate would be ~125 tokens. For exact counts, use the provider's official tokeniser.
Why does the same text have different token counts on different models? Each model family uses a different tokenisation algorithm. GPT uses BPE, Claude has its own variant, open-source models use SentencePiece. Counts can vary by 5–15% for the same text. This calculator uses a single universal approximation.
Does the cost shown include the model's response? No — only your input prompt is costed here. Output tokens are billed separately at the output rate (usually 2–5× the input rate). Use the AI Model Cost Calculator to include output costs.
How accurate is the token estimate? For typical English text, the 4-characters-per-token rule is accurate to within ±10%. Accuracy is lower for code, mixed-language text, and non-Latin scripts.
Where does the pricing data come from? Pricing is fetched live from the OpenRouter API and cached in your browser for 24 hours. It covers 100+ models from OpenAI, Anthropic, Google, Meta, Mistral and others.
Related Calculators
- AI Model Cost Calculator — Compare API pricing for 100+ LLMs including GPT-4o, Claude, Gemini and Llama. Calculate exact token costs.
- LLM Cost Comparator — Side-by-side per-million-token cost for GPT-5, Claude Opus 4.7, Gemini 3.1 Pro, Llama, DeepSeek.
- AI vs Human ROI Calculator — Compare AI tool costs against human labour. Monthly savings, annual ROI and break-even with live model pricing.