Tokens in AI are the small chunks of text that a language model reads and writes. Before ChatGPT, Claude or Gemini can understand your message, it splits the text into tokens: whole words, pieces of words, numbers or punctuation. The model then predicts its answer one token at a time. Tokens matter for three practical reasons: they decide how much text a model can handle at once (its context window), how much an API call costs, and how fast the answer arrives.

A handy rule from OpenAI’s documentation: 1 token is about 4 characters, or about 0.75 words, in English. So 1,000 tokens is roughly 750 words. As a real check, the ~2,000-word guide we published this morning came out at 2,516 tokens, or about 1.27 tokens per word.

What is a token in AI?

A token is the basic unit a large language model (LLM) works with. Models don’t see letters or words the way you do. A tokenizer turns text into a list of numbers, where each number stands for a chunk of text from a fixed vocabulary, often around 200,000 entries in modern models. The model only ever sees those numbers.

  • Common words are usually one token: “love”, “pizza”, “the”.
  • Rare or long words are split into parts: “unbelievably” becomes un + bel + ievably.
  • Spaces usually attach to the next word, so ” magic” (with a space) is one token.
  • Punctuation and symbols are often separate tokens.
  • Numbers are chopped into chunks: a date like 2026-10-17 takes 6 tokens.

Why not just use words or letters? Letters would make every text very long and slow to process, and a whole-word vocabulary can’t cope with typos, new slang, names or code. Sub-word tokens are the middle ground: short sequences, and any text can still be represented.

A tokenizer example: how text becomes tokens

Here’s real output from OpenAI’s open-source tiktoken library using the o200k_base encoding, the tokenizer OpenAI introduced with GPT-4o. Newer models may split text a little differently, but the idea is the same. You can try your own text in OpenAI’s online tokenizer.

Tokenizer example: how OpenAI o200k_base splits I love pizza, tokenization, unbelievably, a date and non-English text into tokens
Real output from OpenAI’s open-source tiktoken library (o200k_base), Oct 17, 2026.
# pip install tiktoken
import tiktoken

enc = tiktoken.get_encoding("o200k_base")   # OpenAI's GPT-4o-era tokenizer
text = "Tokenization isn't magic, it's just chunking."
ids = enc.encode(text)

print(len(text), "characters ->", len(ids), "tokens")
print([enc.decode([i]) for i in ids])
# 45 characters -> 10 tokens
# ['Token', 'ization', " isn't", ' magic', ',', " it's", ' just', ' chunk', 'ing', '.']

Notice that the 45-character sentence became 10 tokens, close to the 4-characters-per-token rule. Also notice the languages. A Vietnamese phrase of 25 characters needed 8 tokens, and a 20-character Hindi greeting needed 9, against 4 tokens for “I love pizza!”. Languages that use non-Latin scripts or lots of accents often use more tokens per word, so the same message can cost more and fill the context window faster.

How tokens map to words

TextApprox. wordsApprox. tokens
A tweet (280 characters)45-5560-75
One paragraph100130-140
A 1,500-word blog post1,5002,000
A 300-page novel90,000120,000
A 1M-token context window~750,0001,000,000
Estimates for English using the 0.75 words per token rule. Code, numbers and other languages use more tokens.

Two easy ways to estimate: divide the number of characters by 4, or multiply words by 1.33. For exact numbers, count with a tokenizer, or read the usage field the API returns with every response.

Input tokens, output tokens and reasoning tokens

  • Input tokens are everything you send: the system instructions, your message, earlier chat history, pasted documents and tool results.
  • Output tokens are what the model writes back. They usually cost 4 to 5 times more than input tokens, because the model generates them one at a time.
  • Reasoning tokens are the hidden “thinking” steps that reasoning models produce before they answer. You don’t see them, but they’re billed as output tokens and take up context space.
  • Cached input tokens are input the provider has seen recently, such as a long system prompt you reuse. They’re billed at a big discount.

What is a context window?

A model’s context window is the maximum number of tokens it can work with in a single request, input and output together. OpenAI’s GPT-6 model pages list a 1,050,000-token context window and up to 128,000 output tokens for gpt-6-luna, gpt-6.1-sol and gpt-6-astra. That’s roughly 750,000 words of input, enough for several long books.

What fits in an AI context window: instructions, chat history, files, reasoning tokens and the answer

Three things to know about context windows:

  • The model has no other memory. In a chat, earlier messages are sent again with every new turn. Long conversations get slower and more expensive, and when they hit the limit, older parts are dropped or summarised.
  • Bigger isn’t always better. Models can miss details buried in the middle of very long inputs. Sending only the relevant chunks (retrieval, or RAG) is often more accurate and much cheaper.
  • Long context can cost more. OpenAI charges a higher rate once a request goes over 272K input tokens: double for input and 1.5x for output on the GPT-6 models.

How much do tokens cost? Price per 1M tokens

