LLM Token Counter and Cost Calculator
LLM APIs charge per token. A token is roughly 3-4 characters of English text, though the exact split depends on the model’s tokenizer. Paste your prompt here to get an exact token count (for OpenAI models) or a close estimate (for Claude and Gemini), plus the cost per request at current API prices.
How to Use
- Select a model from the dropdown (grouped by provider)
- Paste or type text into the input area
- View token count and cost estimates in the stats panel
Understanding Tokens
Language models do not process text character by character. Instead, they use a tokenizer to split text into tokens, chunks of varying length that the model treats as individual units. Common English words are often a single token, while uncommon words or text in other languages may be split into multiple tokens.
The tokenization process uses Byte Pair Encoding (BPE), which learns common byte patterns from training data. This means that frequently occurring words or subwords get their own token, while rare text requires more tokens to represent.
Pricing Notes
Prices shown are standard API rates as of mid-2026. Actual costs may vary based on batch pricing, prompt caching discounts, or enterprise agreements. Most providers offer significant discounts for cached prompts (up to 90% off input costs) and batch API usage (50% off).
Input and output tokens are priced differently because generating output requires more computation than processing input. Output tokens are typically 2-5x more expensive than input tokens.
If you’re injecting JSON into a prompt, minify it first with the JSON Formatter because whitespace and indentation cost tokens. Trimming a prompt? Paste both versions into the Diff Checker to see exactly what changed.