Your first API bill rarely matches the estimate you made in your head. You counted the words in your prompt, multiplied by the price you remembered, and the real charge came out different, sometimes by a little, sometimes by a lot. The gap is not a billing trick. It is a unit mismatch: you measured in words, and the provider measured in tokens.

This guide explains why the token is the billing unit, why a word could never do the job fairly, and how to count tokens yourself before you send anything, using the free Token Counter on Ovatly. The counter runs a real BPE tokenizer in your browser, shows tokens alongside characters, words, sentences and paragraphs, and never uploads your text.

Contents

  • Quick answer
  • What a token actually is
  • Why a word is the wrong unit to charge for
  • Why the token is the honest meter
  • How to count tokens, step by step
  • Worked example: one greeting, two very different counts
  • What the token count does not include
  • Limitations worth knowing
  • Common mistakes
  • FAQs
  • Conclusion

Quick answer

AI models charge by token because the token is what the model actually processes. Before a model can work on your text, a tokenizer splits it into sub-word pieces called tokens, and everything the model does, reading your input and generating its reply, happens in those pieces. Words are only a human reading unit. A single word might be one token or several, so pricing per word would charge identical fees for very different amounts of work. If you want to know what a prompt will cost or whether it fits a context limit, count its tokens with the Token Counter and use that number, not the word count.

What a token actually is

A token is a piece of text produced by a tokenizer, the component that prepares your words for the model. Tokenizers split text into sub-word pieces. Frequent words tend to survive as single tokens. Unusual words are broken into several pieces. Punctuation and spaces attach to neighboring tokens instead of standing alone.

That splitting rule explains most of the surprises. A short, common sentence is cheap because nearly every word in it is a familiar pattern the tokenizer keeps whole. A rare technical term, a line of code or a sentence in a language the tokenizer saw less of during its training usually takes more tokens per word, because fewer of its patterns are stored as single pieces. Two texts with the same word count can therefore have quite different token counts, and it is the token count that describes the work.

Why a word is the wrong unit to charge for

Imagine two prompts of exactly 100 words each. The first is plain, everyday English. The second is dense with rare vocabulary, symbols and code. To a word meter, they are identical jobs. To the model they are not: the second becomes noticeably more tokens, meaning more processing and more context window used.

A per-word price would force one of two bad outcomes. Either plain text subsidizes heavy text, or the provider sets the word price high enough to cover the worst case and overcharges everyone with ordinary prompts. Words also have fuzzy edges as a unit: some writing systems do not mark word boundaries with spaces at all.

Why the token is the honest meter

The token avoids both problems because it is measured after tokenization, at the exact point where the text becomes model input. The count reflects the real size of the job: how much the model must read, how much of its context window your text occupies, and, for the reply, how much it generates. A context window is a budget of processing, and tokens are the currency that budget is spent in.

This is also why the same text can price slightly differently across providers. Each model family has its own tokenizer, and families split text differently. A count taken with one family's tokenizer is exact for that family and a close approximation for the others. That is not inconsistency; it is each provider metering the pieces its own model actually consumed.

How to count tokens, step by step

  1. Open the Token Counter and paste or type the text you want to measure.
  2. Click Count tokens.
  3. Read the token count together with the character and word counts, so you can see how far apart the measures sit for your particular text.
  4. If you need more than the raw count, take the number onward: the Context Window Checker shows how much of a model's window the text fills, and the Prompt Cost Calculator turns input and output tokens into a price estimate.

Worked example: one greeting, two very different counts

Take the shortest text imaginable: "Hello, world!" Counted with the tool, it comes out at 4 tokens, 13 characters, 12 characters without spaces, 2 words and 1 sentence. Two words, four tokens. Even this tiny, ordinary greeting costs twice as many tokens as it has words, because the punctuation and spacing ride along with the pieces.

The pattern holds at sentence length. "The quick brown fox jumps over the lazy dog" is 9 tokens. A fuller sentence, "Prompt engineering is the practice of writing instructions for AI models.", is 12 tokens. Both are plain English, yet neither matches its word count exactly. Scale that gap up to a long document or a chat history, and a word-based guess stops being a number you can budget against.

What the token count does not include

A raw token count measures your text and nothing else. Real chat APIs add a few tokens per message for role markers and structure, so the final payload is slightly larger than the content you counted. A full conversation also spends tokens on the system prompt, earlier messages and replies. Treat the count from your pasted text as the content size: the right base for an estimate, but not the whole payload.

Limitations worth knowing

The counter uses the GPT tokenizer (o200k encoding), so its counts are exact for the GPT-4o family. Claude, Gemini and other families split text differently, so for them the count is a close approximation, not an exact figure, and the provider's own counter is the authority for its models. Very long pastes are counted on your own device, and a full book can take a moment. None of this undermines the main point: an approximate token count is a far better basis for pricing and limits than an exact word count of the wrong unit.

Common mistakes

  • Estimating cost from the word count. The word count and token count diverge most on exactly the texts that cost the most: code, rare vocabulary and non-English writing.
  • Assuming one token equals one word. Common short words are often one token; much real text runs above one token per word.
  • Treating one family's count as exact for another. Use it as an approximation across families and check the provider's own counter before committing to a budget.
  • Forgetting the reply. Output is tokenized and billed too. A short prompt that asks for a long answer can cost more in output than in input.
  • Ignoring formatting overhead. Chat structure adds a few tokens per message, which matters when a design sends thousands of small messages.

FAQs

Why does the token count differ from the word count? Tokenizers split text into sub-word pieces. Frequent words tend to be single tokens, unusual words become several, and punctuation and spaces attach to neighboring tokens.

Would charging per word be simpler? Simpler to read, but unfair as a meter. One word can be a single token or several tokens of work for the model, so a per-word price would charge the same for very different amounts of processing.

Is a token count exact for every model? No. The counter on this page is exact for the GPT-4o family encoding it uses, and an approximation for Claude, Gemini and other families, which split text differently. Providers' own counters are the authority for their models.

Does chat formatting add tokens on top of my text? Yes, real chat APIs add a few tokens per message for role markers and structure. A raw text count is the content size, not the final API payload.

Is my text uploaded when I count its tokens? No. The tokenizer runs in your browser; nothing leaves the page.

Conclusion

Providers charge by token for the same reason a builder charges by the brick rather than by the wall: it is the unit the work is actually made of. Once you know that a word can hide one token or several, per-token pricing stops looking arbitrary and starts looking like the only fair option. The practical habit is simple. Before a long paste, a big document or a production prompt goes anywhere near a model, run it through the Token Counter and plan with the number the model itself will see. If you want to push the same prompt in the opposite direction and deliberately loosen a model's reading of it, the companion guide on using Midjourney chaos and weird parameters on purpose covers the image side of that idea. For every other text job, start from the full list in the AI and Prompt Tools guides.