Technology calculators

Token Calculator

Updated Aug 23, 2026 By Jehan Wadia
Rate Formulas
Input
0 total characters
Text is processed locally in your browser and never sent to a server.

Determines the token count method and which visualizations are available.
Re-orders every provider card below in real time.
Live Stats
0
Input Tokens
· loading tokenizer…
0
Output Tokens (planned)
0
Words
0
Characters (no spaces)
0
Characters (with spaces)

Budget usage
0%
Within budget
0 / 1,000 tokens — 0% of budget used
Output Token Planning
75% — ~0 output tokens
Tokenization Visualization
Adjacent tokens alternate both colour and border style (solid / dashed / dotted) so boundaries stay visible without relying on colour.
Most Expensive Words
These words expand into more tokens than average — consider rephrasing to reduce token usage.
Most Common Tokens
Frequently repeated tokens may indicate prompt-template repetition that could be optimized.
Model / tokenizer Token count Difference vs selected Characters / token
The same text produces different token counts across models due to differences in each provider's tokenizer vocabulary and encoding rules.
Cost Snapshot
Lowest published input rate
6
providers covered
$0.0000
Your tokens at the lowest rate
Full Pricing (per 1M tokens)
Step-by-Step Solution

Introduction

AI models don't read words. They read tokens. A token is a small piece of text — a short word, part of a long word, or even a space. Every AI provider charges you by the token, for both what you send in and what comes back out.

This Token Calculator counts the tokens in your text and shows what they cost. Paste your text, pick a model, and see the token count right away. You can also type in a word count or a token count if you don't have the raw text handy. If you need plain text stats first, the Word Count Calculator is a good starting point.

The tool shows you:

  • Live token counts plus words and characters
  • Cost estimates for OpenAI, Anthropic Claude, Google Gemini, xAI Grok, DeepSeek, and Perplexity
  • A token map that colors each token so you can see where text splits
  • Your most costly words and most repeated tokens, so you can trim your prompts
  • A budget bar that warns you when you get close to a model's context window
  • A side-by-side model check, because the same text counts differently on each tokenizer

You also set how long the reply should be, since output tokens often cost more than input tokens. The step-by-step section shows the math behind every number.

Your text stays in your browser. Nothing is sent to a server.

How to use our Token Calculator

Paste your text (or type a word or token count), pick a model, and the calculator shows your token count, output tokens, budget use, and the cost for each AI provider.

Input mode tabs: Pick Text Input if you have the real text. Pick Word Count or Token Count if you only know a number.

Text to analyze: Paste or type your prompt here. Tokens are counted right in your browser as you type. Use Clear Text to start over.

Known word count: In Word Count mode, type how many words your text has.

Tokens per word: Set how many tokens each word takes. English is about 1.33. If you want to work backward from typing speed, see the WPM Calculator.

Known input token count: In Token Count mode, type the token number you already have. Costs come straight from it.

Model / tokenizer: Choose the AI model you plan to use. Each one splits text a bit differently, so the token count changes.

Pricing sort order: Sort the provider cards by cheapest total, most costly total, or by name.

Token budget: Type your context window or your own token cap. Or tap a quick button like 32K, 128K, or 1M. The bar shows how much you used.

Output token planning: Drag the slider or tap a preset (like Chat 75%) to guess how long the AI reply will be. This sets your output tokens.

Show Token IDs: Flip this to see the token ID numbers instead of the split-up text.

Provider model menus: Under Full Pricing, pick the exact model for each provider to see its rates, cache prices, and total cost. Use Copy Estimate to save it.

Calculate and Reset: Press Calculate to refresh all results, or Reset to go back to the default settings.

What Is a Token in AI?

A token is a small piece of text that an AI model reads. It is not always a whole word. A token can be a full word, part of a word, one letter, a space, or a mark like a comma. Models like GPT-5, Claude, Gemini, Grok, and DeepSeek do not read letters or words the way people do. They break text into tokens first, then work with those tokens.

For example, the word "cat" is likely one token. A longer word like "internationalization" may split into five or more tokens. In English, one token is about 4 characters, and 100 words is roughly 133 tokens. To turn a word count into minutes of speech or reading, try the Reading Time Calculator.

