One private pipeline.
No content upload.
TokenCalculator.dev combines confidential prompts, readable documents, source and data files, and image-token formulas in the browser. These references document the calculation mechanics, privacy boundary, and points where provider-side usage can differ.
Developer API reference
Free HTTP endpoints, batch and comparison requests, response fields, limits, errors, and the local npm SDK.
Privacy architecture
What remains on-device, what network requests exist, and how browser memory is used.
Text and source code
Exact local OpenAI BPE counts and provider-family UTF-8 projections.
PDF, DOCX, and data files
Browser extraction, supported formats, scanned-PDF limits, and combined counts.
Image generation cost
How image generation APIs bill: per-image prices, per-token formulas, input images, batch discounts and easily missed costs.
Images and vision tokens
The three live formulas: OpenAI 32x32 patches, Claude 28x28 patches in two tiers, and Gemini 3 fixed budgets.
Audio, video, and PDF tokens
Gemini bills 25 tokens a second of audio, 70 a video frame at 1 FPS, and 560 a PDF page. What the other vendors do not publish.
n8n community node
Use the published TokenCalculator node in repeatable document and prompt workflows.
Activepieces integration
Install and use the TokenCalculator piece for local token counting, cost estimation, and model comparison.
OpenAI raw text can be counted with the selected local BPE vocabulary. Proprietary provider tokenizers and API-added framing remain authoritative at the provider endpoint.