gettokencalculator

AI Token Calculator

Enter token counts to estimate your LLM API cost. You can also paste a prompt to count its tokens.

Use the input count from your provider or expected workload.

API cost estimate

USD
Estimated monthly cost—
Per request—

Text counts use a reference encoding. Actual API usage and pricing can vary by model and tier.

Model pricing

Uncached text input and output in USD per 1 million tokens. Rates checked November 20, 2026.

ModelInputOutput
GPT-6.2 SolShort-context Standard $2.00$10.00
GPT-6.2 AstraShort-context Standard $8.00$40.00
GPT-6.1 TerraShort-context Standard $1.00$5.00
GPT-6 LunaShort-context Standard $0.10$0.50
Claude Sonnet 5.5 $2.00$10.00
Claude Opus 5.5 $4.00$20.00
Claude Fable 5.2 $8.00$40.00
Claude Haiku 5.5Prompts up to 100K tokens $0.10$0.50
Gemini 3.5 Flash-Lite $0.30$2.50
Grok 4.7Under 200K input tokens $2.00$6.00
DeepSeek V4.1 FlashPeak rates $0.30$1.20
DeepSeek V4 ProPeak rates $1.32$3.96

Presets use base text rates. Long prompts, cache usage, and separate tool fees can change the bill.

How to use the token calculator

Select a model, enter input and output tokens for one request, and set your expected monthly volume. The estimate includes both sides of the conversation and shows what one request costs. For input-only work, enter zero output tokens.

If you have a prompt instead of a measured count, choose Paste text. The browser reports how many tokens, words, and characters it contains. Open Inspect token IDs to see the token sequence. Switch back to Enter token count to use the measured input as a starting point and add any system instructions, message history, or tool schemas you expect to send.

From one request to your monthly bill

Suppose a request uses 1,000 input and 250 output tokens. At $2 per million input tokens and $10 per million output tokens, that is $0.0045 per request, or $4.50 for 1,000 requests. The figure scales linearly as long as the rate and mix of requests stay the same.

Use the token cost calculator if you have total usage from a report. To compare one model's input price with another model's output price, use the cost-per-token converter. For Anthropic workloads, the Claude calculator shows Claude's rates and a worked example.

How the text count works

The browser uses the o200k_base encoding, which OpenAI's tiktoken maps to models including GPT-4o and GPT-4.1. Tokenization counts part-words, punctuation, and line breaks. Code and multilingual text often behave differently from English prose.

A rate preset changes the price only. For Claude, Gemini, and models with another or unpublished encoding, enter the model's own measured token count when precision matters. Include anything the API also bills, such as reasoning tokens charged as output. The pricing table links to official sources for different tiers and any extra charges.

Does the calculator upload my prompt?

The tool processes calculator inputs in your browser. It does not send your prompt to a model or a counting service. Reloading the page clears the tool's session. See the privacy policy for the requests needed to deliver the site.