Count tokens before you send a prompt
Large language models (LLMs) do not read letters or words, they read tokens. Every API call is billed per token, every model has a context window measured in tokens, and long prompts that exceed it are cut off or rejected. Counting tokens first tells you whether a document fits, how much a request will cost and whether it is worth shortening your prompt.
This counter uses the real OpenAI tokenizers, so counts for GPT models match OpenAI's own count for the same text; the API adds a few tokens per chat message for formatting. It also shows how your text is split. That makes it easy to spot what is expensive: long URLs, repeated boilerplate, tables with lots of symbols or text in languages other than English.
Rules of thumb for English text
| Text | About |
|---|---|
| 1 token | 4 characters or ¾ of a word |
| 100 tokens | 75 words |
| 1 page of text (500 words) | 670 tokens |
| A 90,000-word novel | 120,000 tokens |
Code, data, other languages and emoji need more tokens than this. Count them to be sure.
Claude, Gemini and other models
Each AI provider trains its own tokenizer. Anthropic Claude, Google Gemini, Meta Llama and others split text differently from OpenAI, so the same prompt has a different token count with each of them. Treat the count here as an estimate for those models. For exact numbers, use the token counting option in the provider's own API or console. With a token count in hand, the AI cost comparison shows what the same job costs on different AI models.
How to use the token counter
- 1Paste your prompt, document or code, or open a text file from your device.
- 2Pick the tokenizer for your model. GPT-4o and newer is right for current OpenAI models.
- 3Read the token count and context window use, and see the split below. Press "What does it cost?" to compare model prices for this prompt.
Guides on this topic
- What Is a Token in AI? Tokens vs Words vs Characters
- Open Weights vs Open Source AI: What the Labels Mean
- Running AI Models Locally: VRAM, Model Sizes, Quantization
Frequently asked questions
What is a token?
A token is the unit AI models read and write. Common English words are often one token, longer or rare words are split into pieces, and spaces and punctuation are usually part of a token. As a rule of thumb, 1,000 tokens are about 750 English words.
How exact is the count?
For the text itself it matches OpenAI exactly: the counter uses the same tokenizers, o200k_base for GPT-4o, GPT-4.1, GPT-5 and the o-series, and cl100k_base for GPT-4 and GPT-3.5. A chat request through the API adds a few tokens per message for formatting. Claude, Gemini, Llama and other models use their own tokenizers, so their counts differ. Use the result as an estimate for them.
Why do other languages and code use more tokens?
OpenAI notes that the ratio of tokens to characters differs between languages, and text that is not English often needs more tokens. Long compound words, accented letters, many Asian scripts, emoji and code full of symbols tend to be split into more pieces, as the split view shows, so the same meaning costs more tokens.
Is my text sent anywhere?
No. The tokenizer runs in your browser. Your prompt, document or code is counted on your own device and never sent to a server or to an AI provider.
What does the context window mean?
The context window is the most tokens a model can handle in one request, counting your input and its answer together. If your prompt fills most of the window, leave room for the reply, or split the document into parts.