Local LLM utility

LLM Token Counter & API Cost Calculator

Paste a prompt to count its tokens and compare what one call — or a month of calls — costs across Claude, GPT, Gemini, Grok, and DeepSeek. Counting runs locally in your browser; your text is never uploaded.

No upload. Tokens are counted on this device.

Prompt text

0 Tokens
0 Words
0 Characters

Loading tokenizer… counts are rough estimates until it finishes.

Cost comparison

Standard pay-as-you-go API prices, cheapest total first. Batch and cache discounts are excluded.

Model Context Input $/1M Output $/1M Input cost Output cost Total
DeepSeek V4 Flash ※ Cheapest DeepSeek 1M $0.14 $0.28 $0 $0 $0
Grok 4 Fast ※ Cheapest xAI 2M $0.20 $0.50 $0 $0 $0
DeepSeek V4 Pro ※ Cheapest DeepSeek 1M $0.435 $0.87 $0 $0 $0
Gemini 3.1 Flash-Lite ※ Cheapest Google 1M $0.25 $1.50 $0 $0 $0
Claude Haiku 4.5 ※ Cheapest Anthropic 200K $1.00 $5.00 $0 $0 $0
Gemini 3.5 Flash ※ Cheapest Google 1M $1.50 $9.00 $0 $0 $0
GPT-5 Cheapest OpenAI 400K $1.25 $10.00 $0 $0 $0
GPT-4o Cheapest OpenAI 128K $2.50 $10.00 $0 $0 $0
Gemini 3.1 Pro ※ Cheapest Google 1M $2.00 $12.00 $0 $0 $0
GPT-5.4 Cheapest OpenAI 400K $2.50 $15.00 $0 $0 $0
Claude Sonnet 4.6 ※ Cheapest Anthropic 1M $3.00 $15.00 $0 $0 $0
Grok 4 ※ Cheapest xAI 256K $3.00 $15.00 $0 $0 $0
Claude Opus 4.8 ※ Cheapest Anthropic 1M $5.00 $25.00 $0 $0 $0
GPT-5.5 Cheapest OpenAI 400K $5.00 $30.00 $0 $0 $0

※ Anthropic, Google, xAI, and DeepSeek use their own tokenizers, so their real token counts can differ from o200k_base by roughly ±10–20%. Treat those rows as close estimates and check the provider's own counter before committing to a budget.

Prices last verified: 2026-06-11 · Official pricing pages: Anthropic · OpenAI · Google Gemini · DeepSeek · xAI

FAQ

What is a token?

LLMs read text in small chunks called tokens rather than whole words. In English, one token is roughly 4 characters or three quarters of a word; Chinese usually takes one or more tokens per character. API providers bill by the number of input and output tokens, which is why the same prompt costs different amounts on different models.

How does this counter work, and is it accurate?

It runs the open-source o200k_base tokenizer (the encoding used by current OpenAI models) entirely in your browser, so OpenAI counts are exact. Anthropic, Google, xAI, and DeepSeek use their own tokenizers, so their rows are close estimates — typically within ±10–20% of the real count.

Is my text uploaded anywhere?

No. The tokenizer is downloaded once as a static file and all counting happens locally on your device. Nothing you type or paste leaves the browser.

What do the cost numbers include?

Standard pay-as-you-go API prices per million tokens, multiplied by your input token count, estimated output length, and number of requests. Volume discounts, batch APIs, prompt caching, and long-context surcharges are excluded, so real bills can be lower or slightly higher.