A token is a chunk of text
Language models don't see letters or words — they see tokens: short
chunks of text produced by a tokenizer. A token might be a whole common word like
hello, half of a longer word like understand →
under + stand, a piece of punctuation, or a few characters of
code. Each token maps to an ID the model was trained on.
For everyday English the rule of thumb is simple:
- 1 token ≈ 4 characters ≈ ¾ of a word
- 100 tokens ≈ 75 words ≈ half a page of text
- Code: roughly 2.5 characters per token (denser)
- CJK languages (Chinese/Japanese/Korean): often 1–1.5 characters per token
Why tokens matter: cost
APIs charge separately for input tokens (what you send) and
output tokens (what the model replies), and output usually costs
3–5× more. A GPT-4o call with 10K input and 2K output tokens costs about
$0.045. Run that 1,000 times a day and you're near $1,350/month.
Why tokens matter: context windows
Every model has a maximum context window — from 8K tokens on legacy models to 1M+ on Gemini-class flagships. Your system prompt, conversation history, retrieved documents and the reply all share that budget. Exceed it and the request fails or truncates.
How to count tokens
- Exact: use the provider's own tokenizer library (
tiktokenfor OpenAI,countTokensfor Gemini). - Fast estimate: divide characters by ~4 (English) or use our calculator's character-density method across Latin, CJK, code and more.
- Plan budgets: multiply estimated tokens by the model's per-million price — including cache discounts and batch mode.
Five ways to spend fewer tokens
- Prompt caching — repeated system prompts cost 50–90% less on cache hits.
- Batch mode — async workloads get −50% on OpenAI-compatible APIs.
- Right-size the model — mini/flash classes handle routine tasks at 5–30× lower cost.
- Trim history — summarize old turns instead of resending them verbatim.
- Cap output — set max output tokens; replies are the expensive side.
Estimate your tokens free
Paste any text into AITokenCalculator's free token calculator to see instant token counts and dollar costs across 51 models from nine providers — including images, audio and multi-turn conversations.