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
- Paste your prompt or document, or open a text file. The counts update as you type.
- Read the GPT and Claude token counts, plus words and characters.
- 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_basetokenizer (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_tokensendpoint.
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.