What Are LLM Tokens?
Tokens are the subword units that language models actually process — not characters, not words. A single token is roughly four English characters or about three-quarters of a word, but the exact breakdown depends on the model. The same text produces different token counts across GPT, Claude, and Gemini because each one uses a different tokenizer, so a payload that fits comfortably in one model may overflow another.
Exact vs Estimated Counts
For OpenAI models this tool uses gpt-tokenizer, a JavaScript port of OpenAI's tiktoken library, so the counts match what the API bills. For Claude, Gemini, and Llama we run a shape-aware character-based estimate that lands within about 5–10% of the real value. For precise Anthropic counts, use the count_tokens endpoint.
How Token Pricing Works
Every major LLM API bills separately for input tokens (what you send in the prompt) and output tokens (what the model returns). Output tokens typically cost 2–5× more than input, so a small prompt with a long response can cost far more than a long prompt with a short response. Knowing the input token count up front lets you estimate the whole call before spending anything on it.
Tips to Reduce Token Usage
- Use TOON format instead of JSON for structured data in prompts — try the JSON ↔ TOON Converter to see the savings on your specific payload.
- Trim unnecessary whitespace, comments, and multi-shot examples from system prompts. Every example is being paid for on every request.
- Prefer concise instructions: "Respond in three bullet points" beats a paragraph of formatting rules.
- Enable prompt caching (supported by both Anthropic and OpenAI) for repeated system prompts — the cached tokens are billed at a fraction of the normal input rate.
- Pick the right model. Don't use GPT-4o for tasks that GPT-4o mini handles well; don't use Claude Opus for anything Haiku can answer.
Privacy
Your text never leaves your browser. Tokenization runs entirely client-side using gpt-tokenizer — no data is sent to any API or server.