What are tokens in AI, and how are they counted?
Tokens are the pieces of text an AI model reads and writes. Before a model sees your prompt, a tokenizer splits it into tokens, which are whole words, parts of words, punctuation or spaces, and turns each one into a number. OpenAI's tiktoken library puts it simply: "Language models don't see text like you and I, instead they see a sequence of numbers (known as tokens)" (tiktoken, read November 2026). Everything you pay for and every limit you hit is counted in these tokens: the price per million, the context window, the maximum reply length.
What a token looks like
A common English word is usually one token. A long or rare word is split into several. Spaces, punctuation and line breaks count too, and code splits differently from prose, because symbols and indentation break into their own pieces.
OpenAI's tokenizers use byte pair encoding, which starts from single bytes and merges the pairs that occur most often in its training text into larger tokens. tiktoken's README describes the result: the encoding is "reversible and lossless", "works on arbitrary text", and "on average, in practice, each token corresponds to about 4 bytes." For plain English text, that means a token is roughly four characters long.
Different models count differently
Each model family has its own tokenizer, so the same text costs a different number of tokens depending on where you send it. Neotask's free token counter measured the same samples across vendors:
| Sample | GPT-5 and GPT-6 | Claude 5 | Gemini 4 |
|---|---|---|---|
| English paragraph, 754 characters | 159 | 211 | 161 |
| Sales data as CSV, 322 characters | 171 | 187 | 263 |
| Japanese paragraph, 114 characters | 88 | 105 | 58 |
For English, that works out to about 1.1 tokens per word in GPT and Gemini and about 1.5 in Claude 5. Numbers and data can go the other way: Gemini used the most tokens on the CSV.
Tokenizers also change between versions of the same model. Anthropic says Claude 4.7 and later use a newer tokenizer that "produces approximately 30% more tokens for the same text," and its docs advise: "Recount prompts against the model you plan to use rather than reusing counts measured against earlier models" (token counting, read November 2026). The token counter found 29% to 37% more tokens on its three test texts.
Why tokens matter
Price. Model APIs charge per million tokens, with separate rates for input and output. Claude Opus 5.5 costs $4 per million input tokens and $20 per million output tokens; Sonnet 5.5 costs $2 and $10 (Anthropic pricing, read November 2026). Output costs five times as much as input on both, so a long answer costs more than a long question.
Cached tokens. Text a model has already seen, such as a long system prompt sent with every request, can be cached and billed at a fraction of the input rate. For Opus 5.5 a cache read costs $0.20 per million tokens instead of $4.
The context window. This is the total number of tokens a model can consider at once, counting your prompt, the conversation so far, any files and its own reply. Claude Opus 5.5 and Sonnet 5.5 have 1M-token windows, and Gemini 4 Neon also offers 1 million. Local models run with much smaller windows by default: Ollama uses 4,096 tokens unless you change it.
Hidden tokens. Tool definitions, system prompts and the formatting around each message all count. Anthropic lists a separate system prompt of a few hundred tokens that is added whenever you give Claude tools, and Neotask's counter found that a one-letter message counts as 9 input tokens on Claude Opus 5.5 and 7 on GPT-6.
How to count tokens
- For OpenAI models, tiktoken gives exact counts. Install it with
pip install tiktokenand load theo200k_baseencoding used by recent GPT models. - For Claude, Anthropic's
/v1/messages/count_tokensendpoint is free to call and returns an estimate. Anthropic notes the actual count "might differ by a small amount." - For a quick check across vendors, paste text into Neotask's token counter. GPT counts are exact; Claude and Gemini counts are estimates with their measured error shown, within 11% on 9 in 10 test texts for Claude 5. Counting runs in your browser, so the text doesn't leave the page.
How to use fewer tokens
- Trim what you send every time. Long instructions repeated in every request add up. Cut them, or cache them: on Opus 5.5 a cached read costs $0.20 per million tokens against $4 for fresh input.
- Ask for shorter answers. Output tokens cost the most.
- Send excerpts, not whole files, when the model only needs part of a document.
- Start new conversations. A long chat re-sends its history with every turn.
- Pick the model to match the job. A cheaper model for simple, high-volume work lowers the price of every token.
Tokens in Neotask
Neotask meters usage in tokens too. Each plan includes a monthly allowance of Neotask Matrix, Neotask's hosted model, measured against the Core plan: Free gets half of Core's, Power five times and Ultra 15 times. Past the allowance, if you turn on extra usage, Matrix runs on AI credits at $1 per million input tokens, $5 per million output tokens and $0.20 per million cached input tokens (Neotask pricing, read November 2026). The Sessions page lists each run's model with its input, output and cache tokens, so you can see where your usage goes.
Turns that run on your own Claude Code, Codex, Gemini CLI or Cursor subscription aren't charged by Neotask, and local models on your own computer are free.
Frequently asked questions
How many words is 1,000 tokens? About 900 English words in GPT and Gemini, and about 670 in Claude 5. Neotask's counter measured about 1.1 tokens per English word in GPT and Gemini and 1.5 in Claude 5.
Are tokens the same as words? No. A token can be a whole word, part of a word, a punctuation mark or a space. Common short words are usually one token each.
Why do AI companies charge by the token? Tokens are the unit a model reads and writes, so they track the size of each request and reply. Every major API prices output tokens higher than input tokens.
Do spaces and punctuation count as tokens? Yes. They are often merged into the neighbouring word's token, but they still count.