How Many Tokens Is My Prompt? (Per-Model, 2026)
If you have ever pasted a prompt into an LLM API and been surprised by the bill — or hit a "context length exceeded" error you did not expect — the culprit is almost always a misunderstanding of tokens. Tokens are the unit that language models actually read, the unit you are billed on, and the unit that context windows are measured in. They are not the same as words, and they are not the same as characters. Worse, the exact token count for the same text differs from one model family to the next. This post explains what a token is, why the count is per-model, and how to get an exact number instead of a guess.
Tokens vs words vs characters
A large language model does not read your text as letters or as whole words. It reads tokens — subword pieces produced by a byte-pair encoding (BPE) tokenizer. Common words like "the" or "and" are usually a single token; longer or technical words split into two to four pieces; a rare string or a chunk of code can fragment into many.
The rough conversions worth memorising, for English prose on GPT-family models, are: 1 token ≈ 4 characters ≈ 0.75 words. Equivalently, 1 word ≈ 1.33 tokens. So a 1,000-word essay is roughly 1,333 tokens, and a 1,000,000-token context window holds around 750,000 words — about three full-length novels. These ratios are close enough for back-of-envelope planning, but they are approximations. Dense code, JSON, and non-Latin scripts run higher (more tokens per word) because they fragment more.
The trap is treating the 0.75 rule as if it were exact. When you are near a context ceiling or estimating a production bill across millions of calls, a 10% error in the token estimate is a 10% error in your cost projection. For that you want the real count.
Why the count is per-model
Here is the part most people miss: there is no single universal token count for a piece of text. Each model family uses its own tokenizer, so the same sentence produces different counts on GPT, Claude, and Gemini.
- OpenAI publishes its tokenizer (tiktoken). Current GPT-4o and GPT-5.x models use the o200k encoding (a 200,000-token vocabulary); older GPT-3.5 and GPT-4 models used cl100k (100,000 tokens). Because the tokenizer is public, an OpenAI count can be produced exactly — matching the count the API bills you for.
- Anthropic (Claude) and Google (Gemini) keep their tokenizers proprietary. They are not publicly released, so any count for those models is a calibrated estimate — typically chars ÷ 3.5 for Claude and chars ÷ 3.8 for Gemini, accurate to within roughly ±10–15% on English text.
This is why a good counter labels every number EXACT or ESTIMATED. For OpenAI you get the billed truth; for Claude and Gemini you get a good-enough plan number, and you should add a 10–15% safety margin before relying on an estimate to fit a tight context window.
Worked example: "Hello, world!"
Take the string Hello, world!. Run it through OpenAI's o200k tokenizer and it encodes to exactly 4 tokens: Hello, ,, world, !. Note the leading space on world — spaces attach to the following word, which is part of why counting by eye fails.
The 4-characters-per-token rule of thumb would have guessed the 13-character string at about 3 tokens. The real tokenizer says 4. That gap is small here, but it scales: over a long document, the rule-of-thumb drift compounds, which is exactly why you count rather than estimate when money or context limits are on the line.
Count it exactly, in your browser
The Token Counter runs OpenAI's real tiktoken-compatible BPE tokenizer as WebAssembly entirely in your browser — nothing you paste is uploaded to any server or API. That is the whole point of a client-side counter: you can measure a proprietary system prompt, a customer's document, or sensitive internal text without it ever leaving your device. For OpenAI models the count is exact and matches the API's billing; for Claude and Gemini it shows a labelled estimate, plus a words-and-characters view.
Key takeaways
- A token is the model's real unit — subword BPE pieces, not words or characters. English rule of thumb: 1 token ≈ 4 characters ≈ 0.75 words (so 1,000 tokens ≈ 750 words).
- The count is per-model. OpenAI (o200k for GPT-4o/GPT-5.x, cl100k for GPT-3.5/GPT-4) can be counted exactly; Claude and Gemini tokenizers are proprietary, so their counts are estimates (≈ ±10–15%).
- Engine-exact anchor:
Hello, world!= 4 tokens in o200k (Hello·,·world·!) — the 4-chars-per-token rule would have guessed ~3. - For estimated (Claude/Gemini) counts near a context ceiling, add a 10–15% margin; OpenAI counts need none.
- Count client-side so sensitive prompts never leave your browser — then turn the count into a bill with the LLM API Cost Calculator.