finnUpdated November 2, 2026
AI Token Calculator and Token Counter, With API Cost (2026)
Count in the tokens of
- Tokens
- 0
- Words
- 0
- Characters
- 0
Paste a text above, or type a number of tokens, to see what it costs on each model.
The calculator above gives the number of tokens in your text and what that text costs on 16 models, per call and per month. A token is a word, a piece of a word or a symbol: the unit AI providers bill. For OpenAI, DeepSeek and Mistral, tokens are counted the way they count them. For Claude, Gemini and Grok, it is an estimate: their providers don't publish how they count.
A call is one request your app sends to an AI model. The provider bills everything in that request: your instructions to the model, the conversation so far and the user's latest message. A model remembers nothing from one call to the next, so your app has to send it all again every time. The provider also bills the reply the model writes, at a higher price.
Each provider cuts text its own way, so the same text doesn't make the same number of tokens everywhere. For Claude and Gemini, the calculator starts from OpenAI's count. It multiplies that count by a figure called the multiplier.
The multiplier is measured for each provider. It also changes with the kind of text you pick under "Language of the text". For English or French text, Claude, the family of models made by Anthropic, has the largest multiplier. For Grok, no reliable multiplier exists, so the calculator uses OpenAI's count as it is.
Anthropic changed the way it counts in April 2026, with its Claude Opus 4.7 model. Before, Claude counted a few more tokens than OpenAI. Since then, for the same text, it has counted about 1.5 times as many in English and about 1.75 times as many in French. So two models with the same price per token can cost different amounts for the same text.
For Claude, the calculator's estimate is close to Anthropic's own count. Anthropic offers developers a service that counts the tokens of a text the way Claude does. On 2 November 2026, the calculator's estimate was compared with that service on 55 test texts. For half of them, it was less than 3.5% off. For nine texts in ten, it was less than 8.8% off.
The calculator itself can't use that service for your text, because it keeps your text on your device.
Gemini's estimate was checked the same way on 2 November 2026, with the counting service Google offers developers. For half of the test texts, it was less than 3.7% off. For nine in ten, it was less than 12.8% off.
Grok's estimate can't be checked. No reliable measurement exists, and xAI's terms for its API also rule out measuring Grok. So the calculator counts Grok exactly like OpenAI, which makes Grok's estimate the least sure of the three.
To fill in the calculator, paste into "Your text" everything one call sends, not only the latest message: "Prompt" then shows its number of tokens. If you don't know what your app sends to the model, ask your AI agent, the one you build your app with (Claude Code, Cursor, Lovable or another): "Show me the full text one call sends to the model in the middle of a conversation, with the system prompt and the tools."
You can also type a number of tokens in "Prompt" instead of pasting a text. To go back to your text's count, click "Use my text". In "Reply", put the number of tokens you expect the model to write: the "i" beside the field says how many words that makes. Both numbers are counted in the tokens of the model picked in "Count in the tokens of", OpenAI by default.
The calculator also guesses the language of your text. Check it under "Language of the text", because it changes the multiplier. "Data" is for the files apps exchange, such as JSON. "Table" is for tables of figures. For a text that mixes languages, code or data, pick whatever makes up most of it.
The calculator's prices are those of each provider's API, the service an app uses to call a model, paid for by use. A ChatGPT or Claude subscription is paid differently: a monthly fee with a usage limit.
What a token is, and what a token counter counts
A token counter, like the calculator above, counts tokens. Here is what they are, and why the same text doesn't make the same number everywhere.
An AI model doesn't read text letter by letter. Before your text reaches the model, a program cuts it into pieces. That program is called a tokenizer, and each piece is called a token. The tokenizer takes its pieces from a fixed list. Each tokenizer has its own list. One provider can have several: Mistral AI has one per model.
A frequent word is a single piece, usually with the space before it. A less frequent word splits into several pieces. Digits and punctuation have pieces of their own.
Here is how OpenAI's tokenizer cuts a short request. A bar marks each cut:
Write| a| short| reply| to| this| customer's| refund| request|.
This request of 9 words makes 10 tokens. Each word is a single token, with the space before it, and the full stop is a token of its own.
So a model sees tokens, never the letters inside them. Andrej Karpathy, a founding member of OpenAI, draws a consequence in a 2025 lecture on how ChatGPT works: that is why models often get it wrong when asked to spell a word or count its letters.
The list OpenAI publishes for its models since GPT-4o is called o200k, for the 200,000 or so pieces it holds. The word "template" is a single token in it. With two letters swapped, "tempalte" takes two: a typo usually costs extra tokens.
In May 2026, Pankaj Pipada, a software engineer, measured the cost of typos with OpenAI's tokenizer. A five-word message with two spelling mistakes took 13 tokens. Once the mistakes were corrected, the same message took only 6.
Where does the list of pieces come from? Knowing it helps explain why the same text doesn't cost the same everywhere. Most lists are built with a method called byte-pair encoding, which joins letters that often appear together into longer pieces. The computer scientist Philip Gage published it in 1994, to make data files smaller. In 2016, Rico Sennrich and co-authors, researchers in machine translation, took it up so that their translation models could read words they had never seen.
The method starts from single letters. In a large collection of texts, it finds the two pieces that most often follow each other and joins them into one piece. It repeats this until the list reaches the size its maker wants. A word never seen then splits into smaller pieces, down to single letters if needed: the model can read anything, but a rare word costs several tokens.
Each provider builds its list from its own texts. That is why the same text doesn't make the same number of tokens from one provider to the next. The larger the list, the more long pieces it holds, and the fewer pieces the same text needs.
Recent models have larger lists than older ones. Does that lower the bill? To check, you can count the same text with an older and a newer OpenAI list. Doing it in English and in French also shows whether the effect depends on the language. That needs a text published in both languages: the Government of Canada publishes its guide on generative AI in English and in French.
On 29 October 2026, a test for this page counted the opening of the Canadian guide with two OpenAI lists. The first is the list of GPT-4, an OpenAI model released in 2023: it holds 100,277 pieces. The second is o200k, which holds twice as many.
In English, both lists gave almost the same number of tokens: 1,315 with GPT-4's, 1,306 with o200k. The older list already held almost every English word as a single piece. In French, GPT-4's list gave 2,229 tokens and o200k 1,807, 19% fewer. So the answer to the question is: for an English text, almost nothing changes. For a French text, the bill drops by about 19%.
How many tokens does a text make? With OpenAI's tokenizer, 1,000 English words make about 1,190 to 1,250 tokens. 1,000 French words take about 1,380 to 1,480. Those figures come from the texts counted for this page on 29 October 2026: the Canadian guide, the Universal Declaration of Human Rights and a passage from one of this site's guides. In the English texts, each token held about five characters on average, spaces included.
Another rule is often quoted: 0.75 words per token, or 75 words for 100 tokens. That rule dates from tokenizers older than GPT-4's, such as GPT-3's, so it counts too many tokens for today's. For 1,000 English words, it gives about 1,333 tokens (1,000 ÷ 0.75). That is 7 to 12% more than o200k counts. Anthropic gave that same rule for Claude until April 2026. According to its documentation, 1,000 English words now make about 1,800 tokens on Claude.
Why French and code cost more tokens
The same message doesn't make the same number of tokens in French and in English, or in prose and in code. This chapter says by how much, and why.
Here is the same request in French:
R|éd|ige| une| réponse| courte| à| la| demande| de| remboursement| de| ce| client|.
In French, the request makes 15 tokens for 12 words, against 10 tokens for 9 words in English. The word "Rédige" ("write") splits into three tokens, while "remboursement" ("refund"), which is longer, stays a single one.
Length isn't what matters: the list keeps as one piece the words that came up often in the texts it was built from. At most providers, those texts are mostly in English. A language the list has seen less of is cut into smaller pieces, so the same message costs more tokens in French than in English.
Andrej Karpathy takes Japanese as the example in another lecture, two hours long, on building a tokenizer: if the texts used to build the list hold a lot of Japanese, the list keeps longer Japanese pieces and a Japanese sentence needs fewer tokens. So what a language costs depends on the texts the list was built from.
How much more does French cost? Measuring it takes the same content in both languages. On 29 October 2026, for this page, two texts published officially in English and in French were counted: the Canadian guide and the Universal Declaration of Human Rights, which the United Nations also publishes in both languages. With OpenAI's tokenizer, the French version took 1.38 times as many tokens as the English one for the Canadian guide, and 1.29 times as many for the Declaration.
Part of that gap comes from the language itself: to say the same thing, the French versions used 11 to 21% more words. The rest comes from the tokenizer. As each provider has its own, the extra cost of French changes from one provider to another.
On those two texts, OpenAI's tokenizer took 1.29 to 1.38 times as many tokens in French as in English. Each tokenizer gives a slightly different gap. The smallest is that of Mistral Large 4, a model from the French company Mistral AI, at 1.24 to 1.33 times as many tokens in French. The tokenizer of Mistral Small 4, counted on 2 November 2026, gave 1.29 to 1.41. The largest is that of DeepSeek, a Chinese AI lab: 1.47 to 1.62.
Google doesn't publish Gemini's tokenizer. It does publish that of Gemma, a model anyone can download. On those two texts, Gemma's tokenizer took 1.33 to 1.43 times as many tokens in French as in English.
Gemini itself was counted with Google's own service on 2 November 2026. It makes about 1.05 times OpenAI's number of tokens in English, and about 1.06 times in French. The two figures are almost the same, so French costs about as much extra on Gemini as on OpenAI.
The extra cost of French used to be larger with older tokenizers. In 2023, a study by Aleksandar Petrov and co-authors, presented at NeurIPS, one of the main AI research conferences, found that French took 1.60 times as many tokens as English with GPT-4's tokenizer. With that of GPT-2, an OpenAI model released in 2019, it was 2.00 times as many.
The same year, another study, by Orevaoghene Ahia and co-authors, found languages that needed five times as many tokens as others for the same content. People who speak the costliest languages were "overcharged while obtaining poorer results", the authors concluded, since models also handle those languages less well. In that study, French was among the cheapest languages, but it still cost more than English.
On Claude, the gap between French and English is wider than on OpenAI. TextKit, a maker of text tools, counted a 94-word English passage and its French translation, on OpenAI and then on Claude. On OpenAI, the French version took 1.39 times as many tokens as the English one. On Claude, it took about 1.55 times as many, a figure worked out from TextKit's.
On the English version, Claude counted 1.61 times as many tokens as OpenAI. On the French version, it counted 1.80 times as many. Claude's extra is larger in French than in English, so French costs more on Claude than on OpenAI. To get the figure, take OpenAI's French-to-English gap, 1.39, and multiply it by Claude's extra in French divided by its extra in English: 1.39 × (1.80 ÷ 1.61) = 1.55.
The French-to-English ratios tell you how much more a French text costs than the same text in English. To choose a provider, another comparison matters: the same French text on Claude and on OpenAI. By the measurements made for this page, Claude counts about 1.75 times as many tokens as OpenAI on a French text, against 1.5 times on an English one. Those are the multipliers the calculator uses for Claude.
Noxcod, a French agency that builds AI agents, finds almost the same gap in French: in October 2026, it counted 2.5 Claude tokens per word, against 1.44 OpenAI tokens, so 1.74 times as many (2.5 ÷ 1.44).
That gap matters, because two comparable models can have the same price per token. On 29 October 2026, Claude Sonnet 5.5, an Anthropic model, and GPT-6.1 Sol, an OpenAI model, had the same list price, that is, the same price per token on the provider's page: $2 per million tokens sent to the model and $10 per million tokens it writes back.
For a customer service assistant in French, Noxcod drew this conclusion: "at the same list price, the same assistant in French costs 75% more at Anthropic". That 75% comes from the gap Noxcod measured: 1.74 times as many tokens, which is 74% more, rounded to 75%.
Code and structured data have an extra cost of their own: they are full of symbols and layout spaces. Structured data is information that apps exchange in a fixed format, such as JSON. To be readable, code and JSON are often written over several lines, with spaces at the start of each line.
In ordinary text, a space belongs to the token of the word after it, so it costs nothing extra. A run of spaces at the start of a line has no word attached: it makes tokens of its own, like each bracket and each quotation mark.
The test of 29 October 2026 on the Canadian guide and the Declaration also included a JSON file of 43 lines, written for the test. The file was counted twice with OpenAI's tokenizer: laid out over several lines, then written on a single line. Laid out, it cost 56% more tokens.
Providers don't cut code the same way as one another either. On code, Gemini makes about 1.15 times OpenAI's number of tokens, against 1.05 on English prose. Those figures come from Google's own count of the texts this page measured on 2 November 2026.
If your app sends data to a model, ask your agent: "Send data to the model on one line, without spaces at the start of lines, and only the information it needs."
How the AI token cost calculator prices a call on each model
Knowing how many tokens a text makes isn't enough: you also need to know how those tokens become a price. This chapter follows the price of one call, then everything that makes it vary.
The price of one call
Once you know the number of tokens, the price follows a simple rule. A call has two parts, billed separately: the prompt and the reply. The prompt is everything your app sends to the model. The reply is what the model writes. Providers also call prompt tokens "input tokens" and reply tokens "output tokens". Each part has its own price, given per million tokens. So one call costs:
prompt tokens ÷ 1,000,000 × prompt price + reply tokens ÷ 1,000,000 × reply price
Take GPT-6.1 Sol, an OpenAI model. On 29 October 2026, it cost $2 per million prompt tokens and $10 per million reply tokens. A 2,000-token English prompt with a 500-token reply costs 2,000 ÷ 1,000,000 × $2 = $0.004, plus 500 ÷ 1,000,000 × $10 = $0.005, so $0.009 a call, and $9 a month for 1,000 calls a month.
Claude Sonnet 5.5, an Anthropic model, had exactly the same price that day. But it cuts the same English text into about 1.5 times as many tokens. The same prompt therefore makes about 3,000 tokens on it instead of 2,000. A reply of the same length in words makes about 750 tokens instead of 500. That call costs 3,000 ÷ 1,000,000 × $2 + 750 ÷ 1,000,000 × $10 = $0.0135 a call, so $13.50 for 1,000 calls a month.
To see both models side by side in the calculator, leave "Count in the tokens of" on OpenAI: the numbers you type are then OpenAI tokens. Without pasting any text, type 2,000 in "Prompt" and pick "English" under "Language of the text": the calculator needs the language to convert those OpenAI tokens into each other model's tokens. The reply is already set to 500 and the calls to 1,000 a month.
Farmadupe, a user of Hacker News, a forum where developers discuss their work, saw that gap between Claude and OpenAI on a real task in October 2026: sorting texts into categories. For the same texts, GPT-6 Luna, from OpenAI, counted 7.90 million prompt tokens and Claude Haiku 5.5 counted 11.89 million, 1.5 times as many (11.89 ÷ 7.90). Both models had the same list price. Farmadupe found GPT-6 Luna "a fair amount cheaper due to more efficient tokenization and less outputs": the same texts made fewer tokens on it, and GPT-6 Luna's replies were shorter.
The reply costs more than the prompt
On every model in the calculator, a reply token costs more than a prompt token. That matters for an app that writes long replies to short prompts: its bill comes mostly from the replies. The gap varies a lot from one model to another. On 29 October 2026, among the 16 models of the price table, further down this page:
| Reply price ÷ prompt price | Models |
|---|---|
| 2 × | Grok 4.3, from xAI |
| 3 × | Grok 4.7, DeepSeek V4 Pro, Mistral Large 4 |
| 4 × | DeepSeek V4.1 Flash, Mistral Small 4 |
| 5 × | every Claude and GPT-6 model, Gemini 4 Argon, Gemini 3.8 Flash |
| 8.3 × | Gemini 3.5 Flash-Lite |
So on Gemini 3.5 Flash-Lite, a long reply weighs more, compared with the prompt, than on any other model.
Models that think
Some models think before they answer. They first write out their reasoning, a draft the user doesn't see in full, and then the answer. That draft is billed as reply tokens, so at the higher price. OpenAI calls these models reasoning models. In an example from its guide, the reply billed is 1,186 tokens, of which 1,024 are reasoning. The visible answer is only 162 tokens (1,186 − 1,024). So the reply billed is 7.3 times as long as the visible answer (1,186 ÷ 162 = 7.3).
OpenAI's guide warns that "you could incur costs for input and reasoning tokens without receiving a visible response". An app usually sets, for each call, a maximum number of reply tokens. If the thinking reaches that maximum before the answer starts, the call is paid for with no answer. Google's documentation says that on Gemini too, the price is based on all of the thinking, even when the model shows only a summary of it.
On 29 October 2026, thinking couldn't be turned off on Claude Opus 5.5, Grok 4.7 and Claude Fable 5.1, Anthropic's most expensive model. On many other models, the level of thinking is a setting. You can ask your agent: "Set the model's thinking level to the lowest that still gives good answers."
The calculator has a single "Reply" field for every model. For a model that thinks, type in that field the number of tokens of the answer plus those of its thinking, Then read only that model's row. The other rows count that thinking too, although their models may not write any.
In OpenAI's example, the reply billed came to 7.3 times the visible answer. To know that gap in your app, ask your agent: "Show me the reply tokens billed on a few real calls, next to the length of the visible answers." If those tokens aren't OpenAI's, pick their provider in "Count in the tokens of" before you type the figure.
The maximum size and very long prompts
Each model accepts a prompt up to a maximum size per call. That limit comes from its context window, the amount of text the model can take into account at once. On 29 October 2026, the limit was 922,000 tokens on the GPT-6 models, 500,000 on Grok 4.7, 256,000 on Mistral Small 4 and about a million on the other models. Past that limit, the provider rejects the call, and the calculator says so: "Too long for this model".
On some models, a very long prompt also makes the whole call more expensive, past a threshold. On 29 October 2026, on Claude Haiku 5.5, a call whose prompt passed 100,000 tokens paid five times the regular price on all its tokens.
On the GPT-6 models, a call whose prompt passed 272,000 tokens paid twice the regular prompt price and 1.5 times the regular reply price. On the Grok models, xAI doubled both the prompt and the reply price from 200,000 prompt tokens. The calculator applies these higher prices once the threshold is passed.
These limits and thresholds are counted in each provider's own tokens. So the calculator compares each one with its count of that provider's tokens: for Claude, with its estimate of the Claude tokens. Take Claude Haiku 5.5, whose higher price starts at 100,000 Claude tokens. For an English text, that is about 67,000 OpenAI tokens, because Claude counts about 1.5 tokens for each OpenAI token (100,000 ÷ 1.5).
Promotions, the price table and discounts
Promotional prices end on a set day. On 29 October 2026, Gemini 4 Argon was at half price until 30 November 2026 and Gemini 3.8 Flash until 31 December 2026. The calculator switches to the regular price the day after each end date, by the date set on your device. To plan the months after those dates, use the regular price shown in the price table: Gemini 4 Argon and Gemini 3.8 Flash then cost twice as much.
The prices the calculator uses, as checked on 29 October 2026:
| Model | Prompt | Cached prompt | Reply | What changes the price |
|---|---|---|---|---|
| GPT-6 Astra (OpenAI) | $10.00 | $1.00 | $50.00 | Past 272,000 prompt tokens, the whole call is billed at $20.00 per million prompt tokens and $75.00 per million reply tokens. |
| GPT-6.1 Sol (OpenAI) | $2.00 | $0.10 | $10.00 | Past 272,000 prompt tokens, the whole call is billed at $4.00 per million prompt tokens and $15.00 per million reply tokens. |
| GPT-6 Luna (OpenAI) | $0.10 | $0.010 | $0.50 | Past 272,000 prompt tokens, the whole call is billed at $0.20 per million prompt tokens and $0.75 per million reply tokens. |
| Claude Fable 5.1 (Anthropic) | $10.00 | $0.25 | $50.00 | Same price at any prompt length. |
| Claude Opus 5.5 (Anthropic) | $4.00 | $0.20 | $20.00 | Same price at any prompt length. |
| Claude Sonnet 5.5 (Anthropic) | $2.00 | $0.10 | $10.00 | Same price at any prompt length. |
| Claude Haiku 5.5 (Anthropic) | $0.10 | $0.010 | $0.50 | Past 100,000 prompt tokens, the whole call is billed at $0.50 per million prompt tokens and $2.50 per million reply tokens. |
| Gemini 4 Argon (Google) | $2.00 | $0.10 | $10.00 | Promotional price until November 30, 2026, then $4.00 and $20.00 per million tokens. |
| Gemini 3.8 Flash (Google) | $0.75 | $0.075 | $3.75 | Promotional price until December 31, 2026, then $1.50 and $7.50 per million tokens. |
| Gemini 3.5 Flash-Lite (Google) | $0.30 | $0.030 | $2.50 | Same price at any prompt length. |
| Grok 4.7 (xAI) | $2.00 | $0.50 | $6.00 | From 200,000 prompt tokens, the whole call is billed at $4.00 per million prompt tokens and $12.00 per million reply tokens. |
| Grok 4.3 (xAI) | $1.25 | $0.20 | $2.50 | From 200,000 prompt tokens, the whole call is billed at $2.50 per million prompt tokens and $5.00 per million reply tokens. |
| DeepSeek V4 Pro (DeepSeek) | $1.32 | $0.044 | $3.96 | Peak-hour price (01:00–04:00 and 06:00–10:00 UTC on weekdays); half price the rest of the time. |
| DeepSeek V4.1 Flash (DeepSeek) | $0.30 | $0.006 | $1.20 | Peak-hour price (01:00–04:00 and 06:00–10:00 UTC on weekdays); half price the rest of the time. |
| Mistral Large 4 (Mistral AI) | $0.70 | $0.070 | $2.10 | Same price at any prompt length. |
| Mistral Small 4 (Mistral AI) | $0.15 | – | $0.60 | Same price at any prompt length. |
US dollars per million tokens, each provider's standard rates, checked on October 29, 2026.
The cache is the start of a prompt that the provider has already received in a recent call and keeps for a while. If the next call starts with the same text, the provider bills that start at a lower price: the one in the table's "Cached prompt" column. A dash means the provider shows no lower price for that model.
On 29 October 2026, every provider in the table except DeepSeek also gave a discount on calls sent in a batch and answered within 24 hours. A batch is a large number of calls sent at once, for work that can wait. The discount was half price at OpenAI, Anthropic, Google and Mistral AI, and 20% off at xAI.
DeepSeek halved its own prices outside peak hours. The calculator applies none of these discounts, nor the cache price: it gives the regular price. For DeepSeek, it uses the peak-hour price, the higher one: DeepSeek can therefore cost less than the calculator shows.
What one call really sends: the whole conversation
In the examples so far, the prompt was a single block of 2,000 tokens. In a real app, that block holds much more than one message. A model keeps no memory from one call to the next: to continue a conversation, your app has to send it the whole conversation on every call, that is, every earlier message, every earlier reply, then the new message.
DeepSeek's documentation puts it plainly: "the user must concatenate all previous conversation history and pass it to the chat API with each request". Concatenate means join end to end, and the user here is the app's developer. OpenAI's and Anthropic's documentation say the same: every earlier message is billed again as prompt tokens.
So a conversation bills far more tokens than it contains. Picture a chat where each turn, one message and its reply, adds 1,000 tokens. The first call sends about 1,000 tokens, the second 2,000 and the twentieth 20,000. On average, each of the twenty calls therefore sends 10,500 tokens ((1,000 + 20,000) ÷ 2), so 210,000 prompt tokens for a conversation of 20,000 tokens (20 × 10,500).
The fixed text, the part that doesn't change from one call to the next, is also sent again on every call. The system prompt is the set of instructions your app gives the model before each of the user's messages: it is billed on every call. So is the description of the tools. Tools are actions the model can start, such as finding a customer's order or searching your help pages. Your app describes each of them in the prompt. That description is paid for on every call.
Some providers add text of their own too. On 29 October 2026, Anthropic added an instruction of 286 tokens to every call to Claude Opus 5.5 that used tools. Those tokens are billed like the rest of the prompt, even though you never wrote them. The calculator doesn't add them. If your app uses tools with that model, pick Claude in "Count in the tokens of": "Prompt" is then in Claude tokens. Read your text's number of Claude tokens under "Tokens", then type that number plus 286 in "Prompt".
The fixed text can weigh far more than the replies. Noxcod, the agency that measured Claude's extra tokens in French, built a voice agent, an assistant that answers customers by phone. Each time it answers, that agent makes a call to the model and sends an 11,000-token system prompt. Its replies are about 200 times shorter than that prompt. "Over 99% of the billed tokens are therefore prompt tokens," Noxcod writes.
How much the tools weigh depends on how they are loaded. OpenClaw, free open-source software that anyone can download to run AI agents, can connect to outside services through MCP servers, small programs that each give it a set of tools. In a test published in the guide to OpenClaw's MCP servers, two servers offering 25 tools added 3,503 tokens to each call.
With OpenClaw's Tool Search, which loads a tool only when it is needed and has been its default since 23 September 2026, the same servers added only 11 tokens until a tool was needed. If your app gives the model many tools, ask your agent: "Can our app load each tool only when the model needs it?"
To price a feature of your app, paste into the calculator everything one call sends, as it stands in the middle of a typical conversation: the system prompt, the tool descriptions and the conversation so far. If you don't know what that text is, ask your agent to show you the full text of one call.
A feature that makes one call per user request, such as summarising a document, has no history to send again. For it, paste the document with the instructions that go with it.
With an AI agent, the fixed text and the conversation are sent again at every step. An AI agent is a program that carries out a task on its own, in several steps: an agent your app runs for its users, or a coding agent such as Claude Code, which writes the code of a project. Each step (read a file, run a command, write a change) is a call. Each call sends the model the whole context again: the instructions, the files read so far and the conversation.
That re-sending weighs heavily over a month. In May 2026, Hitesh Jain, who builds AI tools at Coral Bricks AI, published an analysis of a month of personal use of Claude Code. At each step, Claude Code sent the model a context of about 173,000 tokens on average.
Over the month, the text that was really new, added step by step, came to 29 million tokens. But 4.35 billion tokens had been sent to the model: each token had been sent about 150 times on average (4.35 billion ÷ 29 million = 150).
Those re-sent tokens were almost all the tokens of the month. Yet they made up only 64% of the month's bill, at API prices. The reason: most of them went through the cache, billed at a fraction of the regular price. The rest of the bill paid for the replies and the new text. At Claude Opus 4.7's list prices, cache included, the month came to $3,371. Hitesh Jain's summary: "You don't pay to generate, you pay to re-read."
These are API costs. They tell you what your app pays when it runs an agent. They also tell you what a coding agent costs when it runs on an API key rather than a subscription. An API key is the password that lets an app call a model and pay by use.
A single agent task can still be cheap: in a test published in October 2026, a code review with Claude Code's /code-review command, which has Claude Code read your changes and report problems, cost $0.05 to $0.18 at API prices, depending on the effort setting.
Isabelle Lafont, a developer in Paris, saw what these re-sent tokens cost once they are paid at API prices. She ran five personal AI agents on her own server with OpenClaw. Those agents carried out 60 automatic tasks in all, run at set times day and night, such as summaries every morning. All of them used Claude Sonnet.
Her Claude subscription covered these agents until a Friday evening in early April 2026. That day, Anthropic's subscriptions stopped covering agent software made by others, such as OpenClaw. From then on, she paid each call at API prices.
For Owly, one of her agents, each message loaded on average Isabelle Lafont's notes, the agent's memory and its tools: 92,000 prompt tokens. At the price of Claude Sonnet 4.6 then, $3 per million prompt tokens, that came to 28 cents a message (92,000 × $3 ÷ 1,000,000 = $0.276).
On the Monday morning, her dashboard showed €37 already spent: "Not over two weeks. Over two days of the weekend," she writes.
At that pace, her agents would have cost about €555 a month (37 ÷ 2 × 30). She then made three changes: she turned on caching, moved routine tasks to cheaper models and shortened the summaries her agents prepared for her each morning. Afterwards, she put the cost of her agents at about $28 a month. She gives that figure in dollars and the weekend's in euros, but either way it is a small fraction of the €555 a month.
What one customer will cost you
You now know what one call costs. To set your price, the next step is what one customer costs over a month.
Running classic software costs barely more as the number of customers grows. An AI feature, on the other hand, adds a cost for each customer. That cost grows with how much the customer uses the feature. Added up over a month, one customer's calls give what that customer costs you.
Rob Walling invests in small software companies through TinySeed, a fund made for them. In August 2026, on the podcast Startups For the Rest of Us, Rob Walling warned that a product built on an AI agent can sell for far more than a software subscription and still leave no more profit, once the cost of running the models is paid.
To estimate what one customer costs you, take that customer's typical month. You need three things: what one call really sends (system prompt, tools, conversation so far), the length of the reply and the number of calls that customer makes in a month. Enter them in the calculator. The monthly cost it shows, times your number of customers, gives your monthly bill.
Take an assistant that answers your customers' questions in your app, in English. Each of your customers asks it 100 questions a month, with one call per question. Each call sends a 2,000-token system prompt and, on average, 500 tokens of conversation, in OpenAI tokens. Each call gets a reply of 300 OpenAI tokens.
In the calculator, leave "Count in the tokens of" on OpenAI and type 2,500 in "Prompt", 300 in "Reply" and 100 in "Calls a month". Then pick "English" under "Language of the text".
At 29 October 2026 prices and before caching, this assistant costs about $1.20 a customer a month on Claude Sonnet 5.5, $0.80 on GPT-6.1 Sol and $0.04 on GPT-6 Luna. In the sums that follow, prices are per million tokens, so the whole sum is divided by a million. On GPT-6.1 Sol, one call costs 2,500 × $2 + 300 × $10 per million tokens = $0.008, so $0.80 for the 100 calls of the month.
Claude Sonnet 5.5 and GPT-6.1 Sol have the same list price. The gap in cost comes only from the way Claude cuts the text. For an English text, Claude counts about 1.5 tokens for each OpenAI token. On Claude, a call therefore carries 2,500 × 1.5 = 3,750 prompt tokens and 300 × 1.5 = 450 reply tokens, so 3,750 × $2 + 450 × $10 per million = $0.012.
On GPT-6 Luna, 2,500 × $0.10 + 300 × $0.50 per million = $0.0004 a call.
To check your selling price, redo the sum for the customers who use the feature most rather than for the average one: your price should still leave you a margin on them, once the models are paid.
Two questions decide whether that cost weighs on your margin. What share of what a customer pays you goes to the models? Does that share fall as your sales grow? Two French founders each show one case. Sacha Delcourt runs an agency that builds AI agents for businesses. In February 2026, Sacha Delcourt explained that the agency pays for the models its agents use, and that its clients' monthly fee covers that cost several times over: the models take only a small share of each payment.
Thibault Besson-Magdelain co-founded Sorank, a service that uses AI models to write articles meant to rank in Google. In October 2026, Thibault Besson-Magdelain said that if Sorank's monthly revenue doubled, its costs would nearly double too. At Sorank, each article sold is written by AI models: each sale adds calls, and having more customers barely lowers the cost of each sale: the margin on each sale doesn't grow with the company. Before setting your price, ask yourself both questions about your own app.
How to pay less
Once you know what a customer costs you, the next step is to bring that cost down. The bill can go down in several ways. The first one changes nothing in what your app does for its users.
Put what never changes first, and let the provider cache it
At most providers, the start of a prompt can be kept for a while after a call: this is caching. If the next call starts with the same text, the provider bills that start at the price in the "Cached prompt" column of the price table, a fraction of the regular one. On 29 October 2026, that fraction ran from 2% of the regular prompt price on DeepSeek V4.1 Flash to 25% on Grok 4.7.
It was 5% on Claude Opus 5.5, Claude Sonnet 5.5, GPT-6.1 Sol and Gemini 4 Argon.
The cache works only if the new call starts with exactly the same text, word for word, from the very first token. If a single word changes at the start, a date for example, nothing after it is taken from the cache. So what never changes has to come first: the system prompt, the tool descriptions, the reference documents. The user's message comes last.
Ask your agent: "Put the parts of the prompt that never change at the start and the user's message at the end, and turn on prompt caching, with a cache key if the model needs one." A cache key is a label added to each call: it tells the provider which calls start with the same text.
The cache has a condition and a cost. The condition is a minimum length. On 29 October 2026, the repeated start had to be at least 512 tokens long on Claude's 5-series models. It took 1,024 on the calculator's GPT-6 models and 4,096 on Gemini 4 Argon. Below that, nothing was cached.
The cost is paid when a start is cached, the first time it is sent: on that date, caching it cost 1.25 times the regular prompt price on Claude for a cache kept 5 minutes. Anthropic also offers a cache kept one hour, which costs more to fill. On OpenAI's recent models, the first caching also cost 1.25 times the regular price, for a cache kept 30 minutes.
Caching pays off from the second call, the one that reuses the same start, as long as it comes while the cache is kept. On Claude Sonnet 5.5, sending the same start twice costs 1.25 + 0.05 = 1.30 times its regular price with the cache, against 2 times without.
Over a real month of use, caching can divide the bill by five. Hitesh Jain, mentioned above for a month of Claude Code use, published the tool behind that analysis as free, open-source software. In May 2026, sibidharan, a Hacker News user, ran it on a month of sibidharan's own Claude Code use on one server: 933 work sessions.
sibidharan pays for subscriptions, but the tool works out what the API would have charged, at Claude Opus 4.7's list prices of that time. That month would have come to $22,720 with the cache and $113,418 without it (113,418 ÷ 22,720 = 5.0).
In April 2026, Claude's new tokenizer raised the number of tokens. Bills rose less, and caching explains part of why. In June 2026, OpenRouter, a service that passes requests on to many models, compared the same prompts before and after that change. The new tokenizer added 32 to 45% more tokens, but real costs rose only 12 to 27% on prompts above 2,000 tokens.
According to OpenRouter, two things held the rise back. On long prompts, most of the extra tokens landed in the part read from the cache, billed at a fraction of the regular price. The length of the replies also changed with the new model. That measurement compares Claude with its own older tokenizer, not with OpenAI.
A wrong cache setting can lose the saving the cache brings. Ploy is a company whose agent builds websites. In July 2026, Ploy compared two models older than the calculator's: GPT-5.6 (OpenAI) and Claude Opus 4.8 (Anthropic). For the same work, GPT-5.6 first seemed "about 50% more expensive". Ploy then found the reason: its conversations all started with the same 29,000-token text, but GPT-5.6 never took it from the cache.
GPT-5.6 cached only the prompts marked for caching, with a cache key in each call. Once the keys were in place, the comparison turned around: $2.22 per finished website on GPT-5.6, against $3.06 on Claude Opus 4.8. For your model, ask your agent: "Do our calls need a cache key?"
How long the cache lasts matters too. Claude Code, Anthropic's coding agent, chooses how long it asks the provider to keep the cache. Sean Swanson, a software developer, analysed 119,866 calls made by Claude Code. That analysis shows that in March 2026, Claude Code asked for the cache to be kept five minutes, against one hour before. When the cache expires between two calls, the next call pays the caching price again.
Sean Swanson worked out that, at API prices, the change made the Claude Sonnet 4.6 bill 17.1% higher. Ask your agent: "How long is our model's cache kept, and do our calls come back often enough to use it?"
Use the cheapest model that does the job well
Each provider sells models of several sizes: the large ones are more capable and more expensive, the small ones faster and cheaper. On 29 October 2026, the cheapest per token in the table were GPT-6 Luna and Claude Haiku 5.5, at $0.10 per million prompt tokens, and the most expensive GPT-6 Astra and Claude Fable 5.1, at $10.
Sorting messages, pulling details out of an email or writing a one-line answer rarely needs the most capable model. Before switching models, ask your agent: "Try the cheaper model on twenty real requests and show me its answers next to those of the current model."
The price gap between models can be huge. In September 2026, k9294, a Hacker News user, published the tokens of one coding task of 447 steps: about 37.7 million tokens, 36.6 million of them read from the cache.
k9294's post doesn't say which model ran the task. It takes the task's numbers of tokens and works out what they would cost at GPT-6 Astra's prices, then at DeepSeek V4.1 Flash's.
Worked out for this page at the prices in the table, that gives $55.06 on GPT-6 Astra and $0.725 on DeepSeek V4.1 Flash, about 76 times less. The two models count tokens differently, so using the same numbers of tokens for both needs a check. On code, DeepSeek's tokenizer counts about as OpenAI's does, at 1.02 tokens for each OpenAI token, so the comparison is fair. The post doesn't say whether the cheaper model would have done the job as well.
Isabelle Lafont, mentioned above for her agents, kept Claude Sonnet only for writing in French, where "tone and nuance in French remain Anthropic's turf" in her words. She sent everything else to cheaper models.
Judge a saving by the cost of the finished task
Paying for fewer tokens per call doesn't mean paying less for the finished work. In September 2026, Quesma, a company that tests and compares AI tools, measured RTK. RTK is a tool that shortens what a coding agent reads back after each command, such as the list of errors a check on the code returns. On Quesma's tasks, RTK reported 349 million tokens saved. Yet the cost per task rose 17%, because the agent needed 18% more steps to finish the same tasks.
Nicolas Martignole, a French developer, measured how the teams at Back Market, the refurbished electronics marketplace, use Claude Code. In a July 2026 talk titled "Le vrai coût de l'IA : pourquoi le prix au token est faux" (the real cost of AI: why the price per token is wrong), Nicolas Martignole draws the same lesson as Quesma's test: a price per token is only a figure on a web page. The real cost depends on the agent, on the context that agent sends and on its mistakes.
The calculator gives the cost of the calls you describe. To know how many calls a task really takes, retries after a mistake included, ask your agent: "Run this task three times and tell me how many model calls each run made and how many tokens they used."
Set spending limits, and check what you type in billing pages
A wrong setting can cost a lot in a few days. ppcvote, a solo developer in Taiwan, runs a one-person company with AI agents on Gemini's free tier, which lets you use some models without paying, within limits. In March 2026, ppcvote wrote on Hacker News about getting a bill of $127 in seven days anyway.
In March 2026, the free tier only applied to an API key created in Google AI Studio, Google's site for trying Gemini. ppcvote's key had been created in a Google Cloud project, the place where Google handles billing, and billing was turned on there. So every call was billed. Nothing capped the model's thinking tokens either, billed at the reply price. ppcvote's lesson: create your keys in Google AI Studio.
In October 2026, a lawyer in Costa Rica wanted to add $5.04 of prepaid credit in Anthropic's console, the site where you pay for the API. The amount was typed "5,04", with a comma, the way decimals are written in Spanish and French. The card was charged $504 instead of $5.04. The lawyer reported it on Hacker News, where an Anthropic employee confirmed the bug.
A spending limit would have stopped ppcvote's bill before $127. Ask your agent: "What spending limit does each of our providers' accounts offer, and how do I set it?" And in billing pages, type amounts with a decimal point, not a comma, to avoid the Costa Rica lawyer's mistake.
How the calculator estimates each provider
Why are some of the calculator's figures counted and others estimated? The calculator runs in your browser, so that your text stays on your device. It therefore can't send your text to the providers' counting services: it counts by itself. To count exactly like a provider, it needs that provider's tokenizer, that is, its list of pieces and its way of cutting. It can use one only if the provider publishes it.
OpenAI, DeepSeek and Mistral AI publish theirs, and the calculator runs four of them. The first is o200k, which OpenAI publishes for its models since GPT-4o. The second is DeepSeek's, shared by its V4 Pro and V4.1 Flash models. The last two are those of Mistral Large 4 and Mistral Small 4.
To keep the page light, DeepSeek's and Mistral's tokenizers download only once the table "What it costs on each model" appears on screen: their rows can take a second to show.
Anthropic, Google and xAI, the company that makes Grok, publish no tokenizer for the calculator's models. For Claude and Gemini, the calculator therefore starts from OpenAI's number of tokens and multiplies it by the multiplier of that provider for that kind of text. For Grok, it takes OpenAI's count as it is. Those figures are estimates, which the calculator marks with the ≈ sign. The sections below say, provider by provider, where each figure comes from.
OpenAI
The calculator's OpenAI models are GPT-6 models. OpenAI hasn't said whether GPT-6 uses o200k too. tiktoken, the software OpenAI publishes so developers can count tokens on their own computer, names no tokenizer for GPT-6.
On GitHub, the site where developers share code and report problems, someone asked OpenAI to add GPT-6 to tiktoken. That person closed the request on 17 October 2026, without an answer from OpenAI. So no official word confirms that GPT-6 uses o200k: measurements are what show it.
OpenAI also offers developers a counting service, which gives the number of tokens a model will bill. To check o200k, you compare its count with that service's on the same texts.
One independent comparison did that work for GPT-6: token-count-compare, a comparison published on GitHub that anyone can run again, tried 31 texts on 12 October 2026. It found that GPT-6 Astra, GPT-6 Sol and GPT-6 Luna count like o200k.
On top of the text, OpenAI's service counts 6 tokens that frame each message and tell the model who is speaking. For this page, on 2 November 2026, the counts token-count-compare got from OpenAI's service were compared with the calculator's. Once those 6 tokens were taken off, they were exactly the same on every one of the 31 texts.
The model tested, GPT-6 Sol, isn't in the calculator. The calculator has its next version, GPT-6.1 Sol, and no published test covers that version yet. The calculator assumes it counts like GPT-6 Sol.
Claude
Anthropic doesn't publish its tokenizer, so the calculator estimates Claude with multipliers measured for this page. Anthropic offers a counting service, free on 29 October 2026 but reached only with an account and an API key.
On 2 November 2026, 114 texts were counted both with o200k and with that service. They included prose in English, French, German, Spanish and Italian, prompts, emails, chats and code in about fifteen programming languages. They also included tables of figures and data: JSON files and apps' event logs.
Anthropic's service adds 7 tokens to each request to frame it: those were taken off before comparing. Anthropic calls its result "an estimate" that "might differ by a small amount". For the calculator's four Claude models, Anthropic's service gave exactly the same number of tokens on every one of the 114 texts, so the same multipliers hold for all four.
Claude's multiplier depends mostly on the kind of text: among languages, it is lowest in English and highest in German. Here, for each kind, is its median, the middle value: half the texts are above it, half below. On 30 English texts, Claude counted 1.49 times as many tokens as OpenAI. On 16 French texts, it counted 1.70 times as many. Spanish came to 1.80, Italian to 1.64 and German to 2.19.
Outside prose, Claude counts less on tables than on code. On 27 pieces of code, it counted 1.57 times as many tokens as OpenAI. On 16 data files, 1.45 times as many. On 8 tables of figures, only 1.15 times as many. The calculator's multipliers, worked out on part of these texts, are close to them.
German is the exception among European languages: Claude counts far more there than in the others. So the "German" button under "Language of the text" applies its own multiplier. TextKit also found a high figure for German on its translated passage: 2.04.
French, Spanish and Italian, on the other hand, share one multiplier: that of the "French or another European language" button. Data and tables have their own buttons too, because Claude cuts them into fewer pieces than code.
The calculator's multipliers were worked out on 59 of the 114 texts, then checked on the other 55, which played no part in working them out. That is the only way to know how the calculator does on a text it has never seen. On those 55 texts, the calculator's estimate was less than 3.5% off Anthropic's count for half of them. For nine texts in ten, it was less than 8.8% off. The largest gap, on a table of figures, reached 18.7%.
The "German", "Data" and "Table" buttons were added after this measurement. Before them, German was counted with the multiplier for the other European languages, and data and tables with the one for code. With those, the error stayed under 24.4% for nine texts in ten, and the worst, on a table of figures, reached 59.5%. With the new buttons, they came down to 8.8% and 18.7%.
As they come from 59 texts, the multipliers are close to the medians of all 114 without being equal to them. On tables, measured on few texts, the median is 1.15 and the multiplier 1.19. These measurements will be run again. A new measurement changes a multiplier only if it moves far enough to be more than chance. That takes two conditions: it must move more than 3%, and more than twice its own margin of error. Below that, the gap is measurement noise.
Others have published their own measurements, also made with Anthropic's counting service on texts counted on Claude and on OpenAI. The table below sets those four beside this page's test. All find Claude counting more than OpenAI, by close amounts: about 1.5 times as many tokens in English and 1.7 to 1.8 times as many in French. In the table, each figure is Claude's number of tokens divided by OpenAI's for the same text. When a measurement gives several figures, for example over several texts, the table gives the range:
| Who measured, and when | English prose | French | Code |
|---|---|---|---|
| token‑count‑compare, 31 texts (12 October 2026) | 1.50 to 1.53 × | – | 1.49 to 1.69 × |
| Simon Willison (who writes a blog on AI tools): the Universal Declaration of Human Rights (30 June 2026) | 1.52 to 1.58 × | – (Spanish: 1.78 to 1.84 ×) | – |
| TextKit, one 94-word passage translated into each language (June 2026) | 1.61 × | 1.80 × | 1.52 × (Python) |
| Noxcod, about 1,000 words of English and two French passages of about 1,050 (21 October 2026) | 1.53 × | 1.74 × | – |
| This page's test, 114 texts (2 November 2026) | 1.49 × | 1.70 × (Spanish: 1.80 ×, Italian: 1.64 ×, German: 2.19 ×) | 1.57 × (JSON and logs: 1.45 ×, tables of figures: 1.15 ×) |
Why does Claude count so many more tokens? Anthropic changed its tokenizer with Claude Opus 4.7, on 16 April 2026. Its documentation says the new one "produces approximately 30% more tokens for the same text" than the one before. Its migration guide for Claude Opus 5.5 says the gap can reach about 35%, depending on the content.
Anthropic doesn't say why the new tokenizer cuts the same text into more pieces, although recent models usually have larger lists. Every Claude model released since Claude Opus 4.7 uses it, including the four in the calculator.
The same documentation now puts a million Claude tokens at "roughly 555k words", against about 750,000 words before. That is about 1.8 tokens per word (1,000,000 ÷ 555,000 = 1.8).
Two other measurements compare Claude's new tokenizer with its old one rather than with OpenAI. On the day Claude Opus 4.7 came out, Abhishek Ray, who writes a newsletter on Claude Code, measured 1.325 times as many tokens as on the model before it, Claude Opus 4.6, across seven real files. Four days later, Simon Willison found 1.46 times as many on one system prompt. Those two figures are in line with the 30 to 35% Anthropic announces.
Claude's old tokenizer already counted more than OpenAI. TextKit and Simon Willison also measured older Claude models: the old tokenizer gave 5 to 7% more tokens than OpenAI on ordinary English prose, and 20% more over all of token-count-compare's texts, code included.
On English text, the two gaps can be combined. The old tokenizer counted 5 to 7% more than OpenAI, and the new one counts 30 to 35% more than the old one. Together, that makes about 1.37 to 1.44 times OpenAI's number of tokens (1.05 × 1.30 = 1.37, and 1.07 × 1.35 = 1.44). Most of the direct measurements in the table find a little more, about 1.5, and the calculator follows them.
Many token counters still show Claude at 10 to 20% more than OpenAI, instead of about 50% in English. That 10 to 20% describes the old tokenizer, used up to Claude Opus 4.6, so those counters underestimate Claude. Claude Haiku 4.5, an older model not in the calculator, still uses it. Claude Haiku 5.5, which is in the calculator, uses the new one.
Gemini
Google doesn't publish the tokenizer of the calculator's three Gemini models: Gemini 4 Argon, Gemini 3.8 Flash and Gemini 3.5 Flash-Lite. Google's software kit for developers names a tokenizer for older Gemini models, up to Gemini 3.5 Flash, which is a different model from Gemini 3.5 Flash-Lite: Gemma's. For the three in the calculator, it names no tokenizer at all. Gemma is a model Google publishes with its tokenizer. The calculator's first Gemini multipliers, worked out on 29 October 2026, came from Gemma's tokenizer.
Google does offer a counting service in its Gemini API, which gives the number of tokens a Gemini model counts for a text. On 2 November 2026, the same 114 texts as for Claude were counted with it on all three models, with the same method as for Claude. The multipliers were worked out on part of the texts, then checked on the other texts. Those are called the held-out texts, because they were kept out of the calculation.
Gemini 3.8 Flash and Gemini 3.5 Flash-Lite gave exactly the same counts. Gemini 4 Argon counted almost the same: about 0.5% fewer in the median. Its largest gap was 6% fewer, on a long Chinese text. So the same multipliers hold for all three. Google's service adds tokens of its own to each call, 31 on Gemini 4 Argon and 1 on the Flash models: they were taken off before comparing.
Gemini counts about like OpenAI on prose, and more on code, data and above all tables. Here are its medians against OpenAI's count: 1.04 in English, 1.07 in French and the other European languages, and 1.04 in German. On code it is 1.15, on data 1.17 and on tables of figures 1.42.
Only one multiplier moved: code, from 1.2 to 1.15. For the others, the gap between the measurement and the earlier figure was too small to be more than chance. So the earlier figures taken from Gemma were kept: 1.05 in English, 1.06 in French, the other European languages and German, 1.2 on data. Google's own count confirmed them.
Tables are the exception. Measured, they come to 1.42, well above the 1.2 the calculator uses. Using 1.42 instead was tested on the held-out tables, and it didn't do better. With 1.42, half of those tables were off by more than 17.6%, against 12.9% with 1.2. Only the worst table improved, from 34.6% off to 22.6%. Gemini's counts vary a lot from one table to the next, so the calculator keeps 1.2, and its table figures are the least reliable for Gemini.
With the multipliers the calculator uses, the error on Gemini's held-out texts was below 3.7% for half of them and below 12.8% for nine out of ten. The worst was 34.6%: the same table as above, with the multiplier the calculator keeps.
DeepSeek and Mistral
For DeepSeek V4 Pro, DeepSeek V4.1 Flash, Mistral Large 4 and Mistral Small 4, the calculator runs your text through the tokenizer the provider publishes. For these models, the number of tokens in your text is therefore counted, not estimated.
These three tokenizers count almost like OpenAI's. Here is their median, the middle value, on the 114 texts counted on 2 November 2026. DeepSeek's counted about the same as OpenAI's in English and about 12% more in French. Mistral Large 4's counted about 2% more in English and 1% fewer in French. Mistral Small 4's counted about 4% more than OpenAI's in English and in French alike.
On tables of figures, Mistral Small 4's tokenizer counted 40% more than OpenAI's, because it cuts every number into single digits, where OpenAI's tokenizer keeps up to three digits in one piece.
The calculator still needs a multiplier for these models in two cases: for the reply, which the model hasn't written yet, and for a number you type in "Prompt" instead of pasting a text. These multipliers are those of the table below. They were worked out on 59 of the texts rather than all 114, so they can differ slightly from the medians given earlier.
Grok
xAI, the company that makes Grok, doesn't publish Grok's tokenizer. It does offer a counting service. But the terms of its API treat any information on how its services perform as confidential, and a published count of Grok's tokens could fall under that rule. So Grok hasn't been measured for this page. No other measurement of Grok's counts was found that is reliable enough to use.
So the calculator counts Grok 4.7 and Grok 4.3 exactly like OpenAI: their multiplier is 1 for every kind of text. Grok's figures still carry the ≈ sign, because they are an estimate: how far they are from Grok's real count isn't known.
The calculator's multipliers
Here, for each model and each kind of text, is the number of tokens the calculator counts for 1 OpenAI token. For DeepSeek and Mistral, these multipliers are used only for the reply and for typed numbers. For Grok, nothing is measured: every column is 1, OpenAI's count as it is.
| Models | English | French and other European languages | German |
|---|---|---|---|
| OpenAI | 1 (its own count) | 1 | 1 |
| Claude | 1.5 | 1.75 | 2.17 |
| Gemini | 1.05 | 1.06 | 1.06 |
| Grok | 1 | 1 | 1 |
| DeepSeek | 1 | 1.13 | 1.18 |
| Mistral Large 4 | 1.01 | 0.97 | 0.96 |
| Mistral Small 4 | 1.02 | 1.03 | 1.04 |
| Models | Code | Data | Table |
|---|---|---|---|
| OpenAI | 1 (its own count) | 1 | 1 |
| Claude | 1.6 | 1.45 | 1.19 |
| Gemini | 1.15 | 1.2 | 1.2 |
| Grok | 1 | 1 | 1 |
| DeepSeek | 1.02 | 1.05 | 1.01 |
| Mistral Large 4 | 1.02 | 1.01 | 1 |
| Mistral Small 4 | 1.06 | 1.1 | 1.43 |
What the calculator doesn't count
- The few tokens a provider adds to frame each message or each call. They tell the model who is speaking: 6 per message on OpenAI and 7 per call on Claude in the tests above. The calculator counts your text alone.
- The instruction some providers add when your app uses tools. Anthropic, for example, adds 286 tokens on Claude Opus 5.5. Add them yourself in "Prompt", with Claude picked in "Count in the tokens of".
- Images and files. The provider counts them on top of the text. The calculator counts only the text.
- The exact number of tokens on Claude, Gemini and Grok. For these models, the calculator gives an estimate. The exact figure comes only from the provider itself: its counting service when it has one, or its bill.
FAQ
How do you calculate AI tokens? Paste the text into a token counter that uses the provider's own way of counting. The calculator on this page does it for OpenAI, DeepSeek and Mistral. For Claude and Gemini, it estimates the count from OpenAI's. For Grok, it uses OpenAI's count as it is. Without a tool, count about 1,190 to 1,250 OpenAI tokens and about 1,800 Claude tokens for 1,000 English words.
How much does one call cost? Divide the number of prompt tokens by a million and multiply by the prompt price. Do the same for the reply with the reply price, then add the two. Providers give their prices per million tokens.
How much is 1,000 tokens? It depends on the model: 1,000 tokens hold less text on Claude than on OpenAI or Gemini. In English, they make about 800 words on OpenAI's tokenizer and about 555 words on Claude's, since April 2026. In French, they make about 700 words on OpenAI's and about 400 on Claude's. On Gemini, Google's own count of 18 English texts for this page gave about 770 words. Google's rough rule, "about 60-80 English words" per 100 tokens, gives 600 to 800. At 29 October 2026 prices, a thousand prompt tokens cost from $0.0001 to $0.01, depending on the model.
Is 5,000 tokens a lot? Not for one call: 5,000 OpenAI tokens is about 4,000 English words, a long email thread or a short report. On Claude, the same text counts about 7,500 tokens. On 29 October 2026, every model here accepted at least 256,000 tokens per call, and at 29 October 2026 prices 5,000 prompt tokens cost $0.01 on GPT-6.1 Sol and $0.0005 on GPT-6 Luna.
How much is 300,000 tokens? It is a very long text: in OpenAI tokens, about 240,000 to 250,000 English words. At that size, Claude can cost less than OpenAI. At 29 October 2026 prices, a prompt of 300,000 OpenAI tokens, with no reply, cost $1.20 on GPT-6.1 Sol instead of $0.60, because it passes the 272,000-token threshold above which OpenAI doubles the prompt price. The same English text makes about 450,000 Claude tokens and cost $0.90 on Claude Sonnet 5.5, which has no higher price for long prompts: here, Claude is the cheaper one. It was too long for Mistral Small 4.
How much do 1 million tokens cost? At regular prices on 29 October 2026, from $0.10 to $10 for a million prompt tokens and from $0.50 to $50 for a million reply tokens on the 16 models above. Some models charge more for very long prompts. A million tokens is about 800,000 English words on OpenAI's tokenizer and about 555,000 on Claude's, so compare what the same text costs, not the price per token.
How many tokens is one dollar? It depends on the model, and at the same price a dollar buys less text on Claude. At 29 October 2026 prices, a dollar bought 10 million prompt tokens on GPT-6 Luna or Claude Haiku 5.5, 500,000 on GPT-6.1 Sol or Claude Sonnet 5.5, and 100,000 on GPT-6 Astra or Claude Fable 5.1. It bought five times fewer reply tokens on each. The models in each pair have the same price, but the same English text takes about 1.5 times as many tokens on Claude. So a dollar goes further on OpenAI than on Claude. That holds for prompts below 272,000 tokens, where OpenAI's higher price for long prompts starts.
Does Claude count tokens differently from ChatGPT? Yes. ChatGPT runs on OpenAI's models, which don't count like Claude. Claude already counted a few more tokens than OpenAI, and the gap grew in April 2026 with Claude Opus 4.7. Since then, Claude has cut the same text into about 1.5 times as many tokens as OpenAI's models in English and about 1.75 times as many in French. Anthropic doesn't publish how it counts. Its counting service, free on 29 October 2026, counts a text the way Claude does, with an API key. Anthropic says that count is an estimate, whose result "might differ by a small amount" from the tokens a real call uses.
Is ChatGPT or Claude billed by the token? Their monthly subscriptions aren't: a plan includes a usage limit. Tokens are what the API bills. The API is the service an app uses to call a model, paid for by use. That is what the calculator prices.
Does my text leave my browser? No. The count and the prices are calculated on your device, and nothing you paste is sent anywhere.
Sources (52)
The exact pages the facts above come from, with the date each was published or read.
- PricingOpenAI API docs, Oct 29, 2026
- PricingClaude API Docs (Anthropic), Oct 29, 2026
- Gemini Developer API pricingGoogle AI for Developers, Oct 29, 2026
- Models and pricingxAI docs, Oct 29, 2026
- Models & PricingDeepSeek API Docs, Oct 29, 2026
- API pricingMistral AI docs, Oct 29, 2026
- tiktoken: model to encoding map (model.py)OpenAI on GitHub, Aug 17, 2026
- token-count-comparewilliamliu-ai on GitHub, Oct 12, 2026
- Human typing habits and token countsPankaj Pipada, May 8, 2026
- Neural Machine Translation of Rare Words with Subword UnitsACL 2016 (Sennrich, Haddow, Birch), 2016
- Guide on the use of generative artificial intelligenceGovernment of Canada, Oct 29, 2026
- Deep Dive into LLMs like ChatGPTAndrej Karpathy on YouTube, Feb 5, 2025
- Understand and count tokensGoogle AI for Developers, Oct 29, 2026
- Let's build the GPT TokenizerAndrej Karpathy on YouTube, Feb 20, 2024
- mistral-common: tokenizersMistral AI on GitHub, Oct 28, 2026
- Language Model Tokenizers Introduce Unfairness Between LanguagesNeurIPS 2023 (Petrov, La Malfa, Torr, Bibi), 2023
- Do All Languages Cost the Same? Tokenization in the Era of Commercial Language ModelsEMNLP 2023 (Ahia et al.), 2023
- Tokens per word: GPT-5 vs Claude vs GPT-4, measured across 7 languagesTextKit on DEV Community, Jun 2026
- Prix des API LLM : Gemini, Claude et Mistral comparés sur un texte françaisNoxcod, Oct 21, 2026
- Comment on the Claude Haiku 5.5 launch (classification job)Hacker News (Farmadupe), Oct 8, 2026
- Reasoning modelsOpenAI API docs, Oct 29, 2026
- Gemini thinkingGoogle AI for Developers, Oct 29, 2026
- Multi-round conversationDeepSeek API Docs, Oct 29, 2026
- Context windowsClaude API Docs (Anthropic), Oct 29, 2026
- Conversation stateOpenAI API docs, Oct 29, 2026
- claude-code-token-xrayCoral Bricks AI on GitHub, May 27, 2026
- Comment une facture de 37 €/jour m'a forcée à repenser toute mon infra OpenClawDEV Community (Isabelle Lafont), Apr 9, 2026
- Startups For the Rest of Us, episode 847Rob Walling, Aug 25, 2026
- Combien facturer un agent IA ? (prix + marge + modèle)Sacha Delcourt on YouTube, Feb 2, 2026
- À 24 ans, il a lancé un SaaS SEO IA… et a tout quitté (interview of Sorank's co-founder)Founder Trace on YouTube, Oct 12, 2026
- Prompt cachingClaude API Docs (Anthropic), Oct 29, 2026
- Prompt cachingOpenAI API docs, Oct 29, 2026
- Context cachingGoogle AI for Developers, Oct 29, 2026
- Comment on claude-code-token-xray (933 sessions)Hacker News (sibidharan), May 28, 2026
- Opus 4.7's new tokenizer: what it actually costsOpenRouter, Jun 24, 2026
- Migrating a production AI agent to GPT-5.6Ploy, Jul 9, 2026
- Cache TTL silently regressed from 1h to 5m (issue #46829)anthropics/claude-code on GitHub, Apr 12, 2026
- Comment on a 447-turn coding task priced on two modelsHacker News (k9294), Sep 10, 2026
- RTK reports token savings, but our cost benchmarks disagreeQuesma, Sep 2026
- Le vrai coût de l'IA : pourquoi le prix au token est fauxNicolas Martignole on YouTube, Jul 11, 2026
- Show HN: AI agents run my one-person company on Gemini's free tierHacker News (ppcvote), Mar 8, 2026
- Anthropic Console overcharged my card 100x due to internationalization input bugHacker News (rsorto), Oct 16, 2026
- Update for gpt-6 models (issue #608)OpenAI tiktoken on GitHub, Oct 17, 2026
- Counting tokensOpenAI API docs, Oct 29, 2026
- Migrating to Claude Opus 5.5Claude API Docs (Anthropic), Oct 29, 2026
- Models overviewClaude API Docs (Anthropic), Oct 29, 2026
- I measured Claude 4.7's new tokenizer. Here's what it costs youClaude Code Camp, Apr 16, 2026
- Claude Token Counter, now with model comparisonsSimon Willison's Weblog, Apr 20, 2026
- Claude Sonnet 5Simon Willison's Weblog, Jun 30, 2026
- Google Gen AI SDK: local tokenizer loaderGoogle on GitHub, Oct 29, 2026
- Token countingClaude API Docs (Anthropic), Oct 29, 2026
- Terms of Service — EnterprisexAI, Nov 2, 2026
This tool gives a general estimate, version of November 2, 2026: for a decision that commits you, ask a professional.
Read next
All Build guides- Updated November 4, 202637 minBest Mac Mini for OpenClaw: Which to Buy, or None (2026)Best Mac mini for OpenClaw: which M6 to buy at November 2026 prices, when to buy none, and what it takes to bring your agent back after a power cut.
- Updated November 4, 202643 minLocal Vector Database (Vector DB): Which One to Pick (2026)Which local vector database to pick, tested on 100,000 Wikipedia paragraphs: what a vector DB lets you do, what each one takes, and when you need none.
- Updated November 4, 202637 min15 Lovable Alternatives, AI Competitors and Apps Like It (2026)15 Lovable alternatives and competitors, sorted by why you're looking, each with its free plan and cheapest price, read on 4 November 2026.
- November 3, 202681 minHow to Use Claude Code: Guide, Tutorial and Pitfalls (2026)How to use Claude Code to build without coding: a paid plan, your first session step by step, requests it can check, and what it does without asking you.
Save months!
Get the best of the guides and field notes by email, free.