AI Token Counter
Estimate tokens for GPT, Claude, Gemini and Llama-style models, plus characters, words and how much of an 8K-1M context window your text fills. Runs locally.
Rule of thumb: characters ÷ 4 = 0
Estimates only: each model uses its own tokenizer, so real counts vary. Your text never leaves this page.
What this AI token counter does
Language models such as GPT, Claude, Gemini and Llama do not read words or letters. They read tokens: chunks of text that can be a whole word, part of a word, a space plus a word, a number or a symbol. Usage limits, context windows and API billing are all measured in tokens, so it helps to know roughly how many tokens a prompt or document will use before you paste it into a chat or send it through an API.
Paste any text and the tool shows its characters and words, an estimated token count, a likely range, a per-family estimate and how much of a context window the text would fill. Everything runs in your browser; nothing is uploaded and no AI service is called.
How the estimate works
Each model family uses its own tokenizer, and those tokenizers are not bundled here, so the result is an approximation and never an exact tokenizer output. The tool splits your text into words, numbers, symbols and line breaks and applies average ratios that hold up well in practice:
- English prose: about 4 characters (roughly ¾ of a word) per token.
- Spanish and other accented Latin-script text: about 3-3.5 characters per token, because tokenizers split those words more often.
- Source code, JSON and markup: about 3 characters per token; brackets, operators and indentation add up quickly.
- Chinese, Japanese and Korean: close to one token per character.
The per-family figures apply small adjustments on top of that baseline, because some tokenizers have larger vocabularies and produce fewer tokens for the same text. The range (about ±15%) is a reminder that the true number depends on the exact model version.
Example
Why context windows matter
The context window is the total budget for one request: system instructions, your prompt, attached files, earlier messages and the model's answer. Leave room for the reply. If your input fills 95% of a window, the answer will be cut short. Common sizes today range from 8K tokens in small or local models to 128K-200K in most frontier models and up to 1M tokens or more in long-context models. Type the exact limit of the model you use, or tap a preset.
Tips to use fewer tokens
- Remove boilerplate, signatures and repeated instructions before pasting long documents.
- Minify JSON and strip unneeded indentation from code when the model does not need to see formatting.
- Summarise earlier conversation turns instead of resending the full history.
- Ask for the output format you need, such as a short list instead of long prose, to save output tokens.
Frequently Asked Questions
Is this token count exact?
No. Each model family uses its own tokenizer, and this tool does not run any of them. It applies published rules of thumb (about 4 characters per token for English, fewer for Spanish, code and other languages) and shows a range. Expect real counts to land within roughly 10-20% of the estimate for normal prose.
How many words is 1,000 tokens?
For typical English prose, 1,000 tokens is roughly 750 words or about 4,000 characters. Spanish and most other languages need more tokens for the same number of words, and source code usually needs more tokens per character than prose.
Why does Spanish text use more tokens than English?
Tokenizers are trained mostly on English, so common English words are often a single token while Spanish words, especially long ones or words with accents, are split into several pieces. As a result Spanish averages closer to 3-3.5 characters per token.
What is a context window?
The context window is the maximum number of tokens a model can consider at once, counting your prompt, any attached documents, the conversation so far and the answer it writes. If the total goes over the limit, older content is cut or the request fails.
Is my text sent to an AI service?
No. The estimate is calculated by JavaScript in your browser. The text is not uploaded, stored or sent to any API.