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.

Multi-model context fit
Compare your prompt against every registry model context limit with honest 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 is this different 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 — confirm critical limits on 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 will it fit, 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.

AI & LLM

Token counting, pricing estimates, and context-window fit — 100% browser-local.

Explore other tool categories

Minify

Shrink code and assets for production — minify JavaScript, CSS, HTML, JSON and XML before gzip or CDN deploy.

Unminify

Expand minified or compressed code — unminify JavaScript, CSS, TypeScript, SCSS, LESS, SQL, YAML and other formats when debugging or reviewing.

Conversion

Transform data between JSON, YAML, XML and CSV locally — no server uploads.

Encoding

Encode or decode Base64, URL components and HTML entities — client-side only.

Serialization

Serialize and deserialize PHP data structures beside JSON workflows.

JSON Tools

Validate, format, diff and explore JSON payloads — complementary to minifiers and converters.

SVG Tools

Preview, optimize with SVGO, export Data URI, resize, beautify, convert to JSX and validate SVG — all in your browser.

Beautify

Make code readable with consistent indentation — beautify JavaScript, CSS, TypeScript, SCSS, LESS, Markdown, GraphQL, SQL, YAML and more in your browser.

CSS preprocessors

Compile SCSS or LESS to standard CSS in the browser — pair with beautify or minify for a full stylesheet workflow.

Color & CSS Tools

Paste-local WCAG contrast checking with modern CSS color syntax — pair and matrix views, never uploaded.

DevOps & Infra

Terraform HCL format/validate/minify, Dockerfile format & lint, Docker Compose and .env validation.

CI/CD

GitHub Actions and GitLab CI — format YAML and check workflow/job structure in your browser.

Logs & observability

Line-oriented JSON/NDJSON and Nginx/Apache access logs — format, filter, validate, and CSV/TSV.

Kubernetes

Multi-doc manifests, structural validate, Ingress/Deployment starters, and Helm values formatting.

Networking / IP

CIDR, subnets, and IPv4/IPv6 helpers — in your browser.

Security & tokens

JWKS, X.509 certificates, and secrets scan — browser-local.

API & schemas

OpenAPI tools to format, validate, and lint your specs.

HTTP Tools

Paste-local cURL, HTTP messages, URLs, HAR files, and Cookie / Set-Cookie headers — format and inspect in your browser, never sent.

Developer utilities

Timestamps, UUID, ULID, Nanoid, cron, passwords, regex, slugify, number bases, case, text diff, and chmod — all client-side.

Text & Markdown

Count words, build Markdown TOCs, and clean line lists — all in your browser.

Test Data

Synthetic field values for fixtures and DB seed — reserved-range phone numbers first.