What are tokens and a context window in AI models?

Author: Mobilina Team · Published:

Illustration of a sentence split into tokens and a context window bar filled by instructions, history and the answer.

Short answer: A token is the small piece of text a language model actually reads and writes. It’s often part of a word, sometimes a whole word or a punctuation mark. In English, one token is roughly four characters, or about three quarters of a word. The context window is the maximum number of tokens a model can handle in one request: your instructions, the conversation so far, any documents or tool results, and the answer it writes. Providers bill by tokens and set limits in tokens, so they affect cost, speed and what the model can “see” at once.

What is a token?

Models don’t read letters or words directly. A tokenizer first splits the text into pieces from a fixed vocabulary, and the model works with those pieces. Common words are often a single token; rarer words are split into several.

The providers give similar rules of thumb for English:

Provider Rule of thumb
OpenAI About 4 characters, or ¾ of a word, per token; 100 tokens ≈ 75 words
Google (Gemini) About 4 characters per token; 100 tokens ≈ 60–80 English words

These are estimates. The exact count depends on the model’s tokenizer, and it can change between versions of the same model family: Anthropic notes that Claude Opus 4.7 and later use a newer tokenizer that produces about 30% more tokens for the same text. If cost or limits matter, count with the provider’s own tool instead of estimating. Anthropic, for example, offers a free endpoint that returns the input token count before you send a request.

Why does the language matter?

The rules above are for English. Other languages often need more tokens for the same meaning, because tokenizers are mostly trained on English-heavy text.

Petrov and colleagues measured this at NeurIPS 2023. They used the same set of 2,000 sentences translated into about 200 languages and compared token counts with English. Depending on the language, the same content needed up to 15 times as many tokens. For Turkish, the paper’s appendix gives a ratio of about 1.9 with the tokenizer used by GPT-3.5 and GPT-4 (cl100k_base): the same text took roughly twice as many tokens as in English. Newer tokenizers may do better, so measure with the model you use.

More tokens for the same text means three practical things: a higher bill when pricing is per token, slower answers, and less room in the context window.

What fills the context window?

Anthropic’s documentation describes the context window as the model’s working memory and lists what counts toward it:

  • the system prompt and instructions,
  • every message in the conversation, carried over from turn to turn,
  • tool definitions and tool results,
  • images and documents,
  • the answer the model generates, including any reasoning (“thinking”) it does first.

The output also has its own, smaller limit. Models cap how many tokens they write in one response, and you can set a lower cap per request.

How big are context windows today?

As of December 2026, the figures in the providers’ documentation are:

Model family Context window Separate output cap
Current Claude models (e.g. Opus 4.6–5.5, Sonnet 4.6–5.5) 1M tokens; some other models 200K Up to 128K tokens
Gemini 3 and 2.5 1,048,576 input tokens 65,536 tokens

Anthropic puts 1M tokens at roughly 555,000 English words. These numbers change often; check the provider’s models page before relying on them.

What happens when it’s full?

With Anthropic’s API, a request whose input alone exceeds the window is rejected with an error. On newer Claude models, if the answer runs into the limit while being written, generation stops and the response says why. In a chat product, older parts of the conversation may be dropped or summarised to make room, so the model may “forget” something you said earlier.

Is a bigger context window always better?

A large context window lets you include more, but the model doesn’t use every part of it equally well.

  • Position matters. In “Lost in the Middle” (TACL 2024), Liu and colleagues found that models answered best when the relevant information was at the start or end of the input, and noticeably worse when it was in the middle, including models built for long contexts.
  • Accuracy drops with length. Anthropic’s documentation says accuracy and recall decline as the token count grows, and calls this “context rot”.
  • Every token is paid for. Providers price input and output tokens separately, and output usually costs more; on Anthropic’s current models it’s five times the input rate.

What does this mean in practice?

  • Keep what’s in the window relevant. Instead of pasting every document into every request, retrieve the parts that answer the question. That’s what RAG does.
  • Put the essentials where the model looks. Clear instructions at the start, the actual question at the end.
  • Budget for your language. If your users write in Turkish or another non-English language, estimate tokens from real samples, not from English rules of thumb.
  • Count before you scale. Use the provider’s token counter on typical requests to estimate cost and to see how close you are to the limit.
  • Expect forgetting in long chats. If a fact must hold for the whole conversation, put it in the instructions rather than relying on an early message. Missing context is one reason models make things up.

Summary

  • A token is a piece of text; in English about four characters or ¾ of a word.
  • The context window holds instructions, history, documents, tool results and the answer, all counted in tokens.
  • The same content can cost far more tokens in other languages; for Turkish, about twice as many with GPT-4’s tokenizer.
  • A bigger window isn’t a free pass: information in the middle is used less reliably, and every token costs money.

Sources

  1. Understanding and counting tokens – OpenAI Help Center
  2. Understand and count tokens – Google
  3. Context windows – Anthropic
  4. Token counting – Anthropic
  5. Models overview – Anthropic
  6. Lost in the Middle: How Language Models Use Long Contexts (Liu et al., TACL 2024) – ACL Anthology
  7. Language Model Tokenizers Introduce Unfairness Between Languages (Petrov et al., NeurIPS 2023) – arXiv