What Is a Token?

By Weapp · Updated

A token is the word-chunk a language model counts in – roughly four characters, or about three-quarters of a word in English, somewhat more in Swedish. Tokens drive both price and limits: API cost is set per million tokens in and out, and the context window's cap is measured in tokens. Understanding them makes AI cost predictable.

A token is the smallest chunk of text a language model counts in – a word fragment. The term sounds technical, but it’s worth understanding for anyone who’s going to buy or budget for AI, because tokens drive both what the service costs and where its limits sit. Here’s what they are and why they show up in every price list and spec sheet.

The Chunks the Model Counts In

A language model doesn’t read text letter by letter, nor strictly word by word. It splits the text into tokens – chunks that are often a whole word, but could just as easily be part of a word, a punctuation mark, or a space. The word “invoice” might become a single token, while a longer or less common word gets split into several.

A useful rule of thumb is that one token equals roughly four characters, or about three-quarters of a word in English. In Swedish, it usually works out to somewhat more tokens per word, since Swedish words and long compounds are handled less efficiently by the models’ splitting. The rule of thumb is an estimate, not an exact formula, but it’s good enough for planning and budgeting.

Why Tokens Drive the Price

This is where tokens become a direct business question. The work a model does is proportional to how much text it reads and writes, and tokens are precisely the measure of that. That’s why almost all API services are priced per million tokens.

The price is usually split into two parts: a cost for tokens in – what you send to the model – and another for tokens out, what the model answers. The output price is typically higher than the input price. The consequence is simple to grasp: long prompts and long answers cost more than short ones. A solution that sends along large amounts of background on every call burns more tokens, and therefore more money, than one that stays concise.

A concrete worked example makes it clear. Say a typical question plus answer in your planned solution comes to a few hundred tokens combined, and you expect thousands of calls a month. Then the total is tokens per call times the number of calls, priced per million tokens in and out. The point isn’t the exact figure, but that the cost can be worked out in advance once you understand it’s driven by tokens.

The Connection to the Context Window

Tokens don’t just set the price – they also set a limit. Every model has a context window – the largest amount of text it can hold in mind at once – and that cap is measured in tokens.

Everything counts toward the window: what you send in and what the model answers have to fit together under the limit. If you try to feed in a document larger than the context window, it won’t work, and the text has to be shortened or split into smaller parts. That’s precisely why RAG solutions chunk documents into smaller pieces and only send in the most relevant passages for each question – to stay within the window while still giving the model the right material.

Understanding tokens also gives you levers for keeping costs down. Since both input and output count, it pays to send only the material needed for each call instead of everything you have, and to ask for concise answers where that’s enough. In a RAG solution, that’s one of the benefits of retrieving just the most relevant passages: fewer unnecessary tokens in means lower cost without the answer getting worse. Many vendors also offer a discount for recurring content through caching, which can lower the bill further for prompts that resemble each other.

For a decision-maker, it’s enough to carry three things: a token is a word-chunk, the price is set per million tokens in and out, and the context window’s cap is measured in the same unit. With that understanding, both the cost and the limits of an AI solution become something you can plan for instead of something that surprises you. Want help estimating the token cost for a planned solution? Read more about our work with AI or get in touch.

Frequently asked questions

What is a token, explained simply?

A token is a chunk of text – usually a whole word or part of a word – that the language model counts and processes in. Models don't read and write letter by letter or word by word, but in exactly these chunks. The number of tokens in a text determines both what it costs to process and how much fits.

How many characters is a token?

A good rule of thumb is that a token equals roughly four characters, or about three-quarters of a word in English. In Swedish, it often works out to somewhat more tokens per word, since Swedish words and compounds are handled less efficiently by the models' splitting. It's an estimate, not an exact formula, but it's enough for planning.

Why are AI prices set per token?

Because the work a model does is proportional to how much text it reads and writes, and tokens measure exactly that. That's why API services are priced per million tokens, usually with one price for tokens in (what you send) and another for tokens out (what the model answers). Longer prompts and longer answers therefore cost more.

What do tokens have to do with the context window?

The context window is the maximum amount of text a model can hold in mind at once, and that cap is measured in tokens. Everything you send in plus what the model answers has to fit within the window. If the material is too large, it has to be shortened or split up, which is one reason documents get chunked in RAG solutions.

How do you count tokens to estimate the cost?

Start from the rule of thumb of four characters per token and calculate for your own expected volume: roughly how many tokens a typical question and a typical answer come to, times the number of calls. Multiply by the current price per million tokens in and out respectively. Prices change, so use the vendor's current price list and test on real examples.