Estimate tokens and calculate API costs for GPT-4, Claude, Gemini, Llama, and other LLMs.
Tokens are the basic units that large language models (LLMs) use to process text. A token can be a word, part of a word, or a punctuation mark. For example, "Hello, World!" might be 4 tokens: "Hello", ",", " World", "!".
This tool provides an estimate based on typical tokenization patterns. For English text, roughly 1 token ≈ 4 characters or ≈ 0.75 words. JSON has overhead from brackets, quotes, and colons which can increase token count.
We support token estimation for OpenAI (GPT-4, GPT-3.5), Anthropic (Claude 3), Google (Gemini), Meta (Llama 3), and Mistral models with up-to-date pricing.