How to Count Tokens in a Prompt (GPT & Claude)

Every prompt you send to an AI model is measured in tokens, not words — and tokens decide two things that matter: whether your text fits inside the model’s context window, and how much an API call costs. Counting tokens before you send saves you from truncated prompts and surprise bills. Here is how to do it, and why the number differs between models.

The tool

LLM Token Counter

Open LLM Token Counter

Step by step

  1. Open the token counterGo to the LLM Token Counter — it runs in your browser, with nothing to install and nothing uploaded.
  2. Pick a modelChoose GPT-4o / 4.1, GPT-4 / 3.5, or Claude. GPT models use OpenAI’s exact public tokenizer; Claude is a clearly-labelled estimate.
  3. Paste your promptType or paste the text you plan to send. The token count updates live as you edit.
  4. Read the countSee the token total plus characters, words, and characters-per-token — then trim if you are close to a limit.

What exactly is a token?

A token is a chunk of text a model treats as one unit — often a word, but common words may be one token while longer or rarer words split into several. As a rough rule, one token is about three-quarters of an English word, so 1,000 tokens is roughly 750 words.

Models read and bill in tokens, so both the context-window limit (how much you can send) and the price (per 1,000 or per million tokens) are counted this way — which is why counting words is not enough.

Why GPT is exact but Claude is an estimate

OpenAI publishes the tokenizers its models use (o200k_base for GPT-4o and 4.1, cl100k_base for GPT-4 and 3.5), so a counter can reproduce the API’s number exactly. We use those directly.

Anthropic does not publish Claude’s tokenizer, so no tool can give an exact Claude count. We show a clearly-labelled estimate (about one token per 3.6 characters of English) — close enough to plan around, but treat it as approximate, not exact.

Is it private?

Yes. All counting happens locally in your browser — your prompt is never uploaded — so it is safe to check private, proprietary, or unpublished text.

Frequently asked questions

How many words is 1,000 tokens?

Roughly 750 words of English, though it varies with punctuation, code, and non-English text. Use the counter for an accurate figure rather than converting from words.

Why does the same text give different counts per model?

Different model families use different tokenizers, so identical text tokenizes differently. Switch models in the tool to compare.

Can I count tokens for private text safely?

Yes — counting runs entirely in your browser and nothing is uploaded, so private or proprietary prompts never leave your device.

All guides