Module 8 · LLM Concepts · Lesson 17 of 34
Tokens, context windows and cost
How text becomes tokens, why some text costs more, and what really fits in a context window.
In this lesson · about 18 minutes
- Estimate token counts for English, code and other languages
- Explain what the context window holds and what happens at its limit
- Estimate the cost of a workload from token counts and prices
A model never sees letters or words. A tokenizer first cuts text into tokens from a fixed vocabulary of roughly 50,000 to 200,000 pieces, learned from data so that common chunks get their own token.
- Common English words are usually one token, often including the space before them (" the").
- Long or rare words split into pieces ("tokenization" → "token" + "ization").
- Numbers, code symbols and many non-English scripts split into more, smaller tokens, so the same meaning can cost two or three times as much.
Rules of thumb for English: 1 token ≈ 4 characters ≈ ¾ of a word; 1,000 tokens ≈ 750 words ≈ a page and a half.
Try it · simulator
Tokenizer and cost estimator
Type or pick some text and see how it splits into tokens. Then scale it up to estimate a monthly bill.
Characters
64
Words
11
Tokens
15
Characters per token
4.3
This tokenizer is a simplified teaching version. Each model family has its own, learned from data, so counts differ a little between models. Most providers offer a token-counting tool.
Worked example
What does a document Q&A request cost?
Each question sends a 1,500-token system prompt, 6,000 tokens of retrieved document chunks and a 100-token question, and gets a 400-token answer. 3,000 questions a day. Illustrative prices: $3 per million input tokens, $15 per million output tokens.
Check your understanding0 of 3 correct
Quiz score: 0 of 3
Written by Noviq Academy in its own words. The simulators are small teaching models that keep the real idea and leave out the scale; their numbers (prices, speeds, scores) are illustrative. Model names, prices and features change quickly, so check your provider's current documentation before you build. Read-aloud uses your device's built-in voices.