Deep Dive8 min read

What Are Tokens? The Currency Your AI Runs On

Tokens are how AI models read, think, and charge you. Learn what tokens actually are, why they matter, and how they affect the cost and quality of every AI interaction.

Why Should You Care About Tokens?

Every time you use ChatGPT, Claude, or any AI tool, you're spending tokens. Tokens are the fundamental unit of how AI reads your input, generates its response, and bills you for both. Understanding tokens is like understanding that your phone plan charges by the gigabyte — once you get it, you make smarter decisions.

If you've ever wondered why a long prompt costs more, why AI sometimes cuts off mid-sentence, or why some AI tools are cheaper than others, the answer is always tokens.

What Exactly Is a Token?

A token is a chunk of text that an AI model processes as a single unit. It's not a word, not a character, not a sentence — it's something in between.

Analogy

Think of tokens like LEGO bricks. Just as LEGO doesn't give you a pre-built house — it gives you small, standardized bricks you combine — AI doesn't read whole sentences. It breaks your text into small, standardized chunks (tokens) and processes them one by one.

Here's the surprising part: common words like "the" or "hello" are usually one token each, but less common words get split into pieces. The word "tokenization" might become three tokens: "token", "ization". A rare technical term might be split into four or five pieces.

Rule of thumb: In English, 1 token is roughly 3/4 of a word. So 100 words is about 130-140 tokens.

How Tokenization Works

Before an AI model can "read" your prompt, it runs it through a tokenizer — a fixed vocabulary that maps text chunks to numbers. The model doesn't see words; it sees a sequence of numbers.

Here's what happens step by step:

  1. You type: "How does machine learning work?"
  2. The tokenizer splits it: ["How", " does", " machine", " learning", " work", "?"]
  3. Each chunk maps to a number: [2437, 1515, 5765, 6044, 990, 30]
  4. The model processes the numbers and generates new numbers
  5. The new numbers map back to text — that's the AI's response
Tip

Key Takeaway

AI models don't understand language directly. They process sequences of numbers (tokens), and the tokenizer is the translator between human text and those numbers.

Why Tokens Determine Cost

AI providers charge per token — both for your input (prompt) and the output (response). This is why:

  • Short prompts are cheaper than long ones
  • Asking for a brief answer costs less than requesting a detailed essay
  • System prompts (the instructions behind the scenes) count toward your token cost too

Here's a real-world example. If an API charges $0.01 per 1,000 tokens:

| What you send | ~Tokens | Cost | |---|---|---| | "Summarize this paragraph" + a paragraph | 200 | $0.002 | | "Analyze this document" + 10 pages | 4,000 | $0.04 | | A full conversation with 20 back-and-forth messages | 8,000 | $0.08 |

Context Windows: The Token Limit

Every AI model has a context window — the maximum number of tokens it can handle in a single conversation (your input + its output combined). Think of it as the model's working memory.

  • GPT-4o: 128,000 tokens (~96,000 words)
  • Claude: up to 200,000 tokens (~150,000 words)
  • Smaller models: often 4,000-8,000 tokens

When you hit the context window limit, the model can't process any more text. This is why AI sometimes "forgets" things from earlier in a long conversation — older messages get dropped to stay within the limit.

What You Can Do With This Knowledge

Now that you understand tokens, you can:

  1. Write more cost-effective prompts — be specific and concise instead of verbose
  2. Choose the right model — don't use a 200K context model (expensive) when a 4K one will do
  3. Understand pricing — compare AI tools by their per-token cost, not just monthly subscriptions
  4. Debug AI behavior — if the AI cuts off or loses context, you've likely hit the token limit
Tip

Pro Tip

Many AI platforms have a token counter in their UI. Use it! Seeing your token count in real-time helps you develop an intuition for how expensive different prompts are.

The Bottom Line

Tokens are the atoms of AI interaction. Every prompt you write, every response you receive, and every dollar you spend on AI comes down to tokens. You don't need to count them obsessively, but understanding what they are gives you a superpower: you can predict costs, optimize your usage, and make informed decisions about which AI tools to use.

Ready to go deeper? This topic is covered in detail in our interactive course, where you'll get hands-on with tokenizers and learn to estimate costs for real projects.