How this AI token calculator works
AI models don't read words; they read tokens, small chunks of text produced by a tokenizer. In English one token averages about four characters, or roughly three quarters of a word. This tool blends a character-based estimate with a word-based one, which tracks modern tokenizers closely for normal prose without loading a heavy tokenizer into your browser.
Cost is then simple arithmetic: input tokens × the model's input price, plus output tokens × its output price, divided by one million. Output is usually priced four to eight times higher than input, so a long answer often costs more than a long prompt.
Using it as an OpenAI token calculator
For OpenAI models, the estimate is a good stand-in for the official tokenizer on everyday English. If you're budgeting an app, enter a realistic reply length and the number of requests per day or month to get an OpenAI API pricing calculator view of your bill. Remember that system prompts, tool definitions and chat history are also input tokens on every call.
What the estimate leaves out
- Cache-write fees. The calculator applies the lower cached-input rate but does not include the one-time write fee some providers charge when the prompt is first cached.
- Long-context tiers. Some models charge more above a prompt-size threshold (for example 272K tokens on several OpenAI models, 100K on Claude Haiku 5.5).
- Reasoning tokens. Thinking models bill hidden reasoning as output, so real output can exceed the visible reply.
- Images, audio and tools. These are priced separately.
For official per-token rates, see Claude API pricing, OpenAI API pricing, Gemini API pricing, and Kimi and DeepSeek pricing.
If you're comparing tools rather than raw APIs, see my breakdowns of Claude Code pricing, Cursor pricing and ChatGPT vs Claude, plus Claude vs Gemini and ChatGPT vs Copilot. Planning a product that uses AI? The website cost calculator helps you estimate the build.