AI lab

Tokenizer

Split text into tokens with a toy vocabulary and see why code and rare words cost more.

InteractiveText to tokens, with a toy vocabulary
Loading interactive…

Common English words become one token each, while digits, punctuation-heavy code and characters the vocabulary lacks break into many small pieces. Real tokenizers split differently, but you pay for the same pattern.

Learn the concept

The lesson this lab comes from, with the explanation, a practice task and a quiz.

More labs

All labs