AI tools

ChatGPT Token Counter

Last UpdatedAugust 2026

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.

Tokens (est.)

0

Words

0

Characters

0

Sentences

0

Context window usage 0 of 1,000,000 tokens

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

Type or paste text above to see the estimated 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.

01

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.

02

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.

03

How to count tokens in a prompt

  1. Paste your text into the box above. The count updates as you type.
  2. Pick the model you are actually using, since context limits and prices differ enormously.
  3. Set the output tokens you expect the reply to be, because on most models output costs several times more than input.
  4. 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.

ChatGPT token counter showing token count, context window usage and estimated API cost for a prompt
Token count, word and character counts, context window usage and estimated cost update as you type, with the token boundaries shown underneath.
04

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:

input cost = (input tokens / 1,000,000) x input price output cost = (output tokens / 1,000,000) x output price total = input cost + output cost

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.

05

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.

06

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: ____________

ModelProviderContextInput / 1MOutput / 1M
GPT-5.5OpenAI1.05M$5.00$30.00
GPT-5.4OpenAI1M$2.50$15.00
GPT-5.4 MiniOpenAI1M$0.40$1.60
GPT-5.4 NanoOpenAI1M$0.20$1.25
GPT-4.1OpenAI1M$2.00$8.00
GPT-4OpenAI128K$10.00$30.00
GPT-3.5 TurboOpenAI16K$0.50$1.50
Claude Opus 4.8Anthropic200K$15.00$75.00
Claude Sonnet 4.6Anthropic200K$3.00$15.00
Claude Haiku 4.5Anthropic200K$0.80$4.00
Gemini 2.5 ProGoogle1M$2.00$12.00
Gemini 2.5 FlashGoogle1M$0.15$0.60
07

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.

08

ChatGPT token counter FAQ

It is an estimator. It applies the same text-splitting rules OpenAI's tokenizer uses, then approximates how each piece is broken down further, because the real vocabulary file is far too large to load in a browser. On ordinary English prose it usually lands within a token or two. On long technical words, unusual names and dense code it can drift further, because that is exactly the text real tokenizers split most aggressively. For counts you can bill against, use OpenAI's tiktoken library directly.
The oldest messages get dropped silently. Nothing errors and nothing warns you. What you see is the model contradicting an earlier instruction or forgetting a detail you gave it. The context bar in this tool shows how close you are, and it changes colour past 60, 80 and 95 percent.
Yes, all of it counts. A leading space is normally merged into the word that follows, so " cat" is one token rather than two. That merging is why a raw character count divided by four is only a rough guide, and why double spaces and repeated punctuation quietly cost you.
Shorten the system prompt first, since it is resent on every request. Then cut filler phrases, switch prose instructions to bullets, stop resending context the model can already see, and start a fresh conversation rather than continuing one that has drifted. Section 07 covers each of these.
No. Everything happens in your browser. There is no server behind this tool, no account, and nothing you paste leaves your device. You can confirm that by disconnecting from the internet, the counter keeps working.
Programming languages are full of brackets, operators and short identifiers that were never common enough in training text to earn their own token. Each gets split into several pieces. Indentation is the worst offender: four spaces at the start of every line adds up fast across a long file.
Roughly. Both use their own tokenizers, and neither publishes one that runs in a browser, so those counts apply a ratio to the GPT estimate. Good enough to compare models and sanity-check a budget, not good enough to bill against.
About 750 words of ordinary English, or three to four paragraphs. That ratio drops sharply for technical writing, code, and any language other than English, where the same meaning can take several times as many tokens.
Yes. No account, no sign-up, no limit on how many times you use it. It runs on your own device, so there is nothing for us to meter.
09

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.

Aayush Kulshrestha, founder of Calcxi

Written & verified by

Aayush Kulshrestha

B.Tech Computer Science · 8 years in web development & SEO · Bhilwara, India
About · LinkedIn · Report an error