How it works
A tokenizer applies its own normalization and segmentation rules, then maps resulting pieces through a vocabulary. Common systems use subwords rather than simply splitting on spaces.
A concrete example
A word may be one token or several pieces depending on the tokenizer and vocabulary. The demonstration below only splits on whitespace to make the first step visible.
Watch for this
Do not assume a word count equals a model token count. Use the target model tokenizer for billing and context estimates.
Try it yourself
Type a short sentence and observe the whitespace pieces. Then compare with a real tokenizer.