Token count vs every model context limit, with headroom percentages.
≈ 0 tokens · 0 characters
📏 Token counts are close estimates (chars÷4 for Latin text, ~1.1 per CJK char) — treat 5% margins as noise. Output tokens share the same window, so reserve headroom for the response plus system prompt.
The Context Window Checker is based on the following formula:
tokens ≈ characters ÷ 4 fill = tokens ÷ context window × 100 remaining = context window − tokens
Variables: tokens = Estimated token count (1 token ≈ 4 characters of English, closer to 3 for code) characters = Character count of the pasted text or code context window = Model's maximum context (tokens, e.g. 128,000) fill = Percentage of the window your text occupies (%) remaining = Tokens left for instructions, other files, and the model's reply
Estimates come from the rule of thumb that one token averages about 4 English characters, so a quick character count predicts usage without running a real tokenizer. Dividing by each model's context window shows how much of that model's memory your text consumes and how much room is left for everything else.
Worked example: Step 1: paste 48,000 characters of code → tokens ≈ 48,000 ÷ 4 = 12,000. Step 2: on a 128,000-token window: fill = 12,000 ÷ 128,000 = 9.4%. Step 3: remaining = 128,000 − 12,000 = 116,000 tokens. Step 4: on a 32,000-token window: fill = 12,000 ÷ 32,000 = 37.5%, leaving only 20,000 tokens. Result: the same paste is a light 9.4% load on a large-context model but over a third of a small one.
Modern models range from 128k to 2M tokens — but long prompts still degrade reasoning (the "lost in the middle" effect) and cost real money per request. Fitting is necessary, not sufficient.
Latin text approximates 4 characters per token; CJK characters run ~1.1 tokens each. Real tokenizers vary by 5-10% per model — treat the bars as gauge, not odometer.
The window is shared: prompt + response must fit together. A 200k prompt against a 200k window leaves zero room for any answer — keep prompts under ~80% unless streaming.
System prompts compress well (drop few-shot examples first), retrieved documents should re-rank before stuffing, and chat history benefits from summarizing turns older than a dozen.
More tools you might find useful
CSV training rows → OpenAI chat-format JSONL, mapped and validated.
Embedding costs across models: dimensions, $/1M tokens, workload totals.
Estimate tokens and API cost for GPT, Claude, and Gemini prompts.
Rescue malformed LLM JSON — truncated, trailing commas, fences.