Context Window Calculator — Fit vs Model Limit

See whether your prompt fits each model context window with configurable output reserve. Count tokens first with the LLM token counter, or check word and character stats before you paste.

…
Multimodel context fit
Compare your prompt against every registry model context limit with clear Exact/Estimate badges and configurable output reserve.

How fit is calculated

We count tokens locally with the same pipeline as the LLM token counter: js-tiktoken for OpenAI models, heuristics for Claude and Gemini. For each model we subtract your output reserve (default 15 %) from the published context window to get an effective input budget. Your prompt tokens are compared to that budget: • Safe: under 80 % of the effective budget • Near limit: 80 % or more but still fits • Won't fit: prompt tokens exceed the effective budget

How it differs from the token counter context meter

The token counter answers how many tokens? and shows a quick single-model usage bar. This tool answers will it fit? It compares all models with fit verdicts and a configurable output reserve. Use the token counter to audit counts and BPE breakdown; use this tool before you pick a model or trim a prompt.

Privacy

All counting runs in your browser. FastMinify never uploads prompts to OpenAI, Anthropic, Google, or any other provider.

Limitations

Estimate-tier counts are directional (±5–15 % typical). Context limits come from a manually maintained table, so confirm critical limits in the provider docs. For USD cost planning, use the LLM pricing calculator. Image, audio, and tool-call token rules are out of scope for v1.

Options that change fit

Reserve for response
Subtracts a percentage of each model context window before comparing your prompt. Higher reserve tightens fit verdicts because less room remains for input tokens.
Input format
Auto-detect treats a valid [{role, content}] array as Chat API messages with per-message overhead. Raw text counts the editor string literally.
Encoding override
For OpenAI models only. Force o200k_base or cl100k_base when testing legacy prompts against older GPT encodings.

FAQ

Context fit, reserve, and accuracy

What does the output reserve mean?

It holds back a percentage of the context window for the model reply. If GPT-4o has 128k tokens and you reserve 15 %, your effective input budget is 108.8k tokens. The rest is headroom for the assistant message.

How is this different from the token counter context meter?

The token counter shows a quick single-model usage bar while counting. This tool compares all registry models with fit verdicts and configurable reserve. Use it when the question is whether it fits, not how many tokens.

Why are Claude rows labeled Estimate?

Anthropic does not publish a browser-side tokenizer. We use the same characters-per-token heuristic as the token counter and label results Estimate so you are not misled.

Does my prompt leave the browser?

No. All tokenization and fit math run locally. FastMinify does not call provider APIs.

Where do context limits come from?

From the same versioned llm-models.json table as the token counter and pricing tools, reviewed manually.

Count tokens, estimate API costs, check context-window fit, convert JSON to TOON and analyze prompts, all in your browser.