What Is a Token?

A token is the basic unit of text that AI language models process. It's not exactly a word — it's closer to a word fragment. As a rough rule:

  • 1 token ≈ 4 characters in English
  • 1 token ≈ 0.75 words
  • 100 tokens ≈ 75 words ≈ half a paragraph
  • 1,000 tokens ≈ 750 words ≈ 1.5 pages of text

Tokens matter for two reasons: cost (you pay per token on every API call) and context window (the maximum tokens the model can read and reason over at once).


Context Window: The Most Important Number

The context window is how much text the model can "see" at once — your prompt, conversation history, documents, and its own response all count toward this limit. Exceed it, and the model either refuses or drops the oldest content.

Model Context Window Approx. Words Approx. Pages
GPT-4o 128,000 tokens ~96,000 words ~300 pages
GPT-4o mini 128,000 tokens ~96,000 words ~300 pages
Claude Haiku 4.5 200,000 tokens ~150,000 words ~460 pages
Claude Sonnet 4.6 200,000 tokens ~150,000 words ~460 pages
Claude Opus 4.7 200,000 tokens ~150,000 words ~460 pages
Gemini 2.5 Flash 1,000,000 tokens ~750,000 words ~2,300 pages
Gemini 2.5 Pro 1,000,000 tokens ~750,000 words ~2,300 pages

Token Pricing Comparison (2026)

Model Input / 1M tokens Output / 1M tokens Cache discount
GPT-4o $2.50 $10.00 50% off cached input
GPT-4o mini $0.15 $0.60 50% off cached input
Claude Haiku 4.5 $0.80 $4.00 90% off cached input
Claude Sonnet 4.6 $3.00 $15.00 90% off cached input
Claude Opus 4.7 $15.00 $75.00 90% off cached input
Gemini 2.5 Flash $0.15 $0.60 Automatic caching
Gemini 2.5 Pro $1.25 (≤200K) / $2.50 (>200K) $10.00 Automatic caching

Key insight: Output tokens are always more expensive than input tokens — often 4–5x more. If your app generates long responses, that's where your bill comes from.


What Does 1M Tokens Actually Let You Do?

Gemini 2.5 Pro's 1M token context window is genuinely transformative for certain tasks:

  • Load an entire medium-sized codebase (50–100 files) in one prompt
  • Process a full-length book (300+ pages) without chunking
  • Analyze hours of video transcript
  • Keep very long conversations without losing early context

For contrast, GPT-4o's 128K context fits:

  • ~200 pages of text
  • ~5,000–8,000 lines of code
  • A long but not unlimited conversation history

Claude's 200K fits:

  • ~460 pages of text
  • ~12,000–15,000 lines of code
  • Most real-world large document analysis tasks

Prompt Caching: The Hidden Cost Saver

If you send the same system prompt or context on every API call (common in production apps), prompt caching saves significant money:

  • OpenAI: 50% off cached input tokens — automatic, no code changes needed
  • Anthropic: 90% off cached input tokens — requires adding cache_control to your API calls
  • Google: Automatic caching — discount varies by model and usage

Example: If your app sends a 10,000-token system prompt on every request, Anthropic's 90% cache discount saves you $2.70 per 1,000 API calls vs. paying full price.


Which Model Should You Use?

For most apps (short-to-medium prompts, general tasks):
GPT-4o or Claude Sonnet 4.6 — both fast, high quality, good ecosystem support.

For cost-sensitive high-volume apps:
GPT-4o mini or Gemini 2.5 Flash — both under $0.20/M input, quality good enough for most tasks.

For long document processing or large codebases:
Claude Sonnet 4.6 (200K, best quality + 90% cache) or Gemini 2.5 Pro (1M context, competitive price).

For maximum reasoning quality (math, logic, complex agents):
Claude Opus 4.7 (extended thinking) or GPT-4o with o3 reasoning — expensive but best in class.


Quick Reference: Tokens to Real-World Sizes

Tokens ~Words What it fits
1,000750A long email or short article
4,0003,000A short story or 5-page document
16,00012,000A research paper or 20-page report
32,00024,000A short book chapter or large codebase file
128,00096,000A full novel or 200-page technical document (GPT-4o limit)
200,000150,000A long legal document or medium codebase (Claude limit)
1,000,000750,000An entire codebase or several books (Gemini limit)