Token Counter
Paste text and get a script-aware token estimate, a full character breakdown, and an honest account of how far off the estimate is likely to be.
usage object on any completion response — prompt_tokens and completion_tokens are what you are billed on, they cost nothing to read, and they settle the question for the model you are actually calling.An estimate. Paste a real count above to see how far off it is on your kind of text.
- Characters
- 354
- Characters excluding whitespace
- 292
- Words
- 63
- Lines
- 1
- Characters per estimated token
- 4.37
- Estimated tokens per word
- 1.29
- characters ÷ 4, the usual rough ceiling
- 89
Where the estimate comes from
- Latin letters
- 280 chars → ~71 tokens (87.0%)
- Digits
- 3 chars → ~1 tokens (1.2%)
- Punctuation and ASCII symbols
- 9 chars → ~9 tokens (11.1%)
- Whitespace and line breaks
- 62 chars → ~0 tokens (0.0%)
What this number is good for, and what it is not
Tokens are the unit you are billed in, so a token count is the closest thing to a price tag that a piece of text has. This page gives you one without sending your text anywhere, which is the main reason to use a counter that runs in the browser: the text you most want to measure is usually the text you least want to paste into someone else’s server.
It is an estimate. Use it to size things — is this prompt 400 tokens or 4,000, will this document fit, is the system prompt or the retrieved context the expensive half. Do not use it to reconcile an invoice, to set a hard limit that a request must not cross, or to argue with a provider about a bill. For any of those you want the real count, and the real count is free: send the request, read usage.prompt_tokens, and you have the authoritative number for the exact model you called.
A few things this deliberately does not count, because they are not in your text. Chat models wrap every message in template markup — role markers, turn separators, sometimes a few tokens of preamble — which typically adds a handful of tokens per message. Tool and function schemas are serialised into the prompt and are frequently larger than the prompt itself. Reasoning models emit hidden thinking tokens that you pay for and never see. All three are why your own count and the number on the bill differ even when your tokenizer is exactly right.