LLM Token Counter & Cost Calculator

Estimate token counts and compare API costs across Claude, GPT, and Gemini — paste text, pick a model, get an instant cost estimate.

Estimated tokens0
Characters0
Words0
~Tokens / word-
Estimated cost per request $0.00
Input cost$0.00
Output cost$0.00
Cost / 1,000 requests$0.00
Cost / 1M requests$0.00

How the token estimate works

This tool estimates tokens with a characters-per-token heuristic (about 4 characters per token for typical English). Real tokenizers differ by model and language, so treat the number as a budgeting estimate — for exact counts, use each provider's official token-counting endpoint (Anthropic: POST /v1/messages/count_tokens). Non-English text is the biggest source of error here: languages such as Korean, Japanese, and Chinese pack far fewer characters per token than English, so this estimate can understate their real token count by a wide margin. Don't budget non-English workloads from this number alone. The cost calculator multiplies your input and output token counts by the model's per-million-token prices.

About the prices

Claude prices reflect published Anthropic list pricing (Opus 5 and Opus 4.8 $5/$25, Sonnet 5 $3/$15, Haiku 4.5 $1/$5, Fable 5 $10/$50 per 1M input/output tokens). GPT and Gemini entries are approximate and provided for comparison — every price field is editable, so adjust them to match your current contract or a newly released model. Model lineups and prices change often; the editable fields exist because any hardcoded list goes stale.

Tips to cut LLM cost

  • Use prompt caching for large, repeated context — cached reads cost a fraction of full input price.
  • Pick the smallest model that meets quality needs; reserve the top tier for hard tasks.
  • Cap output tokens and stream — output tokens are usually the most expensive part.

Frequently Asked Questions

How accurate is the token count?

This tool gives a fast client-side estimate using a characters-per-token heuristic (roughly 4 characters per token for English). Real tokenizers vary by model and language, so treat the number as an approximation for budgeting. For exact counts, use the provider's official token-counting endpoint.

Which models does the cost calculator support?

It includes current Claude (Opus, Sonnet, Haiku), OpenAI GPT, and Google Gemini models with editable per-million-token input and output prices. You can adjust any price in the model list to match your current contract or a newly released model.

Is my text sent to a server?

No. Token estimation and cost calculation run entirely in your browser. The text you paste never leaves your device.