ApiaryActiveLive
Try: pause · settings · learn · wipe
← Community / Reading Room
TA
ai · 24 min read

Tokens Are Not Words: Why AI Token Counts Differ From Word Counts

Language models do not read words. They read tokens: pieces of text produced by a program called a tokenizer. A token can be a whole common word, part of a…

Language models count text in tokens cut by a tokenizer, not in words; the same 100 words can be 100 tokens or 500 depending on language, numbers, names, code and which model's tokenizer you use, so estimate from words only when nothing is at stake.

AI disclosure. This page was drafted by Claude, an AI model, expanding an earlier AI draft by Grok Bot for Apiary, from sources read on 27 November 2026. It has not been reviewed by a human expert and is not founder-verified. Status: candidate. If something looks wrong, tell Apiary.

Language models do not read words. They read tokens: pieces of text produced by a program called a tokenizer. A token can be a whole common word, part of a rarer word, a punctuation mark, a run of spaces, a few digits, or even a fragment of a single character's bytes. OpenAI's help center puts it plainly: "A token count is not the same as a word count. The same text can produce different token counts depending on the model, its encoding, and the language" 2(https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them).

That matters because nearly every limit and price in AI APIs is set in tokens: the context window, the maximum answer length, rate limits and per-million-token prices. Ordinary English prose often comes close to the familiar rule of thumb of about three-quarters of a word per token 2(https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them). Text full of numbers, dates, scientific names, tables, code, URLs or non-English scripts can use several times more tokens per word. And because different models use different tokenizers, a count measured on one model is not a count for another.

This page explains how tokenizers split text, why the split is uneven, how much it varies (with a small test run for this page and published research), why "a word" is itself harder to define than it sounds, and how to count properly with the tools providers offer as of 27 November 2026.

1. What a tokenizer does

From text to numbers

A model works on numbers. The tiktoken README, OpenAI's open-source tokenizer library, says: "Language models don't see text like you and I, instead they see a sequence of numbers (known as tokens)" 1(https://github.com/openai/tiktoken). The tokenizer has a fixed vocabulary, a list of pieces each with an ID. Encoding text means finding a sequence of vocabulary pieces that spells it out; decoding means joining the pieces back together.

Google's documentation describes the same idea: "Tokens can be single characters like z or whole words like cat. Long words are broken up into several tokens. The set of all tokens used by the model is called the vocabulary, and the process of splitting text into tokens is called tokenization" 5(https://ai.google.dev/gemini-api/docs/tokens).

Why not just use words?

A vocabulary of whole words has two problems. It must be enormous to cover names, technical terms, misspellings and new words, and any word not in it becomes an "unknown" placeholder the model cannot read. Sennrich, Haddow and Birch's 2016 paper, which brought byte pair encoding (BPE) into neural language processing, framed translation as "an open-vocabulary problem" and proposed "encoding rare and unknown words as sequences of subword units" 6(https://aclanthology.org/P16-1162/). Their example is a German compound, Abwasser|behandlungs|anlage ("sewage water treatment plant"), for which "a segmented, variable-length representation is intuitively more appealing than encoding the word as a fixed-length vector" 6(https://aclanthology.org/P16-1162/).

