Token Counter
100% PrivateAI & Prompt ToolsCount the tokens in any text with a real tokenizer, so you know exactly how much of a model it uses.
Runs entirely in your browser. Your input is not uploaded to Ovatly or anywhere else.
- 1Paste or type the text you want to measure.
- 2Click Count tokens.
- 3Read the token count together with the character and word counts.
- 4Use the count with the Context Window Checker or Prompt Cost Calculator if you need fill levels or prices.
Text: "Hello, world!" Result: 4 tokens, 13 characters, 12 characters without spaces, 2 words, 1 sentence. For comparison, "The quick brown fox jumps over the lazy dog" is 9 tokens, and a full sentence like "Prompt engineering is the practice of writing instructions for AI models." is 12 tokens.
- Counts use the GPT tokenizer (o200k encoding). Claude, Gemini and other families split text differently, so for them the count is a close approximation, not an exact figure.
- Tokens are not words: common short words are often one token, while rare words, code and non-English text usually take more tokens per word.
- Very long pastes are counted on this device; a full book can take a moment.
Tokenizers split text into sub-word pieces. Frequent words tend to be single tokens, unusual words become several, and punctuation and spaces attach to neighboring tokens.
About this tool
The Token Counter counts the tokens in any text using a real BPE tokenizer running in your browser (the gpt-tokenizer package, o200k encoding, the GPT-4o family tokenizer). Alongside the token count it shows characters, words, sentences and paragraphs, which is what you need before pasting a long prompt or document into a model with a context limit or a per-token price. Your text is never uploaded.
Related tools
Part of Ovatly's free tools in AI & Prompt Tools.