Token Calculator for LLMs

Calculate tokens and estimate API costs for OpenAI GPT, Anthropic Claude, and Google Gemini

Input Text

0
Tokens
0
Words
0
Characters (no spaces)
0
Total Characters

Pricing by Model

ModelProviderContextInput/1MInput(cached)/1MOutput/1MInput PriceInput(cached)Output Price
GPT-4.1OpenAI/Azure1M$2$0.5$8$0.0000$0.0000$0.0000
GPT-4.1 miniOpenAI/Azure1M$0.4$0.1$1.6$0.0000$0.0000$0.0000
GPT-4.1 nanoOpenAI/Azure1M$0.1$0.025$0.4$0.0000$0.0000$0.0000
o3OpenAI/Azure200K$2$0.5$8$0.0000$0.0000$0.0000
o4-miniOpenAI/Azure200K$1.1$0.275$4.4$0.0000$0.0000$0.0000
GPT-4oOpenAI/Azure128K$5$2.5$20$0.0000$0.0000$0.0000
GPT-4o-miniOpenAI/Azure128K$0.6$0.3$2.4$0.0000$0.0000$0.0000
Claude Opus 4Anthropic200K$15-$75$0.0000-$0.0000
Claude Sonnet 4Anthropic200K$3-$15$0.0000-$0.0000
Claude Sonnet 3.7Anthropic200K$3-$15$0.0000-$0.0000
Gemini 2.5 Flash PreviewGoogle1M$0.15-$0.6$0.0000-$0.0000
Gemini 2.5 Pro PreviewGoogle1M$1.25-$10$0.0000-$0.0000
Gemini 2.0 FlashGoogle1M$0.1-$0.4$0.0000-$0.0000
Gemini 2.0 Flash-LiteGoogle1M$0.075-$0.3$0.0000-$0.0000

📝 Important Notes

  • • Token Estimation: This calculator uses an approximate estimation (~1 token per 4 characters). For exact counts, use the official tokenizer libraries.
  • • Pricing: All prices are per 1 million tokens. Actual costs may vary based on your usage and pricing tier.
  • • Cached Input: Some models (like OpenAI) offer reduced pricing for cached/repeated inputs. Not all models support this feature.
  • • Context Window: The maximum number of tokens a model can process in a single request (including both input and output).
  • • Privacy: All calculations are performed locally in your browser. Your text never leaves your device.