Count tokens in your text for GPT-4, Claude, and Gemini. See token count, word count, character count, and estimated API cost per model. Supports system prompts, conversation history, and long documents.
Free, no sign-up — one of the SaaSQuickStart AI / LLM tools.
This tool uses character-based heuristics to estimate token counts without sending your text to any server. All processing is done entirely in your browser. For English text, OpenAI's GPT tokenizer (tiktoken, the same one behind ChatGPT) averages roughly 4 characters per token, Anthropic's Claude tokenizer averages roughly 3.5 characters per token, and Google's Gemini tokenizer is also around 4 characters per token. Code and non-Latin scripts (Chinese, Arabic, etc.) typically require more tokens per character and will be underestimated. For exact counts, use the provider's official tokenizer library (tiktoken for OpenAI, tokenizers for Hugging Face).
Each model uses its own tokenizer with a vocabulary of 30,000–100,000 tokens. Common English words are often a single token, while rare words and non-English text may be split into multiple tokens. This tool uses the average characters-per-token ratio as a fast approximation — it's accurate to within 10–15% for standard English but can deviate more for code, punctuation-heavy text, or other languages.
Token counts determine your API cost (providers charge per token) and whether your text fits in the model's context window. GPT-4o has a 128K token context window — that's roughly 100,000 words or a 400-page novel. If your input exceeds the limit, the API will reject it and you'll need to chunk your text.
Remove unnecessary pleasantries, examples you don't need, and redundant instructions. Use bullet points instead of prose in system prompts. Reference external knowledge via retrieval (RAG) instead of pasting full documents into the prompt. Trim conversation history to only the last N turns rather than sending the entire history.
No. All processing happens locally in your browser using JavaScript. Your text is never sent to any server, never logged, and never stored. You can safely paste confidential documents, API keys, or personal data without any privacy risk.
It varies by model and by the text itself, but as a rough average for English text: OpenAI's GPT tokenizer is about 4 characters per token, and Anthropic's Claude tokenizer is about 3.5 characters per token. Short common words are often a single token regardless of length, while rare words, numbers, and punctuation can each take up their own token — so the average holds better over long passages than for a single word.
Claude uses Anthropic's own byte-pair-encoding (BPE) tokenizer, which is different from OpenAI's tiktoken — the same sentence can produce a different token count on each model. For a quick estimate, Claude averages roughly 3.5 characters per token for English text (paste your text into the box above for an exact estimate). For a precise count, Anthropic's API returns the exact input/output token usage on every response, and the Claude API docs cover the tokenizer in more detail.