How to Count Tokens for GPT, Claude & Gemini

Count tokens for GPT, Claude and Gemini, see why the same text costs different amounts per model, and estimate your API bill before you send a prompt.

Updated 5 min read By CodingEagles
Free tool AI Token Counter for GPT, Claude & Gemini Count tokens for GPT, Claude and Gemini and estimate API cost. Open tool

Tokens are the unit language models actually read and bill for, so counting them answers two practical questions before you send a prompt: will it fit the model’s context window, and what will it cost? You can check both in the token counter without an API key.

The quick answer

Paste your text into the token counter, pick a model, and read the token count. It also shows words, characters, how much of the context window you are using, and an editable cost estimate. Everything runs in your browser.

What is a token?

A token is a chunk of text: a short word, part of a longer word, a punctuation mark, or a space. As a rule of thumb, one token is about four characters or three quarters of a word in English. So 1,000 words land around 1,300 to 1,500 tokens. That ratio shifts for code, unusual words and other languages, which is why an actual count beats a guess.

Why token count matters

Context windows. Every model can only hold so many tokens of input and output combined. If your prompt plus the expected reply is larger than the window, the request fails or gets truncated. Counting first tells you whether you need to trim the prompt or switch to a model with a bigger window.

Cost. APIs bill per token, and input and output are priced separately, with output usually several times more expensive. Counting the input and estimating the output lets you predict the bill per request and multiply it out across your usage.

How GPT, Claude and Gemini differ

The same sentence does not produce the same token count on every model, because each family tokenizes text with its own scheme. OpenAI’s newer models use one tokenizer, its older ones another, and Anthropic and Google each use their own. Newer versions within a family can also shift counts.

In practice the numbers are close across models, but not identical. Treat a cross-model count as a good estimate and count against the specific model you plan to call when the exact figure matters for cost or context limits.

Estimating cost from a token count

Once you have a token count, cost is simple arithmetic:

input cost  = input tokens  ÷ 1,000,000 × input price per 1M
output cost = output tokens ÷ 1,000,000 × output price per 1M

The tool fills in a starting price for each model, but those rates are editable estimates. Providers change pricing, and batching or prompt caching can cut it substantially, so confirm the current rate on the provider’s official pricing page before you rely on a number.

A few ways to spend fewer tokens

  • Trim boilerplate and repeated instructions from long system prompts.
  • Send only the context the model needs, not an entire document, when a summary will do.
  • Remember that output is the expensive half, so asking for concise answers saves more than trimming input.

When you are wrangling API payloads alongside prompts, the Base64 encoder, JSON formatter and hash generator are handy next stops. If you just need word and character counts for writing rather than tokens, the word counter is the better tool.

Frequently asked questions

How many tokens is 1,000 words?
Roughly 1,300 to 1,500 tokens in English, since one token averages about 0.75 words. Code, punctuation-heavy text and non-English languages use more tokens per word, so always count your actual text rather than relying on the average.
Why does the same text cost a different number of tokens on each model?
Each model family uses its own tokenizer, which splits text into different chunks. OpenAI, Anthropic and Google all tokenize differently, so an identical prompt can report a different token count on GPT, Claude and Gemini. Count against the model you will actually call.
Are the token counts here billing-accurate?
For OpenAI models the count uses the same tokenization the API bills against, so it matches your charge. Claude and Gemini do not publish an exact browser tokenizer, so those counts are close estimates rather than exact figures.

Ready to try it?

Count tokens for GPT, Claude and Gemini and estimate API cost. Free, in-browser, and 100% private — your data never leaves your device.

Open the AI Token Counter for GPT, Claude & Gemini