Count tokens and calculate API costs for Claude, GPT-5, Gemini, and more — live, in your browser.
AI Token Counter & API Cost Calculator helps you complete this task in seconds directly in the browser without installing extra software.
Paste any text or prompt and instantly see its token count plus what it costs to send to every major AI model — Claude Sonnet 5, Claude Opus 4.8, GPT-5.1, GPT-4o, Gemini 2.5, DeepSeek, and Grok. GPT-family counts are exact (same open o200k tokenizer the models use); other providers are clearly-labeled estimates. Everything runs in your browser — your text is never uploaded.
Paste your prompt or document into the text box.
Read the live token, word, and character counts.
Set expected output tokens to compare the full request cost across models.
AI Token Counter & API Cost Calculator runs entirely in your browser: it takes your input, processes it on your device, and returns the result instantly — nothing is uploaded to a server. Count tokens and calculate API costs for Claude, GPT-5, Gemini, and more — live, in your browser.
GPT-5 and GPT-4o counts are exact — the tool runs OpenAI's open o200k tokenizer in your browser. Anthropic and Google keep their tokenizers private, so Claude and Gemini counts are estimates (Claude typically tokenizes 10–20% above o200k); Anthropic offers a free count_tokens API endpoint for exact numbers.
Cost = (input tokens ÷ 1M × input price) + (output tokens ÷ 1M × output price), using each provider's published per-million-token prices. The prices-as-of date is shown in the table, and each model page links to the provider's official pricing page.
No. The tokenizer runs entirely in your browser via WebAssembly-free JavaScript — your prompt never leaves your device.
For typical English text, 1 word ≈ 1.3 tokens and 1 token ≈ 4 characters. Code, non-English text, and unusual formatting tokenize less efficiently.