All guides
Terminology· 2 min

What is a context window?

The context window is the maximum amount of text a model can consider at once — inputs and outputs combined.

Key idea

Measured in tokens (~4 characters each). Bigger windows let models read whole books, but cost more per call and can lose focus.

Example

GPT-4o Turbo: 128k tokens (~300 pages). Gemini 1.5 Pro: up to 2M. Claude Sonnet: 200k.

What to remember

  • Long context ≠ perfect recall (see 'needle in a haystack' tests)
  • Costs and latency grow with input length
  • Retrieval (RAG) is often cheaper than dumping everything in