What is Token?
A unit of text that AI language models process—roughly equivalent to about 4 characters or 0.75 words in English. Tokens determine context limits and pricing.
In the context of AI language models, a token is a unit of text that the model processes. Understanding tokens is essential for working with AI effectively and managing costs.
What Is a Token?
A token is roughly:
The word "hamburger" might become two tokens: "ham" and "burger"
The phrase "I love AI" is 3 tokens
Why Tokens Matter
Context Windows
Every AI model has a maximum number of tokens it can process at once. This includes both your input and the model's output.
| Model | Context Window |
|-------|---------------|
| GPT-3.5 | 16K tokens (~12,000 words) |
| GPT-4 | 128K tokens (~96,000 words) |
| Claude | 200K tokens (~150,000 words) |
Pricing
API usage is typically charged per token. Both input and output tokens count toward your bill.
Response Limits
Longer prompts leave less room for responses. A very long input may result in truncated outputs.
Token Counting
Different models tokenize text differently. A sentence that's 20 tokens in GPT-4 might be 22 tokens in another model.
Tools exist to count tokens before sending to an API, helping you stay within limits and estimate costs.
Practical Implications
For Users
For Developers
Tips
Examples
Want to learn more AI terms?
Browse All TermsRelated Terms
ChatGPT
An AI chatbot created by OpenAI that can understand and generate human-like text, answer questions, write content, and assist with various tasks through conversation.
Prompt Engineering
The practice of designing and optimizing inputs (prompts) for AI systems to get the most accurate, useful, and relevant outputs.
Large Language Model (LLM)
An AI model trained on massive amounts of text data that can understand, generate, and work with human language at a sophisticated level.