Context Window Calculator

    Context Window Calculator

    See how your text fits across every LLM's context window with a live token visualizer

    161 characters24 words
    (red = overflow, yellow = >80%, green = comfortable)
    DeepSeek R1 (reasoning)(64k)
    41
    0.1%
    Mistral Large 2(128k)
    50
    0.0%
    Mistral Medium 3(128k)
    50
    0.0%
    DeepSeek V3.1(128k)
    41
    0.0%
    Claude Haiku 4.5(200k)
    42
    0.0%
    o3 (reasoning)(200k)
    40
    0.0%
    Grok 4(256k)
    40
    0.0%
    GPT-5(272k)
    40
    0.0%
    GPT-5 mini(272k)
    40
    0.0%
    GPT-5 nano(272k)
    40
    0.0%
    Gemini 2.5 Flash-Lite(1,000k)
    45
    0.0%
    Gemini 2.5 Flash(1,048.576k)
    45
    0.0%
    Claude Opus 4.7(1,000k)
    42
    0.0%
    Claude Sonnet 4.6(1,000k)
    42
    0.0%
    GPT-4.1(1,047.576k)
    40
    0.0%
    Gemini 2.5 Pro(2,097.152k)
    45
    0.0%
    Llama 4 Maverick(10,000k)
    41
    0.0%
    Llama 4 Scout(10,000k)
    41
    0.0%
    Model:~42 tokens
    System: You are a codebase search assistant. User query: Show me how authentication flows through the API layer. [File: src/middleware/auth.ts 120 lines] ...

    Each highlighted chunk is ~1 token. Darker = more tokens for that word — good signal for long words or non-English text that tokenizes heavily.

    About the Context Window Calculator

    Every LLM has a fixed maximum 'context window' — the total tokens it can see at once (input + output). Hitting that ceiling means silent truncation and hallucinations. This tool measures your content across every frontier model simultaneously so you can pick the cheapest one that fits, and visualizes which parts of your text are token-heavy.

    Features

    How it works

    1. Paste or upload content.
    2. See the fit bar per model (green = comfortable, yellow = tight, red = overflow).
    3. Pick a model in the visualizer to see per-word token overlays.

    Use cases

    Frequently asked questions

    When do I need a 1M+ context model?

    +

    Full-codebase Q&A, hour-long meeting transcripts, long-document summarization. Most tasks fit in 100k-200k — beyond that, per-token costs dominate.

    Why is my CJK text so token-expensive?

    +

    Most Western-trained tokenizers allocate 1 token per CJK character, vs. ~4 chars/token for English. Claude and Gemini do slightly better (~1.2 chars/token CJK).

    Does context-caching change the math?

    +

    Cached tokens price at 10-25% of standard input tokens, so yes — for repeated system prompts or shared context, enable caching. We don't model cached vs. fresh here; assume fresh.

    Can I upload code files?

    +

    Yes, common source types: .py .ts .tsx .js .jsx .go .rs .java .rb etc. Token density for code is often higher than prose.

    What do the darker highlight intensities mean in the visualizer?

    +

    Darker = more tokens for that word — helpful for spotting unusual long words or non-English text that expands heavily.