Explainer
What are tokens in AI?
Why tokens matter
Pricing, speed, and context limits are usually measured in tokens. If a model has an 128k context window, that means it can consider roughly that many tokens of combined input and output at once.
A short English sentence might be 10–20 tokens. A long document can be thousands.
Tokens vs words
Tokens are not a perfect 1:1 match with words. Common words may be one token. Rare words, code, or other languages may split into several tokens. That is why two paragraphs with similar length can cost different amounts to process.
Examples
- "hello" may be one token
- A long URL or code snippet can use many tokens
- Chat history counts toward the token limit
Common questions
Do more tokens always mean better answers?
No. More context can help, but noisy or irrelevant text can also confuse the model. Quality of input usually matters more than dumping everything in.
Glossary terms
Keep reading
- What is an LLM?
An LLM (large language model) is software trained on huge amounts of text so it can predict and generate language. It does not think like a person; it estimates likely next words, sentences, and answers based on patterns it has seen.
- What is RAG?
RAG stands for retrieval-augmented generation. It means an AI system first retrieves relevant information from a knowledge source, then uses that material to generate an answer. This helps ground responses in specific documents instead of only the model's training memory.
- What are embeddings?
Embeddings are numeric representations of content—usually lists of numbers—that place similar meanings closer together in a vector space. They let software compare text, images, or other items by meaning instead of exact keyword match.