LLM Cost Estimator
Estimate multi-model API cost from tokens or pasted prompts.
OpenSee how much of a model's context window your prompt already uses.
Select 8K, 32K, 128K or 200K tokens.
Include system text, history and retrieved context.
See tokens, percent of the window and tokens remaining.
Trim or remove context until the reply has room.
You are stuffing retrieved documents into a prompt and want to know how many more will fit before the request fails. Or a long system prompt seems to be crowding out conversation history. Context Estimator shows what fraction of the window is gone.
Choose a context window of 8K (8,192 tokens), 32K (32,768), 128K (128,000) or 200K (200,000), then paste the prompt. The output shows approximate tokens, the window size, percentage used to two decimals, and how many tokens remain. Changing the window or editing the text recalculates instantly.
Remember that the model's reply comes out of the same window on most APIs. If you expect a 2,000-token answer, keep at least that much free rather than filling the window to 99 percent. The estimate uses about four characters per token, which can undercount code and non-English text, so leave extra margin near the limit. To plan how many chunks fit, size them first in the RAG Chunk Simulator. For a per-model cost on the same text, try the token and cost counter, and if you need to win back space, trimming filler from the prompt is a quick first pass.
The calculation is arithmetic on text length inside this page. Your prompt is not stored or uploaded.
Keyboard shortcut
Answers for this tool. For site-wide help, open the FAQ hub.
Use the context length listed in your provider documentation for the exact model version. If it is not one of the four options, pick the nearest smaller one so the estimate errs on the safe side.
No. It measures only the text you paste. Subtract the maximum output length you plan to request from the remaining figure to see what is really left.
The four-characters-per-token rule can undercount, and chat formats add a few tokens per message for roles and separators. Near the limit, those small differences are enough to cause an overflow.