Why Tokens Matter

Tokens are how AI companies count and charge for work. Two things depend on them:

  • Cost. Prices are listed per 1 million tokens. You pay for input tokens (the text you send) and output tokens (the text the model writes back). Output usually costs more than input. A Percentage Calculator helps when you compare rate changes between models.
  • Context window. This is the largest number of tokens a model can hold at one time. If your text is too long, it will not fit, and part of it gets cut.

Input Tokens vs. Output Tokens

Input tokens come from your prompt, your files, your chat history, and any system instructions. Output tokens are the model's reply. Reasoning models also charge for the "thinking" tokens they make before the final answer, so long answers can cost more than you expect.

Cached Tokens and Long Context Pricing

Many providers offer cached input, which is a cheaper rate for text you send again and again, like a long system prompt. Cache reads can cost as little as one tenth of the normal price. Some models also charge a higher long context rate once your input passes a limit, such as 200,000 tokens for Claude Sonnet or Gemini 2.5 Pro.

Every Model Counts Tokens Differently

Each model family uses its own tokenizer, which is a list of known text pieces. The same paragraph can turn into a different number of tokens on OpenAI, Anthropic, Google, and xAI models. That means the cheaper price per token is not always the cheaper total bill. Code, emoji, math symbols, and languages that do not use the Latin alphabet often use more tokens per word. Use the Ratio Calculator to compare tokens-per-word figures across models.

How to Use Fewer Tokens

  • Cut extra words from your system prompt. You pay for it on every request.
  • Use short, common words. Rare and long words split into more tokens.
  • Trim old chat history and repeated boilerplate.
  • Set a max output length so replies do not run long.
  • Reuse the same prompt start so caching can kick in.
  • Send only the part of a document the model needs.

Token counts here are close estimates, not exact billing numbers. Check your provider's usage dashboard for the real totals.

Planning Your AI Spend

Once you know the cost of one request, multiply it out to see the monthly bill. If your app makes 50,000 calls a month, a fraction of a cent per call still adds up. The ROI Calculator helps you check whether an AI feature earns back its token cost, and the Break Even Calculator shows how many paying users you need to cover it. For subscription products, pair token costs with the Customer Lifetime Value Calculator and the CAC Calculator to keep margins healthy, then set your price with the Markup Calculator.

Related Technology Tools

Running your own models or hosting an AI app brings other numbers to check. The AWS Calculator and Azure Pricing Calculator estimate cloud hosting, the Bandwidth Calculator and Data Transfer Calculator cover network needs, and the SLA Calculator translates uptime promises into allowed downtime. For local GPU work, the PSU Calculator and Bottleneck Calculator help you size hardware, while the Electricity Cost Calculator shows what it costs to keep it running.


Formulas used

Input tokens from base tokenizer count and model ratio
T_{in} = \text{base tokens} \times r_{model}
Base tokens from a known word count
\text{base tokens} = W \times \text{tokens per word}
Planned output tokens from ratio slider
T_{out} = T_{in} \times \frac{p}{100}
Input cost (rate per 1M tokens)
C_{in} = \frac{T_{in}}{1{,}000{,}000} \times R_{in}
Output cost (rate per 1M tokens)
C_{out} = \frac{T_{out}}{1{,}000{,}000} \times R_{out}
Estimated total cost per request
C_{total} = C_{in} + C_{out}
Budget usage percentage
\text{budget used} = \frac{T_{in}}{B} \times 100\%
Characters per token
\text{chars per token} = \frac{\text{characters}}{\text{tokens}}

Frequently asked questions

How accurate are the token counts in this calculator?

The counts are close estimates, not exact billing numbers. For OpenAI GPT tokenizers, the tool splits text in your browser using an o200k-style method, which lands very near the real count for normal English text.

For Claude, Gemini, Grok, DeepSeek, and Perplexity, the tool scales that count by each model's average ratio. Expect a small gap of a few percent. Always check your provider's usage dashboard for exact billing.

Why does the same text show a different token count for each model?

Each company builds its own tokenizer with its own list of text pieces. One model may store "tokenization" as a single piece, while another splits it into three.

Open the Cross-Model Token Count Comparison section to see the same text counted every way, side by side.

