# Tokenizer

- **Canonical URL:** https://getaimath.com/dictionary/tokenizer/
- **Topics:** [LLM Fundamentals](https://getaimath.com/dictionary/category/llm-fundamentals/)
- **Last updated:** 2026-11-25

## What is Tokenizer?

**In one sentence:** A tokenizer is the tool that chops text into tokens and turns each token into a number the model can use.

Before a model can read your message, the tokenizer breaks it into pieces and gives each piece an ID number from its vocabulary. After the model answers, the tokenizer turns the numbers back into readable text. Each model family usually has its own tokenizer.

![How ChatGPT & Claude Talk: Super-Powered Autocomplete — Simple cartoon diagram showing a sentence chopped into Lego word blocks (tokens), an AI brain weighing the odds of the next word ("mat" 75%, "couch" 18%, "roof" 5%), and snapping "mat" onto the end of the sentence.](https://getaimath.com/diagrams/llm-fundamentals.png)
*Napkin Diagram (LLM Fundamentals): Language models don’t plan whole essays at once—they play a super-smart game of "guess the very next word" over and over.*

## What is an example of Tokenizer?

A tokenizer might turn "Hello world" into the numbers [15496, 995].

## Why does Tokenizer matter?

The tokenizer decides how many tokens your text costs and can affect how well a model handles different languages.

## Related Concepts

- [Token](https://getaimath.com/dictionary/token/): A token is a small chunk of text, like a word or part of a word, that a language model reads and writes.
- [Vocabulary](https://getaimath.com/dictionary/vocabulary/): A model's vocabulary is the complete list of tokens it knows, each with its own ID number.
- [Next Token Prediction](https://getaimath.com/dictionary/next-token-prediction/): Next token prediction is the simple training game behind LLMs: look at some text and guess which token comes next.
- [Tokenization](https://getaimath.com/dictionary/tokenization/): Tokenization is the process of splitting text into tokens so a language model can work with it.
- [Masked Language Model](https://getaimath.com/dictionary/masked-language-model/): A masked language model learns by filling in blanks: some words in a sentence are hidden and the model guesses them using words on both sides.
- [Subword Tokenization](https://getaimath.com/dictionary/subword-tokenization/): Subword tokenization splits words into common smaller pieces, so the model can handle any word using a limited vocabulary.

---
Source: The AI Math Dictionary (https://getaimath.com/dictionary/tokenizer/)