API prices are quoted per 1 million tokens, with separate rates for input, cached input and output. These are OpenAI’s standard rates from its pricing page, checked October 17, 2026 (short context, up to 272K input tokens):

ModelInputCached inputOutputBatch (input / output)
gpt-6-luna$0.10$0.01$0.50$0.05 / $0.25
gpt-6.1-sol$2.00$0.10$10.00$1.00 / $5.00
gpt-6-astra$10.00$1.00$50.00$5.00 / $25.00
USD per 1M tokens. Long context (over 272K input tokens) costs 2x for input and 1.5x for output.

Other providers price the same way. For example, DeepSeek V4.1 Flash lists $0.15 input and $0.60 output per 1M tokens off-peak, and you can run local AI models on your own computer with no token bill at all.

OpenAI token prices per 1M tokens for gpt-6-luna, gpt-6.1-sol and gpt-6-astra, with a monthly chatbot cost example
Prices from OpenAI’s pricing page, checked Oct 17, 2026.

Real cost examples

  • Summarise a 2,000-word article (about 2,600 input tokens) into 200 words (about 260 output tokens): $0.0004 on gpt-6-luna, $0.008 on gpt-6.1-sol, $0.039 on gpt-6-astra.
  • A support chatbot with 10,000 conversations a month, each using 1,500 input and 400 output tokens: about $3.50 a month on gpt-6-luna, $70 on gpt-6.1-sol or $350 on gpt-6-astra.
  • Reading a 300-page book (about 120,000 input tokens) once: $0.012 on gpt-6-luna or $1.20 on gpt-6-astra, before the answer.

These are our own calculations from the listed rates. To try the API yourself, see our guide on how to get a ChatGPT API key, which also covers free-tier limits and setting a spending cap. Note that a ChatGPT Plus subscription is billed separately and doesn’t use per-token pricing.

How to cut your token costs

  • Pick the smallest model that works. gpt-6-luna is 20x cheaper than gpt-6.1-sol on output. Test the cheap model first and only move up for the hard tasks.
  • Keep output short. Output tokens are the expensive ones. Ask for bullet points, a word limit or a JSON field instead of an essay, and set a max output tokens limit.
  • Use prompt caching. Put your long, unchanging instructions and examples at the start of the prompt. OpenAI caches prefixes of 1,024 tokens or more automatically on GPT-5.6 and later, and cached input is 90% cheaper on gpt-6-luna and gpt-6-astra and 95% cheaper on gpt-6.1-sol.
  • Use the Batch API for jobs that don’t need an instant answer, such as tagging or summarising thousands of items. It costs half the standard rate.
  • Trim chat history. Summarise old turns, or start a new chat when the topic changes, so you don’t pay to re-send everything.
  • Send only what’s relevant. Retrieve the right paragraphs rather than pasting whole documents, and strip HTML, boilerplate and extra whitespace.
  • Lower reasoning effort on reasoning models for simple tasks, since hidden reasoning tokens are billed as output.
  • Use a cheaper endpoint for simple decisions. For yes/no or pick-one classification, OpenAI’s Decisions API charges only for input tokens.

Tokens beyond text

Images, audio and video are tokenized too. An image is cut into patches that each count as a number of tokens, and audio is billed per token or per minute depending on the model. That’s why a big screenshot can cost more than a page of text. If you’re building an AI agent that uses tools, the tool definitions and tool results count as input tokens on every step as well, so keep them lean; our guide on how to build an AI agent covers that in practice.

The bottom line

Tokens are the currency of AI models: the unit they read, write, remember and bill you for. Remember the rule of thumb (1,000 tokens is about 750 English words), keep an eye on output and chat history, and pick the smallest model that does the job. That alone keeps most projects’ bills to a few dollars a month.

Frequently asked questions

What are tokens in AI, in simple words?

Tokens are the small pieces of text an AI language model works with. A token can be a whole word, part of a word, a number chunk or a punctuation mark. The model reads your prompt as tokens and writes its answer one token at a time.

How many words is 1,000 tokens?

About 750 English words. OpenAI’s rule of thumb is that 1 token is roughly 4 characters or 0.75 words in English. Other languages, code and numbers usually need more tokens for the same amount of text.

Why do AI companies charge per token?

Because tokens track how much work the model does. Every input token has to be processed and every output token has to be generated, so per-token pricing scales with your real usage. Output tokens cost more because they’re generated one by one.

What is a context window?

The context window is the maximum number of tokens a model can handle in one request, counting your instructions, chat history, files and its reply together. OpenAI’s GPT-6 models have a 1,050,000-token context window with up to 128,000 output tokens.

Do spaces and punctuation count as tokens?

Yes. Punctuation marks are often their own tokens, and a space is usually attached to the start of the next word, so ” pizza” with a space is a different token from “pizza” without one. Extra spaces, line breaks and formatting all add tokens.

How can I check how many tokens my text uses?

Paste it into OpenAI’s free online tokenizer, or count it in code with the open-source tiktoken library. In the API, every response also reports the exact input and output tokens you were billed for.