Is my text sent anywhere when I use this tool?

No. All counting happens inside your browser. Nothing is uploaded, stored, or sent to any AI provider or server. You can safely paste private prompts, client work, or internal documents.

What should I set the output token slider to?

Use the presets as a guide:

  • Classification (10%) — short labels or yes/no answers
  • RAG / Q&A (40%) — short answers pulled from documents
  • Chat (75%) — normal back-and-forth replies
  • Full Response (100%) — full-length answers
  • Long Generation (175%) — essays, code files, long drafts

This matters because output tokens usually cost more per token than input tokens.

Why do the DeepSeek prices keep changing?

DeepSeek uses time-based pricing. Off-peak hours (16:30–00:30 UTC) cost less than peak hours (00:30–16:30 UTC). The tool shows the current UTC clock and tells you which rate is live right now, and it picks the matching model group for you.

Why are some tokens missing from the visualization?

Two reasons. First, the token map only works for OpenAI GPT tokenizers, since those are the ones split locally. Other models show a total count only.

Second, the map shows the first 1,200 tokens to keep the page fast. The full count is still used for every cost figure.

What does the "Most Expensive Words" list tell me?

It shows words that split into two or more tokens. Long words, rare words, brand names, and technical terms cost more than short common words.

If a costly word sits in a system prompt you send on every request, swapping it for a shorter word saves tokens on every single call.

Should I pick the model with the lowest price per million tokens?

Not always. A model with a cheaper rate can still cost more if its tokenizer splits your text into more tokens. Also check output rates, since many models charge four to ten times more for output than input.

Sort the provider cards by Cheapest estimated total first to compare real totals, not just rates.

What is the difference between cache write and cache read pricing?

A cache write stores your prompt the first time, and costs a bit more than a normal input token. A cache read reuses that stored prompt later, and costs much less — sometimes just 10% of the normal rate.

Caching pays off when you send the same long system prompt over and over.

Why does my budget bar turn orange or red?

The bar changes color as you fill your token budget:

  • Green — under 75% used
  • Orange — 75% to 90% used
  • Red — over 90%, or past your budget

Leave room for the model's reply. Input plus output must both fit inside the context window.

What do the retired models in the list mean?

Retired models are no longer sold by the provider. Their last published rates are kept so you can check old invoices or compare how prices have dropped over time. Do not plan new projects around them.

How do I work out my monthly AI bill?

Find your cost for one request in the step-by-step section, then multiply by how many requests you expect. The steps also show the cost for 1,000 identical requests, which makes scaling up easy.

Example: $0.002 per request × 100,000 requests = $200 per month.

Why do reasoning models cost more than the price suggests?

Reasoning models like o3, Grok 4, and DeepSeek-Reasoner create hidden "thinking" tokens before writing the final answer. You pay for those at the output rate, even though you never see them.

For these models, set the output slider higher than you would for a normal chat model.

Do tokens work the same for other languages and code?

No. English is the most token-efficient because tokenizers are trained mostly on English text. Chinese, Japanese, Korean, Arabic, and Hindi often use two to three times more tokens for the same meaning.

Code also runs high because of symbols, indents, and variable names. Paste a real sample to see your true count.

Why do word and character stats show a dash?

Those stats need real text. In Word Count mode there are no characters to count, and in Token Count mode there are no words or characters. Switch to the Text Input tab and paste your text to see every stat.

What is long context pricing and when does it start?

Some models charge double once your input passes a limit. Claude Sonnet 4.5 and Gemini 2.5 Pro switch above 200,000 input tokens. Grok 4 switches above 128,000.

The tool watches your token count and flips to the higher tier by itself, showing an orange Long Context badge when it does.

What does "characters per token" tell me?

It shows how well a tokenizer packs your text. Plain English usually lands near 4 characters per token. A lower number means your text is token-hungry, often due to code, symbols, rare words, or another language.

A higher number means your text is efficient and cheap to send.

Can I use this to compare cost before switching providers?

Yes. Paste a real prompt you use today, set your output ratio, then sort by cheapest total. Every provider card shows its own model menu, published rates, and estimated total for the same text.

Use Copy Estimate to paste the numbers into a spreadsheet or share them with your team.