Paste the text
A prompt, a document or some code.
Paste your text and get an estimate of its tokens, with a likely range, plus characters and words. Set a context limit to see how much of it you use, and a price to see the cost.
100% private — the calculation is done in your browser and nothing is sent to any server.
A prompt, a document or some code.
Prose, code or another language changes the estimate.
Set a context limit or a price for extra numbers.
AI language models do not read letters or words but tokens, chunks of text that can be a whole common word, part of a longer word, a number or a symbol. Prompts, documents and answers are all measured in tokens. Limits, such as how much a model can take in at once, and prices are set in tokens too. Knowing roughly how many tokens a text uses helps you check that it fits in a context window and estimate what a request will cost.
Every model family has its own tokenizer, so the exact count of the same text differs between them. This tool does not run any of those tokenizers. It estimates from the number of characters and words, using typical ratios: around four characters per token in English prose, fewer in Spanish and other languages with longer words and accents, and fewer again in code and JSON, where symbols and short names cost more. It gives you a most likely value and a range around it. For an exact figure, use the tokenizer or the token counting function of your provider.
In English, a token is about three quarters of a word, so 100 tokens are roughly 75 words. Text in Chinese, Japanese and Korean usually takes about one token per character or slightly more, which the tool accounts for. Numbers, URLs, rare words and unusual formatting split into many tokens, so text full of them is larger than it looks.
Because it is an estimate, leave a safety margin, such as ten to twenty percent, when you are close to a limit. The count does not include hidden parts of a real request, like system instructions, tool definitions or the format of the conversation. Your text is analyzed in your browser and is not uploaded. To turn tokens into money for a whole application, use the AI API cost calculator.
More utilities that also run without leaving your browser.