LLM context length calculator
Context length is one of the first numbers on any model card. Enter a context size and your typical message lengths to see what it means in practice: turns of conversation, words of history and pages of text.
■ system prompt ■ reply reserve ■ chat history
Words are converted at ~1.33 tokens per word (typical English). Once history exceeds the free budget, the oldest messages fall out of memory.
Context on model cards vs in practice
Model cards list a maximum context, but local runners often default to a smaller window to save memory. Ollama, LM Studio and llama.cpp all let you raise it, at the cost of more VRAM for the KV cache.
Choosing a context size locally
- 8K: short chats, minimal memory use.
- 16K-32K: most chat and role-play.
- 64K-128K: long documents and campaigns, much more VRAM.
Common questions
Does a larger context use more VRAM?
Yes. The KV cache grows with context length. Use the LLM VRAM calculator to include it in your estimate.
Why does my model forget even with a large context?
Your runner may be using a smaller default context, or the model may recall details in the middle of long prompts less reliably.
Is this calculator exact?
It uses an average of about 1.33 tokens per English word. Different tokenizers vary slightly.
Related
LLM VRAM Calculator
Estimate GPU memory for any LLM size, quantisation and context length, weights, KV cache and overhead.
Free toolAI Model Finder
Answer three questions, task, hardware, priority, and get suggested open-weight models to try.
Free toolLLM Token Counter
Estimate tokens, words and cost for any text and see how much of a model's context window it uses.
Free toolLocal vs API Cost Calculator
Estimate your monthly API bill for an open model and compare it with a flat subscription or what you would spend running it locally.
Free toolUncensored System Prompt Builder
Build a clear system prompt for uncensored, abliterated or fine-tuned local models, covering role, job, tone, format and your own boundaries.
Free toolImage Model VRAM Checker
Check whether open image models such as SDXL, FLUX, Chroma and Qwen-Image fit your GPU at BF16, FP8 or GGUF quantisation.
GuideRun a Local OpenAI-Compatible API Server for Any App
Serve local models through an OpenAI-compatible API with Ollama, LM Studio, llama-server or KoboldCpp, and connect chat apps, coding tools and scripts.
Now pick a model.
Use the directory to find a model that matches your numbers.