TokenCalculator.dev
Privacy-first browser-based token and cost calculator for text, code, PDFs, and images across OpenAI, Claude, Gemini, and DeepSeek — no content uploaded.
At a Glance
Full browser-based token calculator with no content upload, covering all providers and file types.
Engagement
Available On
Alternatives
Listed Sep 2026
About TokenCalculator.dev
TokenCalculator.dev is an independent, privacy-first browser utility that counts tokens and estimates API input costs for text, documents, source code, and images — all without uploading any content to a server. It supports OpenAI, Anthropic Claude, Google Gemini, and DeepSeek, and runs every calculation locally in the browser. The tool is maintained around three stated commitments: content stays on-device, computation provenance is visible for every result, and model facts link back to public sources.
What It Is
TokenCalculator.dev is a browser-based LLM token counter and cost estimator aimed at developers, prompt engineers, and teams who need to measure prompt size, API input cost, and context-window utilization before making an API call. It accepts pasted text, uploaded PDF and DOCX files, source code and data files (plain text, Markdown, CSV, JSON, JavaScript, TypeScript, Python, Go, Rust, Java, C/C++, HTML, CSS, XML, YAML, TOML, SQL, shell), and images (PNG, JPEG, WebP, GIF) up to 12 MB per file. Results update live across all four provider families simultaneously.
How the Calculation Pipeline Works
The tool distinguishes between exact and estimated methods and labels every result accordingly:
- OpenAI text: Uses local
js-tiktokenwith the model's configured BPE encoding (o200k_base and others), producing exact token counts without any network call. - Claude, Gemini, DeepSeek text: Uses a deterministic Provider-Calibrated UTF-8 Token Projection — UTF-8 byte length normalized by a provider-family bytes-per-token coefficient — clearly labeled as a projection, not an exact count.
- Images: Reads pixel dimensions locally and applies each provider's published visual-token formula (tile rules for OpenAI, patch rules for Claude, media rules for Gemini). If a model has no documented vision rule, the result says "unavailable" rather than fabricating a value.
- Pricing data: Refreshed from the open-source Models.dev catalog, with a bundled offline registry as a fallback.
The pipeline is: read input locally → tokenize or project → check context-window fit with overflow alerts → calculate input cost at current rates.
Privacy Architecture
The site's stated privacy boundary is that zero text, prompts, document contents, or uploaded images are sent to TokenCalculator.dev or any external calculation server. PDF and DOCX text extraction, image-dimension reading, and all token math run inside the browser. Only public model metadata may be refreshed from Models.dev. The tool publishes a dedicated privacy architecture documentation page explaining what remains on-device and what network requests exist.
Scanned or encrypted PDFs are intentionally rejected rather than returning a misleading zero-token result, since they require OCR that would need server-side processing.
Integrations and Developer Access
Beyond the browser UI, TokenCalculator.dev exposes a free HTTP API with batch counting and comparison endpoints, documented in an API reference. The site also publishes:
- An n8n community node for use in repeatable document and prompt workflows
- An Activepieces integration piece for local token counting, cost estimation, and model comparison
- A Cost Lab for model pricing, batch projections, cache effects, and request economics
- A Tokens ↔ Words converter for translating context-window sizes into content-aware planning ranges
- Provider-specific focused counters for OpenAI, Claude, Gemini, and DeepSeek
The underlying tokenizer library used for OpenAI counts is js-tiktoken (GitHub: dqbd/tiktoken), a MIT-licensed JS/WASM port of OpenAI's tiktoken with 1,067 stars as of the crawl date.
Current Status
The site footer is dated © 2026 and the accuracy contract table was last reviewed 2026-08-23, indicating active maintenance. The js-tiktoken dependency released version js-tiktoken@1.0.21 on 2025-08-09. The tool is listed across multiple AI tool directories and supports five interface languages: English, Spanish, Japanese, German, and Brazilian Portuguese.
Community Discussions
Be the first to start a conversation about TokenCalculator.dev
Share your experience with TokenCalculator.dev, ask questions, or help others learn from your insights.
Pricing
Free
Full browser-based token calculator with no content upload, covering all providers and file types.
- Browser-local token counting for text, PDF, DOCX, code, data files, and images
- OpenAI exact BPE tokenization
- Claude, Gemini, DeepSeek provider-calibrated projections
- Image token estimation using provider-published formulas
- Live multi-provider results
Capabilities
Key Features
- Browser-local token counting — no content uploaded
- OpenAI exact BPE tokenization via js-tiktoken
- Provider-Calibrated UTF-8 Token Projection for Claude, Gemini, DeepSeek
- PDF and DOCX text extraction in-browser
- Image token estimation using provider-published visual-token formulas
- Live multi-provider results across OpenAI, Claude, Gemini, DeepSeek
- Context-window fit check with overflow alerts
- Input cost calculation at current model rates
- Cost Lab for batch projections and cache effects
- Tokens-to-words converter
- Free HTTP API with batch counting and comparison endpoints
- n8n community node integration
- Activepieces integration piece
- Offline bundled model registry fallback
- Multilingual UI (English, Spanish, Japanese, German, Portuguese)
