Rough LLM token estimates for your prompts. Emphasis on rough.
Token counts are estimates only — different models use different tokenizers (GPT-4, Claude, Gemini, Llama all tokenize differently and none of them count like this tool does). Use this as a ballpark guide, not a billing calculator.
~4 chars per token (rough English-text approximation).
This is not an exact match for any specific model's tokenizer.
Large language models don't process text character by character or word by word — they work with "tokens," which are chunks of text produced by a tokenizer algorithm specific to each model family. A token might be a whole word, part of a word, a punctuation mark, or a whitespace character, depending on the tokenizer.
Why it matters: most LLM APIs charge by token. Context window limits are measured in tokens. The difference between fitting your prompt in 128k context and blowing past it is measured in tokens. Knowing roughly how many tokens your prompt uses helps you plan requests and avoid surprises.
The rough English rule of thumb is about 4 characters per token, or about three-quarters of a word. This approximation works reasonably well for typical English prose but breaks down for code (often more tokens per character), non-Latin scripts (often many more tokens), and highly repetitive or structured text (often fewer).
For a production application where billing accuracy matters, use the tokenizer
library for your specific model: tiktoken for OpenAI models, the
Anthropic token counting API for Claude, etc. This tool is for quick estimates
when you don't want to leave your browser.