DeepSmith

Nov 26 · Content Production

10 min read

What Is a Token in an LLM?

Avinash Saurabh
Avinash Saurabh · CO-Founder & CEO
Abstract monochrome illustration of a row of small outlined blocks of different widths linked by thin lines, representing text split into tokens, behind the cover line LLM Tokens, Explained.

A token in an LLM is a small unit of text, like a whole word, part of a word, or a punctuation mark, that the model reads as a number. Models don't see your sentences the way you do. They see a list of token IDs, and everything they do, from reading your brief to writing a draft, happens in tokens. This guide to the token in an LLM, explained plainly, will let you estimate how much text fits in a given number of tokens.

What is a token in an LLM?

A token is a piece of text that a tokenizer has turned into a numerical ID. The token in an LLM, meaning the thing the model actually works with, can be:

  • A whole word.
  • Part of a word.
  • A punctuation mark.
  • A space joined to the text next to it.

The first thing to let go of is the idea that a token is a word. It isn't a fixed number of characters or a syllable either. It's whatever piece the tokenizer's vocabulary has an entry for, which is the core of the token meaning in an LLM.

Two terms come up a lot. The tokenizer is the part that splits text into tokens and maps them to IDs, and the vocabulary is the full set of tokens it can produce.

If you're newer to the model side of things, our explainer on what a large language model is covers the bigger picture around all this.

How does text become tokens?

The tokenizer takes your exact text, splits it into pieces using rules and a vocabulary it learned earlier, and then looks up the ID for each piece. The model works on those IDs. When it writes, it produces one token at a time, adds it to the sequence, and uses the longer sequence to pick the next one, as Microsoft's documentation on tokens describes it.

Why not just use whole words? Because a vocabulary with every possible word would be huge, and it still wouldn't handle new or rare words. Splitting into smaller pieces means common words can stay in one piece while an unusual word gets built from a few smaller ones. The Hugging Face notes on tokenization algorithms give Turkish, with its long compound words, as an example.

One common method is byte-pair encoding, or BPE. While the tokenizer is being built, it starts with a base set of symbols and keeps merging the pairs that show up together most often, until the vocabulary reaches the size it was set to. After that the rules are fixed. When you send a prompt, the tokenizer just applies them. It doesn't learn a new vocabulary for your text.

What the splits look like

Published tokenizer examples show this better than a description can. Each example below is tied to a named encoding, because different encodings split the same text differently. These come from published examples, not from tests we ran.

Take the sentence tiktoken is great! under the cl100k_base encoding. It splits like this:

["t", "ik", "token", " is", " great", "!"]

That's 6 tokens for 3 words. The word tiktoken took three tokens, the spaces rode along with the words after them, and the exclamation mark got its own token.

Now one long word, antidisestablishmentarianism, under three encodings from the OpenAI Cookbook:

EncodingToken piecesCount
r50k_baseant, idis, establishment, arian, ism5
cl100k_baseant, idis, establish, ment, arian, ism6
o200k_baseant, idis, est, ablishment, arian, ism6

The same word came out as 5 tokens in one encoding and 6 in the others. The last two both give 6 but cut the word in different places, so there isn't one tokenization that applies to every model.

Spaces confuse people too. The text 2 + 2 = 4 is 7 tokens under cl100k_base and o200k_base, because some spaces attach to the next piece and some stand alone.

How many words is 1,000 tokens?

For ordinary English, about 750 words. OpenAI gives a few rules of thumb for common English text: one token is roughly four characters, roughly three-quarters of a word, and 100 tokens is about 75 words. These are planning estimates, not guarantees.

You can turn that into two quick formulas:

Estimated tokens = English words ÷ 0.75
Estimated words = tokens × 0.75

Here's what that looks like in a table. These are arithmetic from the rule of thumb, not measured limits for any particular model.

TokensApproximate English wordsApproximate characters
10075400
1,0007504,000
2,0001,5008,000
4,0003,00016,000
10,0007,50040,000

