"How AI Turns Your Words into Secret Code — Tokenization Explained

Imagine you want to teach a robot to read and write.
The robot can’t understand whole sentences like we do.
So, we have to break sentences into smaller pieces that it can work with.
These pieces are called tokens.
Example
Let’s say you write:
“I love pizza.”
When we tokenize it, we break it into smaller chunks:
arduinoCopyEdit"I" → 1
"love" → 2
"pizza" → 3
"." → 4
The robot doesn’t see words — it only sees numbers (IDs for each token).
So “I love pizza.” becomes [1, 2, 3, 4] for the AI.
Why do this?
Computers understand numbers, not words.
By converting words into tokens (numbers), the AI can process and understand them faster.
Tokens can be whole words (“love”) or even parts of words (“piz” + “za”), depending on the AI model.
How GPT Uses Tokens
When you ask GPT something:
Your words are tokenized into numbers.
GPT predicts the next token (number) based on what it has seen before.
These tokens are turned back into words for you to read.
It’s like a secret code language between you and the AI — you write in English, it translates to numbers, does its thinking, and then translates back to English.
Subscribe to my newsletter
Read articles from Aman kumar Mishra directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
