
Web Scripts & Software
DEV3 LLM Token Counter & API Cost Calculator — Source Code (React + Tailwind)
from $20$29
Loading…
Developer tool
Free, no sign-up. Runs in your browser; nothing is uploaded. Buy the source code: $29 Regular / $69 Extended
Loading the tokenizer...
Exact count (o200k_base encoding). Counts include no hidden system prompt or tool definitions that an API may add.
Share of the prompt served from the cache.
Often 50 for batch APIs.
Cost = (uncached input tokens x input price + cached input tokens x cached price + output tokens x output price) / 1,000,000, times (1 - batch discount). Monthly = per request x requests per day x days. Prices come from the table and are in US dollars per 1M tokens.
| Model | Tokens | Context used | Input $/1M | Cached $/1M | Output $/1M | Per month |
|---|---|---|---|---|---|---|
OpenAI | 83 | 0.1% of 400k | $93.11 | |||
OpenAI | 83 | 0.1% of 400k | $18.62 | |||
OpenAI | 83 | 0.1% of 400k | $3.72 | |||
OpenAI | 83 | 0.3% of 128k | $96.23 | |||
OpenAI | 83 | 0.3% of 128k | $5.77 | |||
OpenAI | 83 | 0.0% of 1,000k | $76.98 | |||
OpenAI | 83 | 0.0% of 1,000k | $15.40 | |||
OpenAI | 83 | 0.2% of 200k | $76.98 | |||
OpenAI | 83 | 0.3% of 128k | $294.90 | |||
Anthropic, estimate | 100 | 0.0% of 1,000k | $192.00 | |||
Anthropic, estimate | 100 | 0.0% of 1,000k | $96.00 | |||
Anthropic, estimate | 100 | 0.0% of 1,000k | $4.80 | |||
Anthropic, estimate | 100 | 0.2% of 200k | $48.00 | |||
Google, estimate | 79 | 0.0% of 1,000k | $92.96 | |||
Google, estimate | 79 | 0.0% of 1,000k | $23.21 | |||
Meta (host varies), estimate | 88 | 0.3% of 128k | $8.78 | |||
DeepSeek, estimate | 87 | 0.3% of 128k | $4.51 | |||
Mistral, estimate | 87 | 0.3% of 128k | $59.22 |
Prices are indicative list prices rounded from public pages in 2026-06. Claude rows updated 2026-11. Providers change them often and offer volume, region and tier differences, so confirm on the provider page. Your edits stay in this browser only. Nothing is sent to any API.
Need LLM Token Counter & API Cost Calculator built into your own product? We build it as a full app, API and admin included. Built in about a week, from $99. Send your requirements or SOW; you get a fixed quote and a delivery date.
The llm token counter & api cost calculator stays free to use online. If you want the code to run, edit and ship in your own project, get the full source from the DEV3 Marketplace. Instant download, 6 months of support.
Skip the build: ready-made apps with the code included. Buy once, own the source, and try each one live first.

Web Scripts & Software
from $20$29

Enterprise SaaS Starters
from $69$99

Enterprise SaaS Starters
from $69$99

Enterprise SaaS Starters
from $69$99

Enterprise SaaS Starters
from $69$99

Enterprise SaaS Starters
from $69$99

Enterprise SaaS Starters
from $69$99

Enterprise SaaS Starters
from $69$99
Language models do not read characters or words. They read tokens, and both the context window limit and the price are measured in tokens. Knowing the count tells you whether a document fits and what a feature will cost at scale.
Enter the output tokens you expect per request, how many requests you make per day, the share of the prompt that is cached and any batch discount. The tool multiplies tokens by the price per million, applies the discount and shows the cost per request, day, month and year. Edit any price in the table to match your contract; the changes stay in your browser.
OpenAI counts use the published byte-pair encodings (o200k_base and cl100k_base) and are exact for the text you give. Anthropic, Google, Meta and other vendors use their own tokenizers. For those rows the tool scales the OpenAI count by a documented factor for English prose, shown as an estimate. Expect differences of about 5 to 15 percent for most vendors and up to about 35 percent for current Claude models, whose newer tokenizer produces more tokens, with larger gaps for code, emoji and non-Latin scripts.
Prices are list prices dated in the table. They are a planning aid, not a quote.
A token is a chunk of text that a language model reads and writes: a whole short word, part of a long word, a number or a punctuation mark. In English one token is about four characters or three quarters of a word.
For OpenAI models that use the o200k_base (GPT-4o and newer) and cl100k_base (GPT-4 Turbo and GPT-3.5) encodings the count is exact, because the tool runs the same byte-pair encoding. For Claude, Gemini, Llama and others it is a labelled estimate, since those tokenizers are not published or not bundled here.
The arithmetic is exact but the prices are indicative list prices dated in the table. Providers change prices, offer tiers and discounts, and bill for hidden tokens such as reasoning output, so use the figures for budgeting and check the provider page before you commit.
Chat formats add control tokens around each message. For OpenAI chat models the documented rule is 3 tokens per message plus 3 to prime the reply, which the Chat messages mode adds for you.
Many providers bill cached input tokens at a fraction of the normal input price. Set the cached share to the part of your prompt that repeats between requests, such as a long system prompt, to see the saving.
No. The tokenizer runs inside your browser and the tool makes no API calls, so prompts, contracts and source code stay on your device.