PromptCostLab guides
Token basics

What are tokens in AI?

Tokens are the pieces of text an AI model reads and produces — and the unit every context limit and API bill is written in. Understanding them makes LLM pricing and limits suddenly legible.

The definition, in one sentence

A token is a chunk of text — often a whole common word, sometimes a word fragment, symbol, or piece of punctuation — that a language model processes as a single unit. Models never see letters or words directly; a tokenizer first converts your text into a sequence of token IDs, and everything downstream (context limits, pricing, usage meters) is counted in those tokens.

For ordinary English, one token is about 0.75 words, or roughly 4 characters including spaces. That single ratio converts between the units you know (words, pages) and the units providers bill in (tokens).

What a token looks like in practice

Common short words compress to a single token: the, and, is, cat. Longer or rarer words split into pieces: tokenization might become token + iz + ation. Numbers, URLs, code identifiers, and emoji shatter into many tokens. A sentence like "The cat sat on the mat." is about 8 tokens — almost one per word plus punctuation.

This is why the same text costs different amounts on different models: each model family trained its own tokenizer vocabulary, tuned to its own data. GPT's o200k tokenizer, Claude's tokenizer, and Gemini's all split the same sentence slightly differently — and Anthropic's 2026 tokenizer refresh made identical text cost roughly 30% more tokens than its predecessor.

Where tokens appear in an AI request

Input tokens include everything sent to the model: system instructions, user messages, conversation history, retrieved documents, and sometimes tool definitions or file content. Output tokens are generated by the model and billed at a higher rate — typically 3–6x input. Cached input tokens are repeated prefixes served from a provider's cache at a steep discount.

  • Input: instructions, questions, context, and history — the cheapest tier.
  • Output: the model's answer — the expensive tier.
  • Cached input: reused prompt prefixes, often 10% of the input price.
  • Hidden overhead: chat roles, tool schemas, and SDK formatting add tokens you never see.

Why token count matters

Tokens determine whether a request fits in a model's context window and what the request costs. A short user message can still become a large request if the application attaches a long system prompt, many documents, or an entire conversation — every turn of which is re-sent as input on the next request.

At scale, small token decisions compound. Cutting 20% of prompt tokens on a workload spending $2,000 a month saves $400 — before counting the output you avoid generating. Conversely, ignoring cache pricing or long-context tiers can quietly double a bill.

How many words is a token? (and other conversions)

The planning ratios: 1 token ≈ 0.75 words ≈ 4 characters; 1 word ≈ 1.3 tokens; 100 tokens ≈ 75 words; 1,000 tokens ≈ 750 words, or 1.5–2 pages. A 128K context window holds roughly a 300-page novel; 1M tokens holds about ten.

Use ranges, not single numbers: casual English runs near 0.85 words per token, dense technical prose nearer 0.65, and source code or non-Latin scripts considerably denser. The tokens-to-words converter applies these honestly, and the quick-answer pages cover common counts like 600, 4,096, and 128K tokens.

A useful planning workflow

Count the stable prompt first — the prompt calculator runs a real BPE tokenizer in your browser, so the count is exact for OpenAI models and a labeled approximation elsewhere. Add typical conversation and retrieval context. Set the expected response length and reserve that space. Multiply the estimated request cost by realistic traffic, then repeat with a worst-case request.

Finally, calibrate: providers return exact usage counts with every response. Log them for a week and compare against your estimates — that feedback loop turns token planning from guesswork into engineering.

Frequently asked questions

What is a token in AI, exactly?

A token is a piece of text — usually a common word or word fragment — that an AI model reads or generates as one unit. A tokenizer converts your text into tokens before the model processes it, and providers charge per token for input and output separately.

What are tokens in simple terms?

Think of tokens as LEGO bricks of text. Frequent words are single bricks; rare words, numbers, and code are several small bricks stuck together. A model reads bricks, not letters — and its bill counts bricks.

How many words is one token?

About 0.75 English words per token, so one word costs roughly 1.3 tokens. 1,000 tokens is approximately 750 words of ordinary English prose.

What are input tokens vs output tokens?

Input tokens are everything in the request you send — system prompt, messages, history, documents, and tool definitions. Output tokens are what the model generates in reply, billed at a higher per-token rate.

Do all AI models use the same tokens?

No. Each model family has its own tokenizer vocabulary, so the same text produces different token counts on GPT, Claude, Gemini, Grok, and Kimi. OpenAI's tokenizers are public; other providers expose counting endpoints instead.

Measure a real prompt.Use PromptCostLab to count tokens with a real tokenizer, check context pressure, and estimate API cost privately.Open the prompt calculator →