Token Counter
Estimate AI token usage for any text — GPT, Claude, Gemini and more. 100% local, nothing is uploaded.
OpenAI · 128K context
~0 of 128K tokens used
💡 Estimates use standard heuristics: ~1.3 tokens per English word, ~1 token per CJK character, weighted by punctuation. For exact counts, use the model provider's official tokenizer. All processing is done locally in your browser.
About This Tool
A token counter estimates how many tokens a piece of text will consume when sent to an AI language model. Tokens are the units that models like GPT-4o, Claude, and Gemini actually read and write — roughly 4 characters or ¾ of an English word each, though the ratio varies by language. Because API pricing and context limits are both measured in tokens, counting them before you send a request saves real money and prevents failed requests.
Common use cases include checking whether a long document fits into a model's context window before pasting it into ChatGPT or an API call, estimating the cost of processing large prompt batches, splitting oversized prompts into chunks, and comparing how much context different models give you for the same text.
This counter runs 100% in your browser. Your text is never uploaded to any server — paste API keys, private documents, or proprietary code with confidence. Estimates use industry-standard heuristics (~1.3 tokens per English word, ~1 token per CJK character) that track official tokenizers within a few percent for typical prose.
How to Use
- Pick your target model so the tool knows which context window to measure against.
- Paste or type your text — the token estimate updates live as you type.
- Read the context-window bar: under 50% you are safe, over 80% consider splitting the text or summarizing first.
- Use Copy Summary to grab a one-line estimate for documentation or planning.
Tip: For mixed English-Chinese text, the CJK counter matters — Chinese text is often more information-dense per token than English.
Common Mistakes
1. Counting characters instead of tokens
A "2000 character limit" and a "2000 token limit" are very different — 2000 tokens is closer to 8000 characters of English. Planning by characters alone underestimates cost by roughly 4×.
2. Forgetting system prompt overhead
The hidden system prompt, tool definitions, and conversation history all count against the context window. A 128K window is never really 128K free for your text.
3. Assuming all languages cost the same
English averages ~1.3 tokens per word, but code, URLs, and rare scripts can consume 2-3× more tokens per visible character. CJK text is usually close to 1 token per character.
4. Trusting estimates for billing
Heuristic estimates are for planning, not invoicing. Providers bill by their own tokenizer's exact count — expect small differences on every request.