AI tools
ChatGPT Token Counter
Paste any prompt into this ChatGPT token counter and see roughly how many tokens it uses, how much of the model's context window that fills, and what an API call would cost. It covers GPT, Claude and Gemini, and it runs entirely in your browser, so nothing you paste is ever sent anywhere.
It is an estimator, not a copy of OpenAI's tokenizer. Section 02 explains exactly how close it gets and where it drifts, because a token counter that hides its own margin of error is not much use to anyone budgeting an API bill.
System tokens: 0
User tokens: 0
Chat requests carry a few extra tokens per message for role formatting, plus a couple for the reply primer. This tool adds an allowance for that, so the total here will be slightly higher than the raw text alone.
Tokens (est.)
0
Words
0
Characters
0
Sentences
0
Estimated API cost
Input
$0.000000
Output
$0.000000
Total
$0.000000
Using GPT-4.1 with 500 output tokens. Prices are per million tokens as configured in this tool. Check the current rate at the provider before you rely on it.
Token boundaries
Each block is one estimated token. Boundaries follow the same splitting rules OpenAI's tokenizer uses, but the sub-word merges are approximated. See section 02.
What Is a Token in ChatGPT and Other AI Models?
Language models do not read word by word. They break text into tokens, which are chunks of characters produced by an algorithm called byte pair encoding. A token is roughly three quarters of an English word on average, but that average hides a lot of variation.
Common word
One token. "cat", "run", "the", "because" are each a single token, because they appear constantly in training text.
Long or rare word
Two to six tokens. "tokenization" splits into two pieces. "antidisestablishmentarianism" splits into about six.
Code and symbols
Usually more tokens per character. Brackets, operators and indentation all cost, and four spaces of indent can be several tokens.
Non-English text
Often several times more tokens than the same meaning in English, because the vocabulary was built mostly from English text.
Rule of thumb: 1,000 tokens is around 750 English words, or three to four ordinary paragraphs. Spaces and punctuation count too, and a leading space is usually merged into the word that follows it, which is why " cat" is one token rather than two.
How this ChatGPT token counter estimates your tokens
Most token counter pages tell you they are accurate and leave it there. Here is the actual position.
Real tokenisation needs the model's full vocabulary file, which is several megabytes. Loading that on every page view would make this page slow for everyone, so like every browser-based counter this one estimates. It does the same first step OpenAI's tokenizer does, splitting text on word, digit, punctuation and whitespace boundaries, then estimates how each piece would be broken down further.
Where it is reliable
Ordinary English prose. Common words are single tokens in the real tokenizer and single tokens here, so a normal paragraph usually lands within a token or two of the true count.
Where it drifts
Long technical words, compound words, unusual names and dense code. The real tokenizer splits those into several pieces, and any estimator has to guess where. Expect a difference of a token or two on that kind of text, occasionally more.
For exact counts, use the real thing. OpenAI publishes tiktoken, its own tokenizer library, and it takes three lines of Python. If you are billing a client or sizing a production system, use that. If you are checking whether a prompt is roughly 800 tokens or roughly 8,000, this page is fine.
Claude and Gemini use different tokenizers again, and neither is published in a form a browser can run. Those counts apply a rough ratio to the GPT estimate, so treat them as a ballpark rather than a number to budget against.
How to count tokens in a prompt
- Paste your text into the box above. The count updates as you type.
- Pick the model you are actually using, since context limits and prices differ enormously.
- Set the output tokens you expect the reply to be, because on most models output costs several times more than input.
- Check the context bar. If it is climbing past 80 percent you are close to the point where the model starts forgetting.
Use the System + User tab for API work
A system prompt is sent again with every single request. A 400 token system prompt across ten thousand calls is four million input tokens you may not have counted. Splitting them out shows you which half of your prompt is the recurring cost.
Use Compare Models before you commit
The same prompt can differ by a factor of fifty in price between the cheapest and most expensive model. The compare tab sorts every model cheapest first and flags any whose context window your prompt would not fit into.
Estimating OpenAI API cost from your token count
API pricing is quoted per million tokens, and input and output are charged at different rates. The arithmetic is simple:
Two things catch people out. First, output is usually three to five times the price of input, so a chatty model that answers at length costs far more than the prompt suggests. Second, in a conversation the entire history is resent as input on every turn, so a long chat costs more per message as it goes on, even if your messages stay short.
A worked example. A 1,000 token prompt with a 500 token reply, at $2.00 input and $8.00 output per million: input is $0.002, output is $0.004, total $0.006 per call. Run that ten thousand times a month and it is $60. The prompt you thought was free is not.
Context windows, and what happens when you run out
The context window is the total number of tokens a model can hold at once: your system prompt, the whole conversation so far, and the reply it is about to write, all together.
When you exceed it, nothing dramatic happens on screen. The oldest messages are simply dropped. The model does not tell you, and it does not know they are gone. What you notice is the assistant contradicting something you agreed twenty messages ago, or forgetting an instruction it followed perfectly earlier. That is almost always context loss rather than the model being unreliable.
The practical signal: if a long conversation starts drifting, do not argue with it. Start a fresh chat and paste in a short summary of what matters. You will get better answers and pay less for them.
Model context windows and pricing
Verify before you rely on this table. AI pricing changes often and I have not been able to confirm these figures against the official pages. Check each row at OpenAI pricing, Anthropic pricing and Google Gemini pricing, then fill in the date below.
Last verified against official pricing pages: ____________
| Model | Provider | Context | Input / 1M | Output / 1M |
|---|---|---|---|---|
| GPT-5.5 | OpenAI | 1.05M | $5.00 | $30.00 |
| GPT-5.4 | OpenAI | 1M | $2.50 | $15.00 |
| GPT-5.4 Mini | OpenAI | 1M | $0.40 | $1.60 |
| GPT-5.4 Nano | OpenAI | 1M | $0.20 | $1.25 |
| GPT-4.1 | OpenAI | 1M | $2.00 | $8.00 |
| GPT-4 | OpenAI | 128K | $10.00 | $30.00 |
| GPT-3.5 Turbo | OpenAI | 16K | $0.50 | $1.50 |
| Claude Opus 4.8 | Anthropic | 200K | $15.00 | $75.00 |
| Claude Sonnet 4.6 | Anthropic | 200K | $3.00 | $15.00 |
| Claude Haiku 4.5 | Anthropic | 200K | $0.80 | $4.00 |
| Gemini 2.5 Pro | 1M | $2.00 | $12.00 | |
| Gemini 2.5 Flash | 1M | $0.15 | $0.60 |
How to reduce token usage without losing quality
Cut the system prompt first
It is the only part billed on every single request. Halving a 600 token system prompt saves more across a month than anything you do to individual messages.
Delete the politeness scaffolding
"Please note that", "I would like you to", "as an AI language model". Each costs several tokens and none changes the answer.
Bullets instead of prose
Lists carry the same instructions in fewer words, and models follow them at least as reliably.
Do not resend what it already has
In a continuing conversation the model can still see earlier messages. Pasting the document again doubles the bill for nothing.
Start fresh instead of arguing
A new chat with a two line summary is cheaper and usually better than a thirty message thread that has drifted.
Match the model to the job
A classification task does not need the flagship model. The compare tab shows the same prompt priced across all of them.
ChatGPT token counter FAQ
Limits, sources and independence
What this tool cannot do
It cannot give you an exact token count, only a close estimate. It cannot see images, audio or file attachments, which are tokenised by rules of their own. It cannot account for tool calls, function schemas or cached input, all of which change what you are billed. And it has no idea what a model will actually write back, so the output figure is your estimate, not a prediction.
Where the numbers come from
Token boundaries follow the publicly documented splitting pattern used by OpenAI's cl100k_base encoding. Sub-word estimates are this tool's own approximation and are described openly in section 02. Prices and context windows are as configured in the tool and have not been verified against the providers' official pages, which is why section 06 asks you to check them and carries an empty verification date.
Not affiliated with OpenAI, Anthropic or Google
Calcxi is an independent website. We are not affiliated with, endorsed by or sponsored by OpenAI, Anthropic, Google LLC or any model provider. "ChatGPT" and "GPT" are trademarks of OpenAI, "Claude" of Anthropic, and "Gemini" of Google LLC, referred to here only to describe what this tool estimates. Nothing on this page is a quote, and costs shown are estimates only.
Related tools on Calcxi
Written & verified by
B.Tech Computer Science · 8 years in web development & SEO · Bhilwara, India
About ·
LinkedIn ·
Report an error