So a 1,500-word brief is roughly 2,000 tokens of text, and a 3,000-word article is roughly 4,000. A 4,000-token allowance fits about 3,000 words of plain English prose, but it doesn't promise you a 3,000-word document.

The shortcut gets shaky with non-English text, code, data tables, or unusual product terms. There isn't a safe ratio for those, so count the real text instead.

Why do token counts affect cost and limits?

Most AI services that charge by usage meter in tokens, and they usually count what you send and what the model writes separately. Input tokens are everything in the request. Output tokens are what the model generates. The two can have different rates, and some services price cached input as a third category. This applies to token-based API pricing, not every chat subscription.

When rates are quoted per million tokens, the cost looks like this:

Token cost = (input tokens × input rate ÷ 1,000,000)
           + (output tokens × output rate ÷ 1,000,000)

Say you ask for 30 articles, and each request carries 1,500 words of source material and asks for 3,000 words back. That's a made-up planning example, not something anyone measured. Using the English rule of thumb:

Per articleAcross 30 articles
Input text tokens2,00060,000
Visible output tokens4,000120,000
Combined6,000180,000

That leaves out your instructions, formatting and any hidden generation, so a real number would be higher. The material you feed in counts alongside the article you get back, so planning from the finished word count alone misses half the picture.

Limits work the same way. A cap on output tokens is a ceiling on how much the model may generate. It's not an instruction to write that much, and it doesn't turn into an exact word count. If you want about 1,500 words, say so in the prompt and treat the cap as a safety limit. The idea of a cap on total text is closely tied to the context window, which has its own explainer.

Also, the answer you can see may be smaller than the usage you're billed for. Reported output can include tokens for message structure or tool calls, and for some reasoning models it includes reasoning tokens that never show up as text. In OpenAI's usage reports, those cached and reasoning counts are breakdowns inside the input and output totals, so adding them on top counts them twice.

How can you check a token count?

There are three levels, and each one tells you something different.

LevelGood forLimit
Words or characters, times a ratioEarly planningNot an exact count
A tokenizer for your model's encodingCounting one piece of textCan miss request overhead
A request-level counter plus returned usageCounting the whole requestExactness differs by service

For a quick look, OpenAI's online tokenizer shows how a piece of text splits and gives you the token and character counts. The important part is matching the tokenizer to the model you use, since a count from one encoding isn't a universal count.

For a full request, use the counter the service provides. OpenAI's input counter returns the count the model will receive, including the formatting tokens for roles and messages. Claude's documentation describes a token counting endpoint that covers system prompts, tools, images and PDFs, and it calls the result an estimate that can differ slightly from the usage reported afterward. So read what each counter's documentation actually promises.

When you count a real request, include everything that gets sent: your instructions, the brief, source excerpts, example outputs, earlier messages, and any tool definitions. If the number comes out higher than you expected, look at what was included before blaming the tokenizer.

What to do with this

Take one real brief you use often and count it. Then run it, and compare your count with the usage the service reports for the whole request and the answer. That comparison shows you how far off your own estimates tend to be. If you want to see why this matters for AI search, it helps to know how AI search works differently from traditional search when it builds an answer. The AEO glossary defines more of the terms you'll run into along the way. When you're ready to act on all of it, answer engine optimization is the main topic, and the guide on how AEO, GEO and SEO fit together shows where it sits.

Frequently asked questions

Is a token the same as a word?

No. A token can be a whole word, part of a word, punctuation, or another piece of text, and a single word can take several tokens.

How many words are 1,000 tokens?

Roughly 750 words of common English text. The exact amount depends on the text and the tokenizer, so use it for planning, not as a guaranteed capacity.

Why do token counts affect AI costs?

Token-based APIs meter what goes in and what comes out. Those can have different rates, so both your source material and the response add to the cost.

How do I find the token count of my text?

Use a tokenizer that matches your model. For a full API request, use the service's request-level counter and check the usage it returns, instead of counting only the visible prose.