LLM Token & Cost Calculator
Estimate prompt token counts and project single-request and monthly batch inference costs with prompt caching.
Model Pricing & Token Settings
About This Tool
Deploying large language models (LLMs) requires estimating token consumption and understanding provider pricing models. Pricing structures charge per million tokens and often differentiate between fresh input tokens, cached prompt tokens, and generated output tokens.
This utility provides an in-browser token estimator calibrated for modern Byte-Pair Encoding (BPE) tokenizers (cl100k and o200k) with sensitivity to code punctuation and multilingual scripts. Model prices are fully user-editable so your estimates never go stale as providers adjust rates.
Key Features
- Byte-Pair Encoding token estimation: Heuristic approximation designed for modern tokenizers, accounting for code punctuation density and multilingual characters.
- Fully user-editable pricing: Pre-populated with current rates for popular models, while allowing manual overrides so pricing never becomes obsolete.
- Prompt caching calculations: Simulate cost reductions from input prompt caching tiers offered by major API providers.
- Monthly batch forecasting: Project operational monthly spend across custom request volumes and average response lengths.
- Client-side privacy: Prompt text is analyzed entirely in browser memory and is never transmitted to an external API or server.