Online Token Calculator
Quickly estimate the number of LLM tokens and API call costs. Supports mainstream models such as GPT-4o, Claude, DeepSeek, Gemini, and Qwen, and includes pricing for both cache hits and misses.
| Model | Enter Price / 1M Token | Output Price / 1M | Context | Occupancy | Cost Estimate | Operations |
|---|
What is a token?
A token is the smallest unit of text processed by a large language model, falling between a character and a word. In English, a common word typically corresponds to about 1 token; in Chinese, each character corresponds to approximately 1.5 to 2 tokens.
Calculation formula:
T = Number of Chinese characters × 1.5 + Number of English letters ÷ 4 + Number of digits ÷ 2 + Number of punctuation marks × 0.5
Note:This is an approximate estimate; the actual number of tokens varies depending on the tokenizer used by each model (e.g., GPT-4o uses o200k_base, while Claude uses the Anthropic Tokenizer). Cost estimates are for reference only; actual costs are subject to the API provider’s billing.
Instructions for Use:
- Supports custom models: Click “+ Add Model” to enter custom model parameters (name, pricing, context window).
- All prices are editable: Double-click a price in the table to edit it directly.
- Price Difference Between Cache Hits and Misses: Models such as DeepSeek have very low cached prices; please select based on your actual API call volume.
- Expected Output Tokens: Set the number of output tokens generated by the API call. Total fee = Input fee + Output fee
- USD/CNY Dual Currency: Supports one-click switching between U.S. dollars and Chinese yuan; DeepSeek uses Chinese yuan for pricing
- All data processing is performed locally in the browser and is not uploaded to any server.



