Free Token Counter
Count tokens exactly for GPT-4o, GPT-4, and Claude — and see what the prompt costs.
What is a Token Counter?
A token counter tells you how many tokens a piece of text becomes for a specific model — the unit that decides both what an API call costs and whether it fits inside the context window. Verified Tools counts GPT-4o and GPT-4 in your browser with the same o200k and cl100k encodings OpenAI uses, and counts Claude through Anthropic's official counting endpoint, because Claude's tokenizer is not published and cannot be run locally. Model choice changes the answer, and not by a little: the same test sentence measures 21 tokens on GPT-4o, 27 on GPT-4, and 40 on Claude Opus 5 (2026-09-05). Free, no sign-up.
How to Count Tokens in a Prompt
- Pick the model you actually plan to call — token counts differ between model families.
- Paste your prompt into the box. GPT counts update as you type; Claude counts appear after you press "Count tokens".
- Read the token total, and the character and word counts beside it for comparison.
- Enter your provider's price per million input tokens to see the estimated cost of that prompt.
100% Free — No sign-up, no email. GPT counting runs entirely in your browser and your text never leaves your device. Claude counting sends your text to our server and on to Anthropic's official counting endpoint, because Claude's tokenizer is not public — that request is capped per IP per day.
GPT and OpenAI token counter
GPT-4o, GPT-4.1, and the o-series share the o200k encoding; GPT-4 and GPT-3.5 Turbo use the older cl100k. Picking the wrong one of those two is the most common way a count comes out wrong, and the gap is not small — the same test sentence is 21 tokens under o200k and 27 under cl100k. Both run locally here, so counting a prompt full of proprietary text does not transmit it anywhere.
Claude and Anthropic token counter
Anthropic has not published a tokenizer for Claude 3 or later, so any tool claiming to count Claude tokens in your browser is estimating — usually by running a GPT tokenizer and hoping. That is off by roughly 15–20% on ordinary English and by considerably more on code or non-English text. This page calls /v1/messages/count_tokens, Anthropic’s own endpoint, and returns the number the API will actually bill. Opus 4.7 and later share one tokenizer, so Opus 4.8 and Opus 5 count almost identically; Claude 4.6 and earlier do not. One thing to know when comparing across providers: Anthropic counts a whole API message rather than a bare string, so the figure includes the message scaffolding you are billed for — the single character “a” comes back as 7 tokens. That is the number your invoice will use.
Turning tokens into cost
Model pricing is quoted per million tokens, so a prompt’s input cost is simply tokens ÷ 1,000,000 × rate. The price box is prefilled for Claude models from Anthropic’s published rates with the date we checked them, and left empty where we have no rate we can cite — a stale number printed with confidence is worse than an empty field. Override it with whatever your contract says. Remember this is the input side only: output tokens bill at a higher rate, commonly five times the input rate.
Context limits
The context window is measured in tokens, and it has to hold your prompt, any documents you attach, the conversation so far, and the reply. Counting before you send is how you find out whether a long document fits — and word count will not tell you, because code and non-English text tokenize far more densely than the roughly 1.2–1.5 tokens per word that plain English averages.