Token counter for ChatGPT and Claude

Paste a prompt or document to get tokens, words, characters and the estimated API cost. Your text is never uploaded.

Runs locally, nothing is uploaded

0GPT tokens (o200k, exact)
0Claude tokens (estimate)
0words
0characters

Estimated API cost

Input
–
Output
–
Total
–

What is a token?

Large language models such as GPT and Claude do not read words but tokens: chunks of text produced by a splitting algorithm called a tokenizer. A common English word is often a single token, while rare words, names, numbers, code and accented characters can take several. In English, one token is roughly 4 characters or three quarters of a word, so 1,000 words come to about 1,300 tokens.

Tokens matter for three reasons: API pricing (billed per million tokens), the context window (the maximum amount of text a model can handle at once) and the output limit of each response.

How to use the counter

  1. Paste your prompt or document, or open a text file. The counts update as you type.
  2. Read the GPT and Claude token counts, plus words and characters.
  3. To estimate a budget, pick a model, set the expected output length and the number of calls.

How counting works

  • GPT: OpenAI’s official o200k_base tokenizer (GPT-4o and later models) runs in your browser. The count is exact for plain text.
  • Claude: Anthropic does not publish its tokenizer. The figure is an estimate derived from the o200k count (about +15%). For an exact number, the Anthropic API offers a dedicated count_tokens endpoint.

The first count downloads the tokenizer dictionary (about 2 MB, cached afterwards). Your text is never sent to a server, so you can measure confidential documents safely.

Estimating API cost

APIs bill input tokens (your prompt, conversation history and attached documents) and output tokens (the generated answer) separately, and output usually costs four to five times more. The cost of a call is:

cost = input tokens × input price ÷ 1,000,000 + output tokens × output price ÷ 1,000,000

Example: a 3,000-token prompt with a 500-token answer, at $3 per million input tokens and $15 per million output tokens, costs 0.009 + 0.0075 = $0.0165 per call, or about $16.50 for 1,000 calls.

Claude prices are prefilled from Anthropic’s public API pricing (as of 28 November 2026). For other providers, choose “Custom price” and enter their rates. Prices change often: check the official pricing page before committing to a budget.

Cutting token usage

  • Trim redundant instructions and unnecessary examples from your system prompt.
  • Send only the relevant passages of a document instead of the whole file.
  • Use prompt caching: the fixed part of a reused prompt is billed at a large discount.
  • Ask for a specific response length in your instructions.
  • Use batch APIs for non-urgent jobs, typically about half the price.

Updated 28 November 2026.

Frequently asked questions

How many tokens is 1,000 English words?
About 1,300 tokens, depending on vocabulary and model.
Is the count exact?
Yes for GPT, which uses the official o200k tokenizer. For Claude it is an estimate within about 15%.
Is my text sent to OpenAI or Anthropic?
No. Counting runs in your browser and nothing leaves your device.
Are images and PDFs counted?
No, the tool counts text. Images and PDFs sent to an API are billed under each provider's own rules.
Why do other languages use more tokens?
Tokenizers are trained mostly on English, so words in French, German or other languages are often split into more pieces.