AI Token Calculator

Estimate your AI API cost before you write a line of code

Model input, output, and cached tokens across the major providers, then project the cost across thousands of requests. Everything runs privately in your browser.

Calculator

Calculate AI API Cost

Pick a provider and model, enter your token counts, and see the exact cost — plus projections for 1K, 10K and 100K requests.

Rates used: input 5/1M, output 30/1M, cached 0.5/1M (USD).

Results

Enter values and press Calculate to see your estimated cost.

Document Analyzer

Long Document Cost Analyzer

Paste or upload a document, choose your task, and estimate how much it costs to process across every model.

100% in-browser — your document is never uploaded to any server.

Estimate

Total characters0
Chinese characters0
Estimated input tokens0
Estimated output tokens (×0.1)0

Character heuristic only: Chinese chars / 1.5 + other chars / 4. This is not any model's tokenizer. In a frozen three-prompt Gemini 3.7 Flash sample, Japanese was underestimated by 13.5%–25.6%. Read the experiment.

Estimated processing cost by model

Based on 0 input + 0 output tokens.

ProviderModelEst. cost (USD)
OpenAIGPT-5.6 Sol$0.00cheapest
OpenAIGPT-5.6 Terra$0.00
OpenAIGPT-5.6 Luna$0.00
AnthropicClaude Opus 5$0.00
AnthropicClaude Sonnet 5$0.00
AnthropicClaude Haiku 4.5$0.00
GoogleGemini 3.7 Flash$0.00
GoogleGemini 3.5 Flash$0.00
GoogleGemini 3.5 Flash-Lite$0.00
DeepSeekDeepSeek V4 Flash$0.00
DeepSeekDeepSeek V4 Pro$0.00
Learn

How AI Token Pricing Works

A quick primer on tokens, pricing mechanics, and how to keep your AI costs under control.

What is an AI token?

A token is a small chunk of text — roughly 4 characters or ¾ of a word in English. Models read and write in tokens, and API providers bill you per million tokens processed.

Input tokens vs output tokens

Input tokens are everything you send to the model (your prompt, context, and documents). Output tokens are what the model generates back. They are usually priced separately.

Why output tokens usually cost more

Generating text is more compute-intensive than reading it, so output tokens are typically priced 2–5× higher than input tokens. Long answers can dominate your bill.

How long documents increase cost

Every character of a document becomes input tokens. A large report can be tens of thousands of tokens, and re-sending it on each request multiplies the cost quickly.

How to reduce AI API spending

Use smaller or cheaper models for simple tasks, cache repeated context, trim prompts, summarize before analyzing, and cap output length. Compare providers before committing.

FAQ

Frequently Asked Questions

A token is a small unit of text that AI models process — roughly 4 English characters or three-quarters of a word. Providers charge per million tokens for both input and output.

Multiply your input tokens by the model’s input price per million, multiply your output tokens by the output price per million, add any cached-input cost, and sum them. This calculator does it automatically.

It depends on the document length and model. Paste your document into the Long Document Cost Analyzer above to estimate tokens and see the cost across GPT, Claude, Gemini and DeepSeek.

The lowest per-token row is not automatically the lowest-cost model for every task. Compare the dated rates, then measure retries, latency, tokenization, and task success for your workload.

In the manually reviewed reference dataset, listed DeepSeek models cost less per token than the listed OpenAI GPT models. Pricing changes often, so always verify the linked official pricing pages.

Comparable Claude models may cost more per token than Google’s Gemini Flash tier, while some Claude and Gemini Pro rates are closer. Check the reviewed date and linked official sources.

Token counts use a character heuristic (Chinese chars / 1.5 + other chars / 4), not any model's tokenizer. In a frozen three-prompt Gemini 3.7 Flash sample, absolute error ranged from 2.1% to 27.3%; all three Japanese prompts were underestimated by 13.5%–25.6%. Use the tool for rough budgeting, not billing-exact figures.

No. All text analysis happens entirely in your browser. Your pasted text and uploaded files are never sent to a server, uploaded, or stored anywhere.