LLM Token Counter & API Cost Calculator

Count tokens and compare real-time API costs across Claude, GPT, Gemini, and DeepSeek. Runs 100% locally in your browser — your prompts never leave your device.

Try sample:
Est. Input Tokens
0
Selected model estimate
Cost / Request
$0.00
Input + output + cache
Monthly Cost
$0.00
At configured volume
Characters
0
0 words · 0 B
0 / 200,000 tokens 0.00%

Multi-Model API Cost Comparison

Sorted from lowest to highest monthly cost · Prices in USD per 1M tokens
Model Provider Est. Input Tokens Input / Output (1M) Cost / Req Monthly Cost Context

Explore Model-Specific Calculators

How LLM Token Counting & API Pricing Work

Large language models do not bill by characters or words — they bill by tokens. A token is a chunk of text (often 3–4 English characters, or roughly 0.6–0.75 of an English word). For Chinese, Japanese, and Korean (CJK) text, a single character frequently maps to 1–2 tokens depending on the model's vocabulary size.

When building production AI apps, agents, or batch data pipelines, two numbers determine your real bill: output tokens (typically 3× to 5× more expensive than input tokens) and prompt caching (which can cut repeated system-prompt input costs by 50%–90%).

Why Estimate Locally Before Calling an API?

Note on accuracy: Browser-side counts are calibrated estimates per model family (within a few percent of official BPE tokenizers). Always verify final billing against your provider's API usage response header.

Frequently Asked Questions

How many words are 1,000 tokens?

In English prose, 1,000 tokens is roughly 750 words (about 4,000 characters). Code, JSON, and non-English languages use more tokens per word.

How much does 1 million tokens cost?

Input pricing ranges from ~$0.15 per 1M tokens (GPT-4o mini) and $0.27 (DeepSeek V3) up to $3.00 (Claude Sonnet 4.5) and $15.00 (Claude Opus 4.5). Output tokens cost 3×–5× more.

Does this tool send my prompt to a server?

No. TokenCostHub calculates token counts and API costs entirely in JavaScript inside your browser. Nothing is uploaded or logged.

How does prompt caching affect API cost?

If you reuse the same system prompt or long context across requests, cached input tokens are billed at a 50%–90% discount on Anthropic, OpenAI, Google, and DeepSeek APIs.