Skip to content
AI Dev Toolkit.
Esc
  • AI Token CounterCount tokens for GPT, Claude, Gemini, DeepSeek, Qwen and more.Tool
  • LLM API Cost CalculatorEstimate per-request, daily and monthly API costs.Tool
  • AI Model ComparisonCompare prices, context windows and features across models.Tool
  • AI Model Pricing PagesSpecs, real costs and cheaper alternatives for popular models.Tool
  • Context Window CheckerSee whether your text fits each model’s context window.Tool
  • Subscription vs API CalculatorFind out whether a chat plan or the API is cheaper for you.Tool
  • GPU / VRAM CalculatorCheck how much VRAM a local model needs and which GPUs fit.Tool
  • Prompt Caching CalculatorEstimate savings from prompt caching.Tool

AI glossary · Tokens and cost

What does token mean in AI?

Also called: LLM token, AI token

Definition

A token in AI is the unit of text a language model reads and writes, usually a whole word, part of a word or a punctuation mark, which the model sees only as a number from its vocabulary.

Explained

How it works

Before a model sees your prompt, a tokenizer cuts the text into pieces from a fixed vocabulary and swaps each piece for its ID number. The model then predicts one new token at a time, and the tokenizer turns the IDs back into text. The token is the piece; the ID is what the model actually processes.

Common words get a token of their own, usually with the space before them included. Rare words, names and code are built from several pieces, and punctuation is usually separate. Anthropic puts a token at about 3.5 English characters on earlier Claude models, and OpenAI’s tiktoken notes about 4 bytes per token on average.

Tokens are the unit of everything you pay for and every limit you hit: API prices are per million tokens, and a model’s context window and output limit are counted in tokens. Each model family has its own tokenizer, so the same text gives a different count on Claude, GPT and Gemini.

Example

A 7-word sentence, 11 tokens

OpenAI’s o200k_base tokenizer, used by GPT-4o and the GPT-5 models, splits the sentence below into 11 tokens. “Chatbots” becomes two pieces, “don’t” splits into “␣don” and “’t”, and the semicolon and full stop are tokens of their own.

Count your own text with the token counter, which shows the split for several models side by side. For why other languages, numbers and code cost more tokens, read what is a token in AI.

“Chatbots don’t read words; they read tokens.” in o200k_base
Result
PiecesChat bots ␣don ’t ␣read ␣words ; ␣they ␣read ␣tokens .
Token IDs14065 91601 1700 1573 1729 6391 26 1023 1729 20290 13
Words7
Tokens11

␣ marks a space that belongs to the token. Measured with gpt-tokenizer 4.0 (o200k_base) on 2026-10-11.

Cost and quality

Why it matters

Every cost and limit is counted in tokens, so a word count is only an estimate. Code, JSON and many languages other than English use more tokens per word than English prose, and output tokens usually cost several times as much as input tokens.

The count also depends on the model. Anthropic says Claude 4.7 and later models use a newer tokenizer that produces about 30% more tokens for the same text than earlier Claude models, so recount when you switch.

Don’t mix up

Common confusions

Tokens vs words
A token is not a word. In the example, 7 words became 11 tokens. In English prose a token averages roughly three quarters of a word, but code, numbers and other languages are denser.
AI tokens vs access tokens and crypto tokens
An access token (for example from OAuth) is a credential that proves who you are, and a crypto token is a digital asset. When an AI price says “per million tokens”, it means pieces of text.

Go deeper

Try it and read more

Related

All 40 terms in the AI glossary

Written by Tahir Nazir. Checked .

How this was checked: Token split and IDs measured with gpt-tokenizer 4.0 (o200k_base) on 2026-10-11 and re-checked by a unit test. Characters-per-token figures and the newer Claude tokenizer checked against Anthropic’s glossary and the tiktoken README on 2026-10-11.