Token Calculator
Estimate input tokens, expected output tokens, token ratio, and AI API costs from your prompt or context.
AI Token Calculator
Calculation Results
What Is an AI Token Calculator?
This AI Token Calculator helps estimate how many tokens are used by a prompt or context, how many output tokens may be generated, and the approximate cost based on input and output token prices. It is useful for planning AI API usage, comparing model pricing, and estimating the cost of prompts before sending requests to a language model.
How to Use This Token Calculator
- Enter or paste your prompt, context, or message into the text area.
- Choose the expected output size as a percentage of the input or as a fixed token count.
- Enter the input token price and output token price, usually shown as dollars per 1 million tokens.
- Click Calculate to view token count, estimated output tokens, token ratio, and estimated costs.
What Are Input Tokens and Output Tokens?
Input tokens are the tokens contained in the text you send to an AI model, such as prompts, instructions, and conversation history. Output tokens are the tokens generated by the model in its response. Many AI providers price input and output tokens separately.
Why Token Counts Matter
Token counts affect API cost, context window usage, and response limits. A longer prompt usually consumes more input tokens, while longer generated answers consume more output tokens. Estimating tokens in advance can help control costs and optimize prompts.
AI Model Token Pricing Comparison
| Model | Input/1M Tokens | Input(cached)/1M Tokens | Output/1M Tokens | Input Price | Input(cached) Price | Output Price |
|---|---|---|---|---|---|---|
| GPT-5.5 | $5.00 | $0.50 | $30.00 | $0.000005 | $0.0000005 | $0.00003 |
| GPT-5.4 | $2.50 | $0.25 | $15.00 | $0.0000025 | $0.00000025 | $0.000015 |
| GPT-5.4 mini | $0.75 | $0.075 | $4.50 | $0.00000075 | $0.000000075 | $0.0000045 |
| Claude Opus 4.7 | $5.00 | $0.50 | $25.00 | $0.000005 | $0.0000005 | $0.000025 |
| Claude Sonnet 4.6 | $3.00 | $0.30 | $15.00 | $0.000003 | $0.0000003 | $0.000015 |
| Claude Haiku 4.5 | $1.00 | $0.10 | $5.00 | $0.000001 | $0.0000001 | $0.000005 |
| Gemini 3.1 Pro (Preview) | $2 | $0.2 | $12 | $0.000002 | $0.0000002 | $0.000012 |
| Gemini 3.1 Flash-Lite (Preview) | $0.25 | $0.025 | $1.5 | $0.00000025 | $0.000000025 | $0.0000015 |
| Gemini 2.5 Pro | $1.25 | $0.125 | $10.00 | $0.00000125 | $0.000000125 | $0.00001 |
Write Reply to This Calculator