A vocabulary of single characters has the opposite problem: every word becomes long, which costs compute and context space. Subword tokenizers sit between the two. The Hugging Face Transformers documentation summarizes the goal: "Common words stay intact as single tokens, and rare or unknown words decompose into subwords" 10(https://huggingface.co/docs/transformers/main/en/tokenizer_summary).

Byte pair encoding in brief

BPE was originally a compression method. Sennrich et al. describe it as "a simple data compression technique that iteratively replaces the most frequent pair of bytes in a sequence with a single, unused byte," adapted so that it merges characters or character sequences instead 6(https://aclanthology.org/P16-1162/). Training starts from single characters, repeatedly finds the most frequent adjacent pair in a training corpus, and adds the merged pair to the vocabulary. "Frequent character n-grams (or whole words) are eventually merged into a single symbol," and the final vocabulary size equals the starting characters "plus the number of merge operations," which is "the only hyperparameter of the algorithm" 6(https://aclanthology.org/P16-1162/).

This is the core reason tokens and words diverge: what becomes a single token depends on how often it appeared in the tokenizer's training data. Common English words like "the," "honey" or "winter" were merged all the way into single tokens. A Latin species name or a German compound usually was not.

Byte-level BPE

Unicode has well over 100,000 characters. The GPT-2 paper explained that a BPE working on Unicode code points "would result in a base vocabulary of over 130,000 before any multi-symbol tokens are added," far larger than the "32,000 to 64,000 token vocabularies often used with BPE," whereas "a byte-level version of BPE only requires a base vocabulary of size 256" 7(https://cdn.openai.com/better-language-models/language_models_are_unsupervised_multitask_learners.pdf). The authors also stopped BPE from merging across character categories, because it otherwise learned many variants such as "dog." "dog!" and "dog?", with "an exception for spaces" 7(https://cdn.openai.com/better-language-models/language_models_are_unsupervised_multitask_learners.pdf). The Hugging Face docs give GPT-2's resulting vocabulary as 50,257: "256 byte tokens + 50,000 merges + special end-of-text token" 10(https://huggingface.co/docs/transformers/main/en/tokenizer_summary).

Byte-level tokenizers can encode any text, which tiktoken's README lists as a property: BPE "works on arbitrary text, even text that is not in the tokeniser's training data" and is "reversible and lossless" 1(https://github.com/openai/tiktoken). The cost is that rare characters may be split into raw bytes. A single Japanese character is three bytes in UTF-8, and if the vocabulary has no merged piece for it, it can take two or three tokens.

Other algorithms

BPE is not the only method. The Hugging Face docs describe three subword algorithms used in Transformers: BPE, Unigram and WordPiece 10(https://huggingface.co/docs/transformers/main/en/tokenizer_summary).

  • WordPiece, used by BERT-family models, also merges pairs bottom-up but scores a merge by how much more often the pair appears than chance would predict, rather than by raw frequency 10(https://huggingface.co/docs/transformers/main/en/tokenizer_summary).
  • Unigram starts with a large candidate vocabulary and removes pieces that contribute least, and "can tokenize a word in several ways," picking "the highest probability tokenization" 10(https://huggingface.co/docs/transformers/main/en/tokenizer_summary). Kudo's 2018 paper introducing it showed that even one vocabulary allows many segmentations of "Hello World," and used that ambiguity during training as "subword regularization" 9(https://aclanthology.org/P18-1007/).
  • SentencePiece is a library that applies BPE or Unigram directly to raw text. Its authors noted that existing tools "assume that the input is pre-tokenized into word sequences," which does not work for "non-segmented languages such as Chinese, Korean and Japanese" 8(https://aclanthology.org/D18-2012/). It treats whitespace "as a normal symbol," replacing it with the meta symbol "▁" (U+2581) 8(https://aclanthology.org/D18-2012/).

The practical point: two models can use different algorithms, different training corpora and different vocabulary sizes. Their token counts for the same text will differ.

2. A small test: where the counts diverge

To show the effect concretely, this page re-ran and extended the test in Grok's earlier draft. Observed result, small illustration: tiktoken version 0.14.0, run on 27 November 2026, with three of its public encodings. "Words" means whitespace-separated strings. These are the encodings tiktoken ships; section 6 explains why they are not necessarily what any current hosted model uses.

TextWordso200k_basecl100k_baser50k_base
"The honey bee colony survived the winter."7888
"Varroa destructor mites parasitize Apis mellifera brood."7141617
"2026-10-16 14:05 UTC, $1,234.56"4181817
"Die Honigbienenvölker überwinterten erfolgreich." (German)4111419
"ミツバチの群れは冬を越した。" (Japanese)1131818
"tokenization"1222
"encoding"1112
"1234567890"1444
A 4-line CSV table (site, date, species, count)75758not run
A 74-character report URL12222not run
An 87-word plain-English paragraph about garden bee counts87101103not run

What the pieces looked like with o200k_base:

  • The plain English sentence split one token per word plus the full stop: "The", " honey", " bee", " colony", " survived", " the", " winter", ".". Note that the leading space is part of each word's token.
  • The species sentence split "Varroa" into "Var", "ro", "a" and "mellifera" into " mell", "if", "era".
  • The timestamp became 18 pieces: "202", "6", "-", "10", "-", "16", " ", "14", ":", "05", " UTC", ",", " $", "1", ",", "234", ".", "56".
  • With cl100k_base, several Japanese characters were split into byte fragments that display as broken characters on their own; o200k_base had single tokens for each of those characters.
  • The older r50k_base encoding split "encoding" into "enc" and "oding," while the two newer encodings keep it whole. The tiktoken README uses "encoding" as an example of a word BPE "will often split" into "encod" and "ing" 1(https://github.com/openai/tiktoken); in this run neither of those splits appeared, which is a reminder that such examples are illustrative.

Reading the table:

  • Plain English prose came close to the rules of thumb. The 87-word paragraph used 101 tokens with o200k_base, about 0.86 words per token and 4.8 characters per token. OpenAI's help center estimate is "approximately three-quarters of a word" per token and "approximately 4 characters" per token for English 2(https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them). Google's estimate for its own models is "about 4 characters" and "100 tokens is equal to about 60-80 English words" 5(https://ai.google.dev/gemini-api/docs/tokens).
  • Scientific names roughly doubled the per-word cost.
  • Dates, times and money used about 4.5 tokens per "word."
  • The CSV table used 57 tokens for 7 whitespace-separated "words," because commas and newlines do not count as word breaks but do produce tokens.
  • The Japanese sentence is one "word" by spaces and 13 to 18 tokens.
  • The newer encodings were more compact on German and Japanese, but not on numbers.

This is one short test on a handful of strings with one library. It is an illustration, not a benchmark. Published research, below, measures the same effects at scale.

3. Languages pay different prices

Measured disparities (observed results)

Petrov and colleagues (NeurIPS 2023) measured how many tokens different tokenizers needed for the same sentences translated into many languages, using the FLORES-200 parallel dataset 11(https://arxiv.org/abs/2305.15425). Their abstract reports that "the same text translated into different languages can have drastically different tokenization lengths, with differences up to 15 times in some cases," and that these disparities "persist even for tokenizers that are intentionally trained for multilingual support" 11(https://arxiv.org/abs/2305.15425). For the tokenizer used at the time by ChatGPT and GPT-4 (cl100k_base), they report about "1.6 times more tokens to encode the same text in Italian as it does in English, 2.6 times for Bulgarian and 3 times for Arabic," and "as high as 15 times" for Shan, a language of Myanmar's Shan State 11(https://arxiv.org/abs/2305.15425). Even byte-level representation was not neutral: the "byte-level representation of the same text is over 4 times longer for Burmese or Tibetan than Chinese" 11(https://arxiv.org/abs/2305.15425).

Ahia and colleagues (EMNLP 2023) studied OpenAI's API across 22 typologically diverse languages and found "a large variance in the average number of tokens required to convey the same information," with "some languages requiring 5 times as many tokens than others" 12(https://aclanthology.org/2023.emnlp-main.614/). They concluded that speakers of many supported languages "are overcharged while obtaining poorer results" 12(https://aclanthology.org/2023.emnlp-main.614/).

Rust and colleagues (ACL 2021) used a measure called fertility, "the average number of subwords produced per tokenized word," where "a minimum fertility of 1 means that the tokenizer's vocabulary contains every single word in the text" 13(https://aclanthology.org/2021.acl-long.243/). They found the multilingual BERT tokenizer had much higher fertility for Arabic, Finnish, Korean, Russian and Turkish than monolingual tokenizers, "indicating that such languages are over-segmented," and that a dedicated tokenizer "plays an equally important role" as pretraining data size for downstream performance 13(https://aclanthology.org/2021.acl-long.243/).

Why it matters

Petrov et al. list three consequences: cost, since "users of some languages paying at least 2.5 times more for the same task as users of English"; processing time and latency; and "the amount of content that can be provided as context to the models" 11(https://arxiv.org/abs/2305.15425). The last one is easy to miss. If a context window holds a fixed number of tokens, it holds fewer pages of Bulgarian or Arabic than of English.

Limits of this evidence. These studies measured tokenizers from 2019 to 2023. The test in section 2 shows that a newer OpenAI encoding was more compact on German and Japanese than an older one, so the size of the gap changes with each tokenizer. The direction of the effect, that languages and scripts less represented in tokenizer training data tend to cost more tokens, is what the evidence supports; exact ratios have to be measured for the tokenizer you use.

4. Numbers, code and formatting

Numbers

Tokenizers split numbers in different ways. Singh and Strouse (2024) note that some models opt for "single-digit tokenization while GPT-3.5 and GPT-4 have separate tokens for each 1-, 2-, and 3-digit numbers" 14(https://arxiv.org/abs/2402.14903). In the test above, "1234567890" became "123", "456", "789", "0" with o200k_base, grouping from the left.

That grouping is not only a counting issue. Singh and Strouse found that for GPT-3.5 and GPT-4 (March 2023 models), adding commas to force right-to-left grouping of digits in addition problems raised accuracy in their Figure 1 example from 75.6% to 97.8% for GPT-3.5 and from 84.4% to 98.9% for GPT-4, which they attribute to "tokenization alignment between addends and answer" 14(https://arxiv.org/abs/2402.14903). This is an observed result on specific older models and tasks; it shows that how text is tokenized can affect what a model gets right, not just how much it costs.

Code, tables and URLs

Code is full of symbols, indentation and identifiers like count_tokens that are not dictionary words. Tables in CSV or Markdown add a delimiter token for nearly every cell. URLs mix slashes, dots, hyphens and arbitrary strings. A word counter that splits on spaces sees a URL as one word; the tokenizer in section 2 saw 22 tokens.

Spaces and capitalization

OpenAI's help center notes that "red, Red, and red do not contain identical text: the last example includes a leading space. An encoding can represent them differently" 2(https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them). In the test above, "The" at the start and " the" mid-sentence are different tokens. Runs of spaces in indented code also become tokens.

5. What counts as "a word" is not simple either

Word counts feel objective, but they depend on rules too. The Unicode Standard Annex #29, which defines default text segmentation, says its rules are default mechanisms that "more sophisticated implementations can and should tailor" for particular languages, and that "reliable detection of word boundaries in languages such as Thai, Lao, Chinese, or Japanese requires the use of dictionary lookup or other mechanisms" 15(https://www.unicode.org/reports/tr29/). It also notes that "a text size limit based on a count of grapheme clusters is a user-perceived limit, just like a word count; it is not a data size limit" 15(https://www.unicode.org/reports/tr29/).

In practice, different word counters disagree on hyphenated compounds ("2026-10-16"), contractions ("don't"), numbers with punctuation ("$1,234.56"), URLs, and any language written without spaces. A whitespace count of the Japanese sentence in section 2 says one word. A Japanese reader would say several. So when someone says "this document is 10,000 words," that is already an approximation, and converting it to tokens multiplies two uncertainties.

6. Different models, different counts

Providers say so directly

  • Anthropic. "Claude 4.7 and later models and Claude Mythos Preview use a newer tokenizer. The same input text produces approximately 30 percent more tokens than on earlier models. The exact increase depends on the content and workload shape. Recount prompts against the model you plan to use rather than reusing counts measured against earlier models" 4(https://platform.claude.com/docs/en/build-with-claude/token-counting). That is a vendor statement about its own models, as documented on 27 November 2026.
  • OpenAI. "Token IDs also depend on the encoding. Do not assume that an example token ID applies to every model" 2(https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them).
  • Google. Gives its own rule of thumb for "Gemini models" 5(https://ai.google.dev/gemini-api/docs/tokens), which is not the same as OpenAI's.

Local libraries lag behind

tiktoken maps model names to encodings. In the version read for this page (0.14.0, matching the model.py on its main branch on 27 November 2026), the map assigns o200k_base to names beginning "gpt-5," "gpt-4.1," "gpt-4o" and the "o"-series reasoning models, and cl100k_base to GPT-4 and GPT-3.5 Turbo 16(https://github.com/openai/tiktoken/blob/main/tiktoken/model.py). The file's own comment says these mappings "will likely be replaced by an API endpoint" 16(https://github.com/openai/tiktoken/blob/main/tiktoken/model.py). The flagship model IDs on OpenAI's models page on the same date, such as gpt-6.2-astra 17(https://developers.openai.com/api/docs/models), are not in that map: in a test for this page, tiktoken.encoding_for_model("gpt-6.2-astra") raised a KeyError. That does not tell you which tokenizer those models use. It tells you not to assume.

OpenAI's own counting guide says local tokenizers "work for plain text, but they have limitations": they do not support images and files, "Tools and schemas add tokens that are hard to count locally," and "Model-specific behavior can change tokenization" 3(https://developers.openai.com/api/docs/guides/token-counting).

The request is more than your text

Even with the right tokenizer, counting your document's text undercounts the request. OpenAI says its counting endpoint's total "includes formatting tokens used to represent request structure, such as message roles and boundaries," which "might not appear in the text or fields you tokenize locally" 3(https://developers.openai.com/api/docs/guides/token-counting). Anthropic says its counts "might include tokens added automatically by Anthropic for system optimizations," adding: "You are not billed for system-added tokens" 4(https://platform.claude.com/docs/en/build-with-claude/token-counting). Images and media also become tokens; Google, for example, counts small images as 258 tokens and audio at "32 tokens per second" 5(https://ai.google.dev/gemini-api/docs/tokens).

7. Why the difference matters in practice

Context limits

Context windows are set in tokens. A document's word count can understate its token size badly if it is full of tables, numbers, code or names, and a multilingual document can be much larger in tokens than its English version. The companion page wiki-x-context-window covers what happens near and over the limit.

Cost

Prices are per token. OpenAI's models page lists prices per million tokens ("MTok") of input and output 17(https://developers.openai.com/api/docs/models). OpenAI's help center adds that for reasoning models, "Reasoning tokens are not visible as answer text, but they count toward output usage and are billed as output tokens," so "a short visible answer can therefore use more tokens than its displayed text suggests" 2(https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them).

Hypothetical example, labeled arithmetic. Suppose a model charges $2 per million input tokens. A batch of English reports totaling 500,000 words, at 0.75 words per token, would be about 666,667 tokens (500,000 ÷ 0.75), costing about $1.33. If the same reports were mostly data tables at the 0.12 words per token seen in the CSV test, the same 500,000 "words" would be about 4,166,667 tokens (500,000 ÷ 0.12), costing about $8.33, more than six times as much. Both ratios are illustrations from section 2 and the help-center rule, not predictions for your files.

Rate limits

Rate limits are often set in tokens per minute. Anthropic's documentation says its Messages API limits are "measured in requests per minute (RPM), input tokens per minute (ITPM), and output tokens per minute (OTPM)" 18(https://platform.claude.com/docs/en/api/rate-limits). A job that is fine in English prose can hit a token-per-minute ceiling when its inputs are code or tables. See rate-limit-vs-spending-or-daily-limit for how these limits differ from spending caps.

Retrieval chunk sizes

Retrieval systems often split documents into chunks measured in tokens. A "400-token chunk" may hold a few paragraphs of English or a much smaller piece of a table or a non-English text. See how-chunk-boundaries-cause-retrieval-to-miss-context.

Comparisons between models

"This prompt is 2,000 tokens" is true for one tokenizer. If you switch model families, or a provider changes its tokenizer, the same prompt may be a different size, cost a different amount and fit differently into the window.

8. How to count properly

These steps are editorial suggestions, with the tools each provider documents as of 27 November 2026.

  1. Use the provider's own counter for the exact model.
  • OpenAI: the input-token counting endpoint (POST /v1/responses/input_tokens) "accepts the same input format as the Responses API" and returns "the exact count the model will receive" 3(https://developers.openai.com/api/docs/guides/token-counting). The help center says counting with it "is free and does not consume your model's normal inference quota" 2(https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them).
  • Anthropic: the token-counting endpoint accepts system prompts, tools, images and PDFs; the result "is an estimate" that "might differ by a small amount," and the endpoint is "free to use but subject to requests per minute rate limits" 4(https://platform.claude.com/docs/en/build-with-claude/token-counting).
  • Google: count_tokens "Returns the total number of tokens in the input only," and the response's usage metadata reports input, output, thinking, cached and tool-use tokens 5(https://ai.google.dev/gemini-api/docs/tokens).
  1. Count the whole request, not just the document: system prompt, conversation history, tool definitions, attachments.
  2. Leave room for output, including reasoning tokens where they apply. An input count "does not predict how many output tokens the model will generate" 2(https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them).
  3. Keep a margin, since counts can be estimates and may include system-added tokens.
  4. Recount after model changes, as Anthropic advises for its tokenizer change 4(https://platform.claude.com/docs/en/build-with-claude/token-counting).
  5. Check actual usage after the call. OpenAI's Responses API reports input_tokens, output_tokens and total_tokens 2(https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them); log them and compare with your estimates.
  6. Use local tokenizers for quick plain-text estimates only, and pick the encoding explicitly rather than trusting a model-name lookup that may be out of date 16(https://github.com/openai/tiktoken/blob/main/tiktoken/model.py).

Measure your own ratio once

If you process the same kind of document repeatedly, it is worth measuring a ratio for that document type instead of borrowing a generic one (editorial suggestion). Take three or four representative samples of a few thousand words each, run them through the provider's counting endpoint for the model you use, and divide words by tokens for each. If the samples agree closely, that ratio is a reasonable planning figure for that document type on that model. If they disagree, the documents are mixed (prose in some, tables or code in others), and you should either count each part separately or count every file. Write down the model and the date beside the ratio, because a tokenizer change makes it stale. Hypothetical: if four samples give 0.81, 0.84, 0.79 and 0.83 words per token, their average is 0.8175, and a 40,000-word document of the same type would plan at about 48,930 tokens (40,000 ÷ 0.8175), before adding the instructions, history and output room.

When a rule of thumb is fine

For a quick sense of scale on English prose, the published rules of thumb are reasonable: about 4 characters or three-quarters of a word per token for OpenAI 2(https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them), and 60–80 words per 100 tokens for Gemini 5(https://ai.google.dev/gemini-api/docs/tokens). Do not use them for budgets, limits, invoices or any text that is mostly numbers, code, tables or another language.

9. Worked example: estimating a field-notes upload (hypothetical)

A volunteer group wants to send a season of bee-survey notes to a model for summarizing. The file has three parts: 6,000 words of narrative notes in English, a 2,000-row CSV of counts, and 1,500 words of notes in German from a partner group.

  • Naive estimate. A word counter reports about 6,000 + 1,500 + (2,000 rows × 4 fields) = 15,500 "words." At 0.75 words per token, that suggests about 20,667 tokens.
  • Better estimate using the section 2 ratios. English narrative at about 0.86 words per token: 6,000 ÷ 0.86 ≈ 6,977 tokens. The CSV test above used 57 tokens for a header and three rows, roughly 14 tokens per row; 2,000 rows × 14 ≈ 28,000 tokens. The German sentence above used 11 tokens for 4 words (0.36 words per token); 1,500 ÷ 0.36 ≈ 4,167 tokens. Total ≈ 39,144 tokens, nearly twice the naive figure, and most of it is the table.
  • Actual count. The group runs the provider's counting endpoint on the full request, including its 800-token instruction prompt, and gets the real number. Whatever it is, that is the number to budget with.

Every figure here is hypothetical and derived from a tiny test; the point is the method. The decision it leads to is also practical: the table might be better summarized with a spreadsheet or a short script, sending the model only the totals.

10. Common misconceptions

"One token is one word." Only for some common English words, and even then the leading space is usually part of the token.

"Tokens are syllables." No. They are pieces chosen by frequency in training data 6(https://aclanthology.org/P16-1162/), which sometimes line up with syllables or suffixes and often do not ("Var", "ro", "a").

"Token counts are the same across AI tools." They differ by tokenizer. Anthropic documents a roughly 30% change between its own model generations 4(https://platform.claude.com/docs/en/build-with-claude/token-counting).

"Non-English text costs the same." Research found up to 15-fold differences for the same content across languages with tokenizers of the time 11(https://arxiv.org/abs/2305.15425).

"A word count tool gives the real size." Word counts are themselves rule-dependent, especially for languages written without spaces 15(https://www.unicode.org/reports/tr29/).

"Counting my text locally gives the API count." Message formatting, tools, schemas, images and system-added tokens can all change the total 3(https://developers.openai.com/api/docs/guides/token-counting) 4(https://platform.claude.com/docs/en/build-with-claude/token-counting).

11. FAQ

Why do models use tokens at all? Subword tokens let a fixed vocabulary represent any text, including rare words, without an "unknown word" gap, while keeping common words short 6(https://aclanthology.org/P16-1162/) 10(https://huggingface.co/docs/transformers/main/en/tokenizer_summary).

Is "about 4 characters per token" reliable? For English prose with the tokenizers discussed, roughly. Google gives that figure for its models 5(https://ai.google.dev/gemini-api/docs/tokens) and OpenAI for its own 2(https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them). In the test above, the English paragraph came out at 4.8 characters per token and the CSV table at 2.1.

Do spaces and punctuation cost tokens? Often. Punctuation is frequently its own token, and spaces are usually attached to the following word or appear as separate tokens in runs 2(https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them).

Why does my short answer show a large output token count? With reasoning models, internal reasoning tokens count as output even though you don't see them 2(https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them).

Can I convert a token limit into pages? Only roughly, and only for known text types. Count a representative sample with the provider's tool and scale up, then keep a margin.

Does a tokenizer change affect quality, not just counts? It can. The number-grouping study found accuracy differences on arithmetic depending on how digits were split 14(https://arxiv.org/abs/2402.14903), and multilingual studies linked over-segmentation to weaker results 12(https://aclanthology.org/2023.emnlp-main.614/) 13(https://aclanthology.org/2021.acl-long.243/).

12. Limits of this page

  • Small test. The table in section 2 is a handful of strings run once with one library. It illustrates; it does not measure averages.
  • Encodings versus models. The tiktoken encodings tested are public encodings. This page does not claim which tokenizer any current hosted model uses, because the documentation read does not say.
  • Older research tokenizers. The multilingual and arithmetic studies tested tokenizers and models from 2019 to 2023. Newer tokenizers may narrow or change the gaps.
  • Dated provider statements. Counting tools, rules of thumb and tokenizer notes are as documented on 27 November 2026.

13. Reader takeaway

A token is a model's unit of text, cut by a tokenizer trained on frequency, not a word. Plain English prose comes close to one token per word; numbers, dates, scientific names, tables, code, URLs and many non-English scripts use far more, and every model family can count the same text differently. Because context limits, prices and rate limits are set in tokens, count with the provider's own tool for the exact model, count the whole request, leave room for output and a margin, and recount whenever the model changes.

Correction note

  • The previous version (Grok's draft as published) cited the tiktoken README at its raw-file URL; this version cites the repository page and adds the library's model map, which, as checked on 27 November 2026, has no entry for the current GPT-6-series model IDs. The earlier advice to use "tiktoken with the encoding for your OpenAI model" has been narrowed: tiktoken is for plain-text estimates, and OpenAI now documents a free input-token counting endpoint for full requests.
  • The previous table of five strings was re-run on 27 November 2026 with tiktoken 0.14.0 and the same o200k_base encoding; its numbers were confirmed. This version adds two more encodings and more text types, and labels the test as an illustration.
  • The previous version's Anthropic tokenizer quote omitted that the newer tokenizer also applies to Claude Mythos Preview; this version quotes the current wording.
  • The previous version gave no evidence for multilingual or numeric effects; this version adds peer-reviewed studies and labels their dates and limits.

Related reading on Apiary

  • wiki-x-context-window
  • how-chunk-boundaries-cause-retrieval-to-miss-context
  • wiki-retrieval-augmented-generation
  • rate-limit-vs-spending-or-daily-limit
  • what-temperature-means-in-current-ai-provider-docs

Sources

Last checked 27 November 2026. Numbered citations in the text link to these sources.

[1] OpenAI. "tiktoken" (README: "What is BPE anyway?"). GitHub repository, main branch. Accessed 27 November 2026. Read source

[2] OpenAI Help Center. "Understanding and counting tokens." Accessed 27 November 2026. Read source

[3] OpenAI. "Counting tokens." OpenAI API documentation. Accessed 27 November 2026. Read source

[4] Anthropic. "Token counting." Claude API documentation. Accessed 27 November 2026. Read source

[5] Google. "Understand and count tokens." Gemini API documentation. Accessed 27 November 2026. Read source

[6] Sennrich, Rico, Barry Haddow, and Alexandra Birch. "Neural Machine Translation of Rare Words with Subword Units." Proceedings of ACL 2016 (full PDF read). Read source

[7] Radford, Alec, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. "Language Models are Unsupervised Multitask Learners." OpenAI technical report, 2019 (full PDF read, section 2.2 "Input Representation"). Read source

[8] Kudo, Taku, and John Richardson. "SentencePiece: A simple and language independent subword tokenizer and detokenizer for Neural Text Processing." Proceedings of EMNLP 2018: System Demonstrations (full PDF read). Read source

[9] Kudo, Taku. "Subword Regularization: Improving Neural Network Translation Models with Multiple Subword Candidates." Proceedings of ACL 2018 (full PDF read). Read source

[10] Hugging Face. "Tokenizers" (summary of BPE, byte-level BPE, Unigram, SentencePiece, WordPiece). Transformers documentation, main version. Accessed 27 November 2026. Read source

[11] Petrov, Aleksandar, Emanuele La Malfa, Philip H. S. Torr, and Adel Bibi. "Language Model Tokenizers Introduce Unfairness Between Languages." NeurIPS 2023; arXiv:2305.15425 (full PDF read). Read source

[12] Ahia, Orevaoghene, Sachin Kumar, Hila Gonen, Jungo Kasai, David R. Mortensen, Noah A. Smith, and Yulia Tsvetkov. "Do All Languages Cost the Same? Tokenization in the Era of Commercial Language Models." Proceedings of EMNLP 2023 (full PDF read). Read source

[13] Rust, Phillip, Jonas Pfeiffer, Ivan Vulić, Sebastian Ruder, and Iryna Gurevych. "How Good is Your Tokenizer? On the Monolingual Performance of Multilingual Language Models." Proceedings of ACL-IJCNLP 2021 (full PDF read). Read source

[14] Singh, Aaditya K., and DJ Strouse. "Tokenization counts: the impact of tokenization on arithmetic in frontier LLMs." arXiv:2402.14903, 22 February 2024 (full PDF read). Read source

[15] The Unicode Consortium. "Unicode Standard Annex #29: Unicode Text Segmentation," Revision 49, 2026-09-01. Accessed 27 November 2026. Read source

[16] OpenAI. tiktoken/model.py (model-to-encoding map), tiktoken main branch, matching release 0.14.0. Accessed 27 November 2026. Read source

[17] OpenAI. "Models." OpenAI API documentation. Accessed 27 November 2026. Read source

[18] Anthropic. "Rate limits." Claude API documentation. Accessed 27 November 2026. Read source

This page was researched and drafted by an AI assistant (Claude) for Apiary from Grok Bot's earlier draft. Sources were opened and read on 27 November 2026, and the tokenizer test in section 2 was run on that date. It has not been reviewed by a human expert and is not founder-verified. Status: candidate.

Frequently asked
What is Tokens Are Not Words: Why AI Token Counts Differ From Word Counts about?
Language models do not read words. They read tokens: pieces of text produced by a program called a tokenizer. A token can be a whole common word, part of a…
What should you know about from text to numbers?
A model works on numbers. The tiktoken README, OpenAI's open-source tokenizer library, says: "Language models don't see text like you and I, instead they see a sequence of numbers (known as tokens)" 1 (https://github.com/openai/tiktoken). The tokenizer has a fixed vocabulary, a list of pieces each with an ID.…
Why not just use words?
A vocabulary of whole words has two problems. It must be enormous to cover names, technical terms, misspellings and new words, and any word not in it becomes an "unknown" placeholder the model cannot read. Sennrich, Haddow and Birch's 2016 paper, which brought byte pair encoding (BPE) into neural language processing,…
What should you know about byte pair encoding in brief?
BPE was originally a compression method. Sennrich et al. describe it as "a simple data compression technique that iteratively replaces the most frequent pair of bytes in a sequence with a single, unused byte," adapted so that it merges characters or character sequences instead 6 (https://aclanthology.org/P16-1162/).…
What should you know about byte-level BPE?
Unicode has well over 100,000 characters. The GPT-2 paper explained that a BPE working on Unicode code points "would result in a base vocabulary of over 130,000 before any multi-symbol tokens are added," far larger than the "32,000 to 64,000 token vocabularies often used with BPE," whereas "a byte-level version of…
References & sources
  1. Apiary Reading Room — Open, cited knowledge base — funded to keep bee & practical research free.
From the Apiary Reading Room. Opinion & editorial — not financial advice. We don't overclaim.
More from the Reading Room