Paste a prompt, a document or code and see exactly how many tokens it uses, which context windows it fits, and roughly what it costs. Every count is worked out on this device. It is free, and your text never leaves it.
How to count tokens, step by step
- Choose the tokenizer: o200k or cl100k.
- Paste your text into the Text to count box.
- Read the number of tokens, characters and words, and see how the text splits into tokens.
- Enter a Price per million tokens to see the estimated cost.
- Check the Context windows to see how much room is left.
What a token is
AI models do not read letters or words. They read tokens, which are common pieces of words. In English a token is about four characters, or three quarters of a word, but code, numbers and other languages split differently. Models charge and limit by tokens, so knowing the count tells you whether a prompt fits and what it costs.
Exact counts for OpenAI models
This counter uses the same tokenizers as OpenAI's models: o200k for GPT-4o, GPT-4.1, GPT-5 and the o-series, and cl100k for GPT-4 and GPT-3.5. Chat messages add a few tokens of formatting per message on top of these counts. Other models use their own tokenizers, so treat the counts as a close guide for them.
Context windows
The bars show how much of common context window sizes your text uses. Leave room for the model's answer: a prompt that fills the whole window leaves no space to reply.
Ways to use fewer tokens
- Remove repeated instructions and long pleasantries.
- Trim pasted documents to the parts that matter.
- Remove extra spaces and blank lines. The text cleaner can help.
- Split a very long document into parts with the chunker.
- Keep reusable prompts short in your prompt library.
Who uses it
Developers sizing prompts and estimating costs, writers and students preparing long documents, and teams planning how much text fits in one request. For a wider cost estimate, try the cost estimator.
Privacy
The tokenizer is downloaded to your browser and runs here. Your text is never uploaded.
Questions
How many words is a token?
In English, about three quarters of a word, or around four characters.
Why do code and other languages use more tokens?
Symbols, numbers and many non-English scripts split into more small pieces.
Is the cost exact?
It is an estimate based on the price you enter. Check current rates with your provider.