TokenCalculator.dev is a privacy-first, browser-based LLM token calculator designed for developers and AI professionals to accurately measure and estimate API costs for various input types. It supports text, code, structured data, readable documents (PDF, DOCX), and images (PNG, JPEG, WebP, GIF) without uploading any content to external servers, ensuring complete privacy.
Key features include:
- Multi-Provider Support: The tool measures input against current models from OpenAI, Anthropic Claude, Google Gemini, and DeepSeek, providing live token results and cost estimations.
- Comprehensive Input Handling: Users can paste text prompts or attach a wide range of files, including
.txt,.md,.json,.csv, various programming language files (.js,.ts,.py,.go,.rs,.java,.c,.cpp,.h,.hpp),.css,.html,.xml,.yaml,.toml,.sql,.sh,.pdf, and.docx. Each file is processed locally in the browser, up to 12 MB per file. - Image Token Estimation: For multimodal requests, the calculator estimates visual tokens from images by reading their dimensions locally and applying provider-published tile, patch, or media-token rules for supported vision models (OpenAI, Claude, Gemini). This allows for planning multimodal workloads as a single unit.
- Accuracy and Transparency: OpenAI text token counts use exact local BPE tokenization (o200k_base). For other providers (Claude, Gemini, DeepSeek), it employs deterministic Provider-Calibrated UTF-8 Token Projections, with results clearly labeled for their accuracy level (exact or estimated). Image token counts also adhere to documented provider formulas.
- Live Cost Estimation: The platform provides live updates on input tokens, context-window fit, and estimated input costs, with pricing refreshed from Models.dev. It also includes a Workload & Scaling Planner to project daily and monthly costs based on expected output tokens and requests per day.
- Use Cases: Ideal for document ingestion, multimodal request planning, code and data cost comparison, repository review payloads, and comparing batch-processing economics. It helps developers budget vision-model requests, price knowledge-base ingestion runs, and measure complex code analysis payloads before making API calls.
The tool emphasizes that all text, document, and image processing occurs entirely within the user's browser, ensuring that sensitive data never leaves the device. This commitment to privacy, combined with its detailed and transparent measurement methodology, makes TokenCalculator.dev an essential resource for anyone working with large language models.






