brainax

What is a token in AI? A simple explanation

Short answer: a token is a piece of text that a language model works with: a whole word, part of a word, sometimes a space or a punctuation mark. The model doesn't see letters, it sees a chain of token numbers. An AI token is not a crypto token and not money, just a unit of text. Message limits, answer length and prices in AI services are all counted in tokens.

Free course on this topicAI basics: free courseStart the course →

More in the lesson: How a neural network thinks

How does a model turn text into tokens?

Before the model reads your message, a tokenizer cuts it up: a program that splits text into tokens. Each token gets its own number (id) from the model's vocabulary. Common words usually fit in one token, while rare and long ones get cut into parts: "unbelievably" can easily become three pieces.

A side effect: a model struggles to count the letters in a word, since it never sees the letters. Same source.

What it means for you: if a chatbot miscounts letters or syllables, it isn't "dumb", it just reads text in chunks, not letter by letter.

More in the lesson: Tokens and the context window

Why do other languages use more tokens?

The same meaning in Russian, Arabic and many other languages often takes more tokens than in English, because model vocabularies were built mostly from English text. Rule of thumb: in English one token is about 3/4 of a word on average; in other languages you usually get fewer words per token.

What it means for you: the same limit or budget covers less text when you write in a language other than English.

More in the lesson: Tokens and the context window

What is a context window?

The context window is how much text the model can see at once, measured in tokens. Everything goes into it together: your messages, its replies, pasted files and the chat's hidden settings. Whatever doesn't fit simply doesn't exist for the model.

Example from the lesson: a week-long chat about prepping for an exam. Once the text grows bigger than the window, the oldest messages drop out or get compressed. Even inside the window, the model sometimes misses details buried in the middle of a long text.

What to do: ask for a short summary, start a new chat, paste the summary there and repeat the key conditions.

More in the lesson: Tokens and the context window

Why are AI limits and prices counted in tokens?

Every token, read or written, costs the model time and computing power. That's why limits and prices are counted in tokens, and why fluff in your prompt eats both the window and your limits and gives nothing back.

If you build your own app on an AI API, the service counts tokens in the question and in the answer, so the bill grows with every request. One person asking a question costs pennies; a whole class asking hundreds of questions the night before an exam is something you notice. Turn on a spending limit or a billing alert where the service offers one.

More in the lessons: Tokens and the context window, Money and limits

FAQ

What is a token in ChatGPT?

A piece of text the model reads and writes: a short word, part of a longer word or a punctuation mark. Paid AI services count chat length and price in tokens.

How many words is one token?

In English, about 3/4 of a word on average. In other languages you usually get fewer words per token, so the same text takes more tokens.

Is an AI token the same as a crypto token?

No. An AI token is just a unit of text the model works with. It isn't money and has nothing to do with crypto.

More in the lesson: How a neural network thinks

Start the AI course

The free Brainax course "AI basics" explains how models work, what tokens and context windows are, how to write prompts that work and where AI makes things up. Short lessons with animations and a quiz. Start the lesson

Free course on this topicAI basics: free courseStart the course →