AI Token Counter & Estimator
Paste a prompt or document to see its characters, words and an estimated number of AI tokens, plus a planned reply length for budgeting. By default the token figure is an estimate shown as a range, because every model tokenizes differently; for OpenAI’s o200k_base and cl100k_base encodings you can switch to an exact count that runs entirely in your browser.
Result
Estimate
Type or paste some text to count it.
- Method
- Characters
- Characters without spaces
- Words
- Lines
- Tokens
- Plausible range
- Planned output
- Total for the request
Examples
Measured with OpenAI’s tokenizers on ToolQuarter’s own pages and a code sample (2026-10-03). Other providers’ tokenizers give different counts.
| Sample | Characters | Words | Tokens (o200k_base) | Tokens (cl100k_base) |
|---|---|---|---|---|
| English prose | 16,883 | 2,591 | 3,133 | 3,148 |
| Spanish prose | 19,554 | 2,854 | 3,855 | 4,545 |
| Arabic prose | 14,592 | 2,292 | 4,189 | 9,579 |
| Code and JSON | 6,240 | — | 2,240 | 2,240 |
Formula & Methodology
Counts of characters, words and lines are exact. The token figure is an estimate unless you choose an exact encoding:
estimated tokens = Σ over scripts (characters in that script ÷ characters per token)range = the same sum with the conservative and the optimistic ratiostotal for the request = input tokens + planned output tokensThe estimate assumes these characters per token (conservative gives the most tokens, optimistic the fewest):
| Script | Conservative | Typical | Optimistic |
|---|---|---|---|
| Latin (English, Spanish…) | 3 | 4 | 5 |
| Arabic | 1.5 | 2.5 | 3.5 |
| Chinese, Japanese, Korean | 0.9 | 1.2 | 1.6 |
| Other scripts (Cyrillic, Greek…) | 1.5 | 3 | 4.5 |
Good to know
- Spaces, digits and punctuation are assigned to scripts in proportion to the letters around them.
- Exact counts cover only OpenAI’s o200k_base and cl100k_base encodings. Claude and Gemini use their own tokenizers: Anthropic documents that its newer models produce about 30% more tokens for the same text than earlier ones.
- Real requests also include formatting around each message, tool definitions and any images or files, which this tool does not see.
- The exact tokenizer is downloaded to your browser only when you choose it. Your text is not uploaded.
- For an official count of Claude, Gemini or OpenAI usage, use the provider’s own token-counting endpoint or the usage figures in the API response.
Method and references
These primary sources support the methods this tool relies on. Having read them does not verify every result the calculator produces, and figures listed as assumptions are ToolQuarter’s own.
Token counts are exact for the selected supported OpenAI encoding. Other token counts are estimates based on characters per token. Character, word and line counts are calculated separately.
- OpenAI tiktoken: OpenAI’s open-source tokenizer for its own models. Its named encodings, such as o200k_base, are what the exact counts use. ()
- gpt-tokenizer: The JavaScript port of tiktoken that runs in your browser for the exact counts. It lists o200k_base and cl100k_base among its supported encodings. ()
- OpenAI API: Key concepts: OpenAI’s rule of thumb for English: about 4 characters or 0.75 words per token, in line with the estimate of about 4 characters per token for Latin script. ()
- Gemini API: Understand and count tokens: Google’s rule of thumb for Gemini: about 4 characters per token, and 100 tokens are about 60 to 80 English words. ()
- Anthropic: Token counting: Anthropic describes its own counting endpoint, says its counts are estimates that can differ slightly, and says newer Claude models produce about 30% more tokens for the same text. ()
ToolQuarter assumptions (no primary source):
- The characters-per-token ranges for Latin, Arabic, Chinese-Japanese-Korean and other scripts (for example 3, 4 and 5 for Latin) are ToolQuarter’s own. They were widened from measurements with o200k_base and cl100k_base on ToolQuarter’s own pages on 3 October 2026 and are not provider figures.
- The sample table (English, Spanish, Arabic and code) is a ToolQuarter measurement, not a reference. For Claude, Gemini and other tokenizers the result stays an estimate: use the provider’s own counting for an official figure.
How to Use
- Paste or type your prompt or document.
- Leave the method on “Estimate” for any model, or choose an exact OpenAI encoding.
- Optionally enter how long you expect the reply to be.
- Read the tokens, the range and the total, then copy the result or plan the window with the context planner.
Frequently Asked Questions
How many tokens is a word?
In English prose a word is roughly 1.2 to 1.5 tokens, or about four characters per token. Other languages, numbers and code usually use more tokens per word. This tool measures your actual text rather than applying one rule.
Is the count exact for ChatGPT, Claude and Gemini?
Only the two OpenAI encodings offered here are exact, and only for OpenAI models that use them. For Claude, Gemini and others the figure is an estimate with a range. Use the provider’s own counter when you need a billing-grade number.
Is my text sent anywhere?
No. Counting and estimating run in your browser. If you choose an exact encoding, the tokenizer’s data is downloaded to your device, but your text is never uploaded, stored or sent to analytics.
Why do Arabic, Spanish and code use more tokens than English?
Tokenizers are trained mostly on English text, so common English words are single tokens while words in other languages are split into more pieces. Code and numbers also break into many small tokens. The estimate therefore uses different ratios for each script.
Why plan the output length?
A request is limited by its input and its reply together, and the reply is billed at a higher rate. Entering a planned output shows the total tokens for the request so you can check the context window and the cost.
Last updated: