AI Compass

Tokens and context windows

How models measure text, and why there is a limit to how much they can read at once.

What is it?

Models do not read text letter by letter or word by word. They split it into tokens: short pieces that may be a whole word, part of a word, a punctuation mark or a space. Common English words are often one token, while rare words and many non-English scripts take more tokens.

The context window is the maximum number of tokens a model can consider at one time, including your messages, any files you attach, the instructions it was given and its own reply. When a conversation grows past that limit, older parts are dropped or summarized and the model can no longer see them.

Which models use it?

  • Chat assistants such as ChatGPT, Claude and Gemini all work within a context window.
  • API providers such as OpenAI, Anthropic and Google usually bill by the number of input and output tokens.
  • Different models have very different context window sizes, listed in each provider's documentation.
  • Providers publish tokenizer tools or token-counting features so developers can measure text.

How to use it

  1. Check the context window of the model you use in its official documentation.
  2. Start a new chat for a new task instead of continuing a very long conversation.
  3. Paste only the parts of a document that are relevant to your question.
  4. In long chats, ask the model to summarize the key decisions so far, then continue from that summary.
  5. Repeat critical instructions near your latest message if the conversation has become long.
  6. If you pay per token, keep prompts concise and ask for answers of a set length.

Benefits

  • Helps you understand why long chats can "forget" earlier details.
  • Lets you estimate cost and speed when using paid APIs.
  • Encourages focused prompts, which usually produce better answers.
  • Explains why some languages cost more tokens for the same meaning.

Limits and risks

  • A large context window does not guarantee the model uses every part of it equally well.
  • Details in the middle of very long inputs can be overlooked.
  • Longer inputs take more time and cost more on paid services.
  • Token counts differ between models, so the same text may fit in one and not another.

Prompt template

Copy it, replace the parts in [brackets] and paste it into any AI chat.

Here is a long text: [paste text]. First, summarize it in [number] bullet points that keep every fact I would need later, such as names, numbers and decisions. Then list any open questions. Keep the whole summary under [number] words so I can paste it into a new chat as context.

More in Foundations

Learn AI in the AI Compass app

Every guide and dictionary card is also in the AI Compass app, with saved items, search and “Try it” buttons that open chat, image or video with the example filled in. Reading is free; creating uses credits, and the price is shown before you start.