LLM Token & Pricing Calculator
Estimate token count and cost across GPT-4o, Claude 3.5, Gemini, and Llama. Supports text, code, and JSON inputs.
Input
How token counting works
This tool uses a tokenizer approximation based on GPT-4's cl100k_base encoding. Real token counts vary slightly by model. For exact counts, use the provider's own tokenizer.
Supported models
- GPT-4o / GPT-4o-mini โ OpenAI's latest flagship models
- Claude 3.5 Sonnet / Haiku โ Anthropic's Claude models
- Gemini 1.5 Pro / Flash โ Google's Gemini models
- Llama 3 / 3.1 โ Meta's open-source models
- DeepSeek V3 / R1 โ DeepSeek models
About LLM Token Calculator
Tokens are the chunks of text that language models read and generate; roughly one token equals about four characters or three-quarters of an English word. Because providers bill per token on both input and output, longer prompts and responses translate directly into higher API costs. This tool estimates the token count of your text and projects the cost across common models so you can budget before you build.
Use it before drafting a prompt, selecting a model, or checking whether your input fits inside a model's context window. Keep in mind that every provider uses its own tokenizer โ the estimate here is based on GPT-4's cl100k_base encoding โ so treat the numbers as a close approximation and verify exact counts with the provider's own tokenizer when precision matters.