Buy me a coffee
AI

Context Window Calculator

See how much of a model's context window your text fills. Visualize usage instantly. Runs on your device — nothing is uploaded, nothing is stored.

GPT-4o — OpenAI
Token Count0 / 128,000

0.0% % Filled

0Token Count
128,000Context Window
0.0%Context Used
128,000Tokens Remaining
About Context Window Calculator

This calculator shows how much of an AI model's context window your text would fill. Paste a prompt, a document or a whole conversation, choose one of 13 models from OpenAI, Anthropic, Google, Meta, Mistral and DeepSeek, and it shows the token count against the model's window, a progress bar, the percentage used and the tokens remaining. The bar turns from green to yellow, orange and red as it fills, and a warning appears above 80% and a critical note above 95%.

Window sizes range from 64,000 tokens for DeepSeek V3 to 1,000,000 for Gemini 2.0 Flash and 2,000,000 for Gemini 2.0 Pro; the Claude models and o1 and o3-mini are listed at 200,000. A Load sample button fills in a short example. The tool reports token usage only and does not calculate cost; use the AI cost calculator for that.

Why this runs on your device

Prompts are where people paste source code, customer messages and internal documents. The tokenizer here is a JavaScript library bundled into the page, so your text is counted on your device and is not sent to a server, an API or a model provider just to measure it.

How to use Context Window Calculator
  1. Select a model from the list.
  2. Paste your prompt or conversation into the text box, or load the sample.
  3. Read the token count, the percentage of the context window used and the tokens remaining.
  4. Trim your text if the bar is orange or red.
Limitations and trade-offs
  • Counts are estimates. The tool uses one OpenAI-style tokenizer for every model. Claude and Llama 3.3 counts are scaled by a small fixed factor, and the other models are not adjusted, so the real count from each provider's own tokenizer can differ, especially for code and non-English text.
  • The window shown is the model's total limit, and tokens remaining is simply that minus your text. Output you want the model to write also has to fit, so leave room for it.
  • Window sizes are fixed values stored in the tool for the 13 listed models. Providers change limits and release new models, so check the provider's documentation for the current figure.
  • It counts text only. Images, files, tool definitions and system prompts you add elsewhere are not included unless you paste them in.
Frequently asked questions