Tool
AI Token Counter
Count tokens in any text for GPT-4, GPT-3.5, Claude, and Gemini. Useful for staying under context limits and estimating API costs before you run a prompt. Nothing you paste leaves your browser.
Estimated token count by model
Frequently asked questions
What is a token in an AI model?
A token is the smallest unit of text an AI model processes. It is usually a short subword — a few characters, part of a word, or a common short word. AI models charge by token (both input and output) and have token limits per request. For English text, one token is roughly 4 characters or three-quarters of a word.
How accurate is this token counter?
For English prose, the estimate is within about 5% of the real count. For code, JSON, or non-Latin scripts, real counts can differ by 15-30%. For exact token counts (e.g. when planning a request near a model limit), use the official tokenizer for the specific model — tiktoken for OpenAI, the Anthropic SDK for Claude.
Do GPT, Claude, and Gemini count tokens the same way?
No. Each model family uses its own tokenizer. GPT-4 averages about 4 characters per token for English. Claude averages about 3.5. Gemini averages about 4.2. The differences are larger for code and non-English text. This is why a 1,000-word prompt can come out to different token counts on different models.
Is the text I paste sent to any server?
No. This tool runs 100% in your browser using client-side JavaScript. The text never leaves your device. You can verify this by opening browser dev tools, going to the Network tab, and watching that no requests are sent while you type.
How can I reduce the token count of a prompt?
Three quick wins: (1) Remove polite filler like "please" and "thank you" — these cost tokens with no quality benefit. (2) Replace long examples with shorter ones. (3) Use abbreviations consistently if the model can infer them. For long system prompts, prompt caching (now available on Claude and GPT) lets you avoid paying for the same tokens repeatedly.