# Tokenization

Understand how tokenization converts text into processing units and what to check when preparing documents for a language model.

Canonical URL: https://thecompanybrain.com.br/en/glossary/tokenization
Authors: Luiz Gardelin
Updated: 2026-11-14T18:37:31.831Z

Tokenization is the process of converting a sequence of data into units called tokens. A tokenizer is the system or algorithm that performs this conversion. For text, segmentation may use words, characters, or parts of words. Tokenization prepares a representation for the model to process; it is not, by itself, a complete interpretation of the content. [Sources: Google, tokenizer](https://developers.google.com/machine-learning/glossary#tokenizer) and [token](https://developers.google.com/machine-learning/glossary#token).

## The process differs from its result

A [token](/en/glossary/token) is a resulting unit; tokenization is the operation that organizes a sequence into those units. Confusing the two makes it harder to explain why a text has a particular count. Counting visible words is insufficient because a strategy may split a word into parts or work with smaller units.

The glossary describes more than one possible strategy. A division used to illustrate the concept should therefore not be presented as the output of a particular tokenizer. If a team needs to know how a model will process a document, it must check the corresponding tokenizer rather than reuse an estimate made for another system. [Source: Google, types of token](https://developers.google.com/machine-learning/glossary#token).

## Hypothetical document preparation example

A knowledge team has assembled technical descriptions, abbreviations, and material codes in a manual. Before using the text in a model request, the team wants to count the full input, including the manual, question, and instructions.

The team could test the actual input with the specified tokenizer and check the rules for the [context window](/en/glossary/context-window). For example, [OpenAI](/en/glossary/openai)'s documented reasoning models require room for generation, including reasoning tokens. [Source: OpenAI, reasoning models](https://developers.openai.com/api/docs/guides/reasoning). If the planned use exceeds the limits, the team would need to select passages or reorganize the request. Shortening everything indiscriminately may remove information needed for review.

Tokenization should not be confused with data protection. Converting text into processing units does not, by definition, authorize its use or remove sensitive information. Decisions about which data may be sent belong before the request. In the working process, it helps to separate three choices: which information is permitted, which is relevant, and how it will be represented for the model.

## Sources

- [Machine Learning Glossary: Tokenizer](https://developers.google.com/machine-learning/glossary#tokenizer): Text tokenization alone does not determine context-window use. Reserving room for generation and reasoning follows the documented OpenAI example without generalizing to other interfaces.
- [Machine Learning Glossary: Token](https://developers.google.com/machine-learning/glossary#token)
- [OpenAI: Reasoning models](https://developers.openai.com/api/docs/guides/reasoning): Scope: reasoning models documented by OpenAI. Reasoning tokens occupy the window and room must remain for generation; this accounting is not a universal rule.

## Related reading

- [Token](/en/glossary/token)
- [Context window](/en/glossary/context-window)
- [Model inference](/en/glossary/model-inference)
- [AI hallucination](/en/glossary/ai-hallucination)
- [AI prompt](/en/glossary/ai-prompt)
- [Algorithmic bias](/en/glossary/algorithmic-bias)
