AI Tokens Explained: What They Are and Why You're Billed on Them
Every AI bill, every "context window" warning, every "message limit reached" notice traces back to one unit: the token. Here's what it actually is, why providers chose it over words or characters, and what that means for what you pay.
What a token actually is
A token is a chunk of text — usually a few characters, sometimes a whole common word, sometimes just a piece of punctuation. Before a model reads anything you type, a separate program called a tokenizer breaks your text into these chunks and converts each one into a number. The model never sees "hello," it sees a short sequence of integers that a lookup table maps back to "hello" when it responds.
Tokens don't line up neatly with words. Short, common English words like "the," "is," and "cat" are usually a single token each. Longer or less common words often split into two or three pieces — "tokenization" itself is a good example, breaking into something like "token" + "ization." Numbers, code symbols, and non-English scripts split differently again, which is why the same sentence can cost different amounts depending on what language it's written in or whether it contains code.
The rule of thumb practitioners actually use: about 4 characters per token, or roughly 0.75 words per token, for ordinary English prose. That's close enough for budgeting. It is not exact — GPT, Claude, and Gemini each use their own tokenizer and will count the same paragraph slightly differently — but the gap is usually within about 10%, which is fine for anything short of a line-item invoice audit.
Why tokens instead of words or API calls
Billing by the API call would be unfair to the provider — a one-line question and a 10,000-word document pasted for summarization would cost the same, even though the second uses vastly more computing power. Billing by the word would be closer, but "word" is a fuzzy, language-dependent concept: it means something different in English than in Korean, German (which compounds words), or code, where there may be no whitespace at all.
Tokens solve this because they're the model's actual internal unit of work. The amount of computation a model spends is proportional to the number of tokens it processes, both reading your input and generating its output. Billing on tokens ties the price directly to the resource being consumed — the same reason electricity is billed per kilowatt-hour instead of per appliance plugged in.
How token counts behave in practice
A few patterns show up consistently once you start paying attention to token counts rather than word counts:
| Text | What happens | Why |
|---|---|---|
| Plain English prose | ~1.3 tokens per word | Most common words are single tokens |
| Rare or technical words | 2–4 tokens per word | Uncommon words get split into sub-pieces |
| Source code | 20–40% more tokens than prose of similar length | Brackets, operators, and indentation are all separate tokens |
| JSON or heavily formatted Markdown | Noticeably higher than plain text carrying the same information | Quotes, braces, and whitespace are billable characters |
| Korean, Japanese, Chinese, Thai | 1.5–3× more tokens per character than English | Non-Latin scripts are often split close to character by character |
The practical upshot: two products with identical functionality can have very different AI costs depending on the language their users type in and whether the output is plain text or structured formats like JSON. If you're building for a non-English market, budget from real samples in that language rather than translating an English estimate.
Tokens and the context window
Tokens matter for a second reason beyond pricing: every model has a maximum number of tokens it can hold in a single request, called the context window. This includes your prompt, any files or conversation history you send along, and the model's reply, all counted against the same limit. A 128,000-token context window sounds enormous until you remember that a fully attached PDF, a long chat history, and the system instructions all draw from the same pool.
This is also where a common miscalculation happens. Most chat APIs are stateless — the server doesn't remember your previous messages. To keep a conversation going, the app resends the entire prior conversation with every new turn. So an eight-turn conversation with 500-token messages doesn't cost 8 × 500 tokens; it costs closer to 12,000, because turn eight re-sends turns one through seven along with it. Teams that estimate cost from a single test message routinely underbudget by an order of magnitude once real conversations pile up.
From a token count to an actual bill
Providers price input tokens (what you send) and output tokens (what the model generates) separately, and output is almost always priced higher — often 3–5 times the input rate — because generating text is more computationally expensive than reading it. Some providers also offer a cheaper rate for cached input, where a repeated system prompt or document is billed at a fraction of the normal price on subsequent calls, which matters a lot for apps that resend the same instructions on every request.
You can see this worked out for real text with the AI Token Calculator — paste anything in and it shows the token count plus what it would cost as input or output across every major model. For sizing an entire product rather than one message, the AI API Cost Calculator and the chatbot cost simulator turn a per-token price into a monthly bill based on users and message volume, and the AI Model Cheat Sheet lists context windows and prices side by side so you can compare models without digging through separate pricing pages.
Practical ways to use fewer tokens
A handful of habits meaningfully reduce a token bill without changing what an AI product actually does:
- Trim conversation history instead of resending everything — summarize older turns once they stop being relevant.
- Cache repeated system prompts where the provider supports it; a prompt sent unchanged on every request is the clearest caching win available.
- Ask for concise output when you don't need it — output tokens cost more than input tokens, so a verbose reply is the most expensive part of most exchanges.
- Route simple tasks to cheaper models and reserve the most expensive model for the requests that actually need its extra reasoning.
- Strip unnecessary formatting from prompts and documents — plain text tokenizes more efficiently than heavily nested JSON or Markdown carrying the same information.
Frequently asked questions
Is a token the same as a word?
No. A token is roughly 0.75 words on average for English text, but the ratio varies a lot — common short words are usually one token each, while longer or rarer words split into several. Code, JSON, and non-English text all tokenize differently from plain English prose.
Why do GPT, Claude, and Gemini count the same text differently?
Each provider trains its own tokenizer on its own data, so the exact rules for splitting text into chunks differ between them. The counts are usually within 10–30% of each other for the same passage, which is close enough for budgeting but not for a precise cross-provider invoice comparison.
Does a longer conversation cost more per message, or just overall?
Both, in a way that surprises most people. Because most APIs resend the full conversation history with every new turn, message ten in a long chat carries a much larger token cost than message one, even if the new question itself is short. This is the single most common reason a chatbot's real bill exceeds an early estimate.