Free tool · Token 计算器

AI token calculator

Paste any text and get an instant estimate of how many tokens it uses in GPT- and Claude-class models — and what that costs through the API. Works for English, code and 中文. Runs entirely in your browser: nothing is uploaded.

GPT & Claude estimates English · 代码 · 中文 Free, no signup
Quick answer

Tokens are the unit AI APIs bill you for — estimate before you spend.

A token is roughly 4 characters of English or about 1.5 characters of Chinese. Every API request is billed on input + output tokens, so knowing your prompt size before sending it is basic cost hygiene. The calculator below gives a close estimate without sending your text anywhere.

Promo code AI10 — 10% off your first top-up
Browse proxy plans

Paste your text

0Estimated tokens
0Characters
0Words / 字
$0.000Est. input cost (GPT-4o class)

Estimate: ~4 chars/token for Latin text and code, ~1.5 chars/token for CJK. Exact counts vary by model tokenizer (±10–15%). Cost shown at $2.50 per million input tokens.

What exactly is a token?

Models don't read characters or words — they read tokens, chunks produced by the model's tokenizer. In English, a token averages ~4 characters (“understanding” splits into several tokens; “the” is one). Chinese and Japanese pack more meaning per character, so they average ~1.5 characters per token — which is why the same paragraph costs more tokens in 中文 than its English translation.

Everything is billed in tokens: your prompt (input), the model's reply (output, usually priced 3–5× higher), and with vision models even images get token-priced. Long system prompts silently multiply costs on every single call.

Three habits that cut API bills

  1. Trim system prompts. A 2,000-token system prompt on a chatbot serving 10k requests/day burns 20M input tokens daily before users type a word.
  2. Cap output length. Output tokens cost several times more than input — set max_tokens to what you actually need.
  3. Batch and cache. Identical requests should hit your cache, not the API. Gateways like One API add usage accounting per key so you see who burns what — see our gateway guide.
FAQ

Token questions

How accurate is this estimate?

Within roughly 10–15% for typical text. Exact counts differ per model because each family uses its own tokenizer; for billing-critical work, check your provider's usage dashboard.

Is my text uploaded anywhere?

No. The calculator runs entirely in your browser with a few lines of JavaScript — nothing leaves your device.

Why does Chinese text use more tokens?

CJK characters carry more information each, so tokenizers split them into more tokens per character than English. Budget roughly one token per 1.5 Chinese characters.

Do input and output tokens cost the same?

No — output tokens typically cost 3–5× more than input. Controlling response length matters more than trimming prompts.

Proxy deals & AI-service outage news on Telegram

25,000+ subscribers get provider-outage alerts and discounts first — and you can buy proxies right inside Telegram via the mini-app shop.