What are tokens in AI? They are the pieces of text a language model reads and writes. A token can be a whole word, part of a word, a space plus a word, or a punctuation mark. The model never sees your sentence as letters or words. It sees a sequence of tokens, and every limit and meter on an AI tool is counted in them.

Picture pasting a 5,000-word report into a chat tool and asking for a summary. The tool does not ask how many words you pasted. It asks how many tokens that text takes, how many more the instructions take, and whether the answer still fits. The rest of this page works through that arithmetic.

What a token is

OpenAI’s help article on what tokens are and how to count them gives the usual rules of thumb for English text: one token is about four characters, about three-quarters of a word, and 100 tokens are about 75 words. The same article calls these estimates, not exact counts, and says a token count is not a word count.

The tokenizer, the component that cuts text into pieces, decides where the cuts fall. The open-source tiktoken library describes byte pair encoding (BPE), the method behind several OpenAI tokenizers, as reversible and lossless: it works on arbitrary text, and the original text can always be rebuilt from the tokens. Its documentation says each token corresponds to about four bytes on average. Common words tend to be one piece. Rare words, names, code and unusual spellings break into more pieces.

Small differences matter. OpenAI’s article notes that “red”, “Red” and " red" with a leading space are not identical text, so they are not the same token. It also warns against assuming that an example token ID applies to every model.

What the rule of thumb gives you

The table below applies the published English ratios to a few sizes. It is arithmetic on an estimate, so treat each row as a ballpark.

Tokens Words (x 0.75) Characters (x 4)
1,000 about 750 about 4,000
8,000 about 6,000 about 32,000
32,000 about 24,000 about 128,000

Going the other way, divide words by 0.75. The 5,000-word report from the opening is about 6,700 tokens.

A worked budget

Suppose a tool has an 8,000-token limit for one request, counting what you send and what it writes back. That limit is the model’s context window, which our explainer on context windows covers. The figures below are invented to show the sum, not measured from any product.

  • Instructions and tool definitions: 1,200 tokens
  • The report: about 6,700 tokens
  • Total before the model writes anything: about 7,900 tokens
  • Left for the answer: about 100 tokens, roughly 75 words

The summary would be cut off or refused even though the report “fits”. The fix is a shorter input, a larger window, or a smaller instruction block, and you can only see that by counting in tokens.

Why the same text counts differently

Each model family ships its own tokenizer, so one text can have several token counts. Anthropic’s token counting documentation states that Claude 4.7 and later models use a newer tokenizer, and that the same input text produces approximately 30 percent more tokens than on earlier models. The page advises recounting prompts against the model you plan to use. Applied to the report above, 6,700 tokens would become roughly 8,700, which no longer fits an 8,000-token window.

Language matters too. The rules of thumb above are for English. Do not carry them over to other languages or to source code without measuring.

How to count before you send

For plain text, OpenAI points to its Tokenizer page for a visual check and to tiktoken for code, choosing the encoding for your model. A local count of plain text has limits, though. OpenAI’s token counting guide says its input-token endpoint accepts the same payload as a normal request, including text, messages, images, files, tools and conversations. It also says the count includes formatting tokens that mark things like message roles and boundaries, and that tools such as tiktoken do not handle images and files or count tool and schema overhead well.

Anthropic’s counting endpoint likewise accepts system prompts, tools, images and PDFs, and returns the total across messages, system prompt and tools. Anthropic describes the result as an estimate that can differ by a small amount from the tokens used when the message is created, and says the counting call is free, within rate limits. It also says tokens added automatically for system optimizations are not billed.

Counts after a request come from the service itself. OpenAI notes that Chat Completions reports prompt, completion and total tokens, and Responses reports input, output and total tokens. An input count does not predict how many tokens the model will write, and output usage can include tokens you never see in the reply, so leave headroom when you cap output length.

What tokens do not tell you

A token count measures size, not quality. A long prompt is not a better prompt, and a short answer is not a weaker one. Tokens are also separate from the choice the model makes at each step: how it picks the next token is covered in our piece on AI temperature, and how tokens become searchable meaning is covered in embeddings explained.