1 Token ≈ How Many Characters: The Invisible Unit in LLM Billing
If you’ve ever calculated your AI API bills, you’ll notice that the unit of measurement is neither "characters" nor "words," but rather tokens. The first questi

1 Token ≈ How Many Characters: The Invisible Unit in LLM Billing
If you’ve ever calculated your AI API bills, you’ll notice that the unit of measurement is neither "characters" nor "words," but rather **tokens**. The first question engineers often ask is: Does one token equal one character? Not exactly.
How Tokens Are Split
Most modern large language models use tokenizers based on algorithms like Byte Pair Encoding (BPE). The logic is as follows: starting from characters or even bytes, the algorithm identifies which adjacent segments appear most frequently in the training corpus and merges them into a new symbol. This process repeats until the vocabulary reaches a predetermined size. High-frequency words are kept intact, low-frequency combinations are split apart, and items not found in the vocabulary (rare characters, emojis, special symbols) fall back to byte-level encoding.
The consequence is significant variation across languages:
- **English:** One token is approximately 4 characters, equivalent to 0.75 words.
- **Chinese:** One common character is approximately 1–2 tokens; rare words, place names, and personal names are often split character by character.
- **Japanese, Korean, and emojis** are similarly expensive.
Therefore, for the same 1,000-character body text, Chinese costs 2–3 times more than English. This isn’t price discrimination; it’s a direct result of vocabulary coverage.
Code is also more "expensive" than natural language. Identifiers, underscores, camelCase, and special symbols appear less frequently in training corpora and are often split every two or three characters. A commit message of the same length as a Chinese sentence might contain twice as many tokens as everyday conversation.
Two Reliable Methods for Cost Estimation
Don’t count by eye. Use these two methods:
1. **Use the `usage` field in the API response.** `prompt_tokens` and `completion_tokens` represent the actual billed amounts. This includes system prompts, few-shot examples, and all previous turns in the conversation.
2. **For offline estimation before making a request,** use the tokenizer corresponding to the model family (e.g., use `tiktoken` encodings for OpenAI models). Note that different model families have different vocabularies, so the token count for the same text will vary. Do not directly apply GPT-series token counts to Qwen or Claude.
Rough estimates are usually sufficient:
- English: 1 token ≈ 4 ASCII characters
- Chinese: 1 character ≈ 1.5 tokens (with a ±30% fluctuation)
Where Costs Hide
1. **System prompts are charged every time.** A 2,000-token system prompt called 10,000 times results in a fixed cost of 20 million tokens. On platforms that support prompt caching, placing static content at the beginning can significantly reduce the unit price once the cache is hit.
2. **Output tokens are typically 2–4 times more expensive than input tokens.** The parameter that impacts cost the most is how verbose the model is. Limiting responses to 500 tokens is often more cost-effective than providing 2,000 tokens of background context.
3. **Debugging and loops.** Retries, re-computations, and intermediate products from multi-turn function calling are invisible token consumers. During development, print out `usage` data alongside responses; don’t just look at the text.
A Copy-Paste Calculation Example
Assume a customer service Q&A system:
- System prompt: 3,000 tokens
- Average user question: 200 tokens
- Response limit: 600 tokens
- Daily calls: 10,000
Pricing (for example only; replace with your actual rates):
- Input: $3 per million tokens
- Output: $15 per million tokens
**Cost per call:**
- Input: 3,200 tokens ≈ $0.0096
- Output: 600 tokens ≈ $0.009
- Total: ≈ $0.0186
**Scaled to 10,000 calls per day:** $186
There are two optimization directions with vastly different efficiencies:
1. **Halve the system prompt:** Saves 1,500 input tokens per call, saving $45 per day, reducing the bill by 25%.
2. **Reduce average response length from 600 to 400 tokens:** Saves only $1 per day—negligible.
Prioritize the largest cost items first, then verify the effects with monitoring. This is far more reliable than tweaking prompts based on intuition.
Relationship with Context Window
The nominal context window is the total budget for both input and output. When processing long texts, available input space = Window Limit − Output you intend to generate. If you plan to "stuff several documents in," calculate based on the remaining quota after deducting the output space; otherwise, you will hit truncation limits or errors.
Final Thoughts
Tokens serve as the unit for three things simultaneously: the smallest grain of model understanding, the scale of context budget, and the billing unit. By logging and tracking the `usage` field, cost accounting shifts from guesswork to simple arithmetic: measure first, calculate second, and then systematically reduce costs item by item, starting with the most expensive components.
Comments
Share your thoughts!
Loading comments…