🪙
Developer/LLM Token & Cost Calculator

LLM Token & Cost Calculator

Estimate token counts and API costs for OpenAI, Anthropic, Google, Meta & DeepSeek models.

18 MODELS10 modelsAPI pricingToken estimateContext usage
0 chars · 0 words
08K16K32K
🔢
Paste text and select models to see token estimates
Data Source & Legal Disclaimer
Effective: Pricing as of August 2026 (subject to change)Last updated: 2 weeks agoUpdate: Manual review
Sources: OpenAI Pricing · Anthropic Pricing · Google AI Studio Pricing · DeepSeek Pricing · Meta Llama — Together AI Pricing

LLM API prices are per 1M tokens as of June 2026 and may change without notice. Token estimates use model-specific chars-per-token ratios and may vary ±10-20% from actual counts.

See all data sources & update policy →

How tokenizers chop text and price API calls — illustrated

LLMs don't read characters — they read tokens. A tokenizer (BPE or SentencePiece, e.g. GPT's cl100k_base/o200k_base, Claude's tokenizer, Gemini's SentencePiece) splits text into subword units, and English averages roughly 4 characters per token (CJK and dense code can differ). This tool estimates input tokens as ceil(chars ÷ charsPerToken) for each model, then computes cost as tokens ÷ 1,000,000 × per-1M price for input and output and sums them. It also shows what fraction of the model's context window the call would consume.

Text → subword tokens → tokens ÷ 1M × price
The quick brown fox jumps over the lazy dogThequickbrownfox+ 5 more≈ 9 tokens · English averages ≈ 4 chars/tokencost = (tokens ÷ 1M) × price-per-1Minput cost + output cost, summedMODELSgpt-4oBPE · o200k_baseclaude-4-sonnetClaude tokenizergemini-2.5-proSentencePieceeach: own c/t + $/1Mcontext % = (input + output) ÷ context window × 100

A token is often a whole common word, or a subword chunk of a longer word. Because each model ships its own tokenizer and its own per-1M prices, the same prompt yields slightly different token counts and costs across providers.

Pricing a prompt before you ship the API call

Ken, an app developer, is about to call an LLM endpoint with a 1,024-character prompt and wants to know which model is cheapest before the invoice lands.

  1. Paste the prompt:1,024 chars ÷ ~4 chars/token ≈ 256 input tokens (English text)
  2. Set output budget:500 output tokens via the slider — the completion allowance
  3. Compare models:Rows sort by total cost; input and output priced separately per model
  4. Watch context %:(input + output) ÷ context window × 100 — flagged red past 80%
↩ Back to calculator

To calculate token costs: enter your expected token usage and select a provider (OpenAI, Anthropic, Google) — the tool compares per-token pricing and projects monthly costs.

FreeToolHub Token Calculator is a free browser-based tool that estimates API token costs across LLM providers, no signup.

About this tool

What is this tool?

Count tokens and estimate API cost for GPT-4o, Claude, and Gemini models. Free, instant, no signup. Compare LLM pricing in one click.

10 modelsAPI pricingToken estimateContext usage

What Is the LLM Token Calculator?

This calculator estimates how many tokens your text consumes across the major language models and what those tokens cost at current API prices. Paste or type your prompt, and the tool estimates token counts using each family's typical characters-per-token ratio, roughly four characters per token for English on GPT-class models, then projects input cost, and, when you add an expected response length, output cost per 1,000 calls. A comparison table lists 12-plus models including GPT-4o, GPT-4o mini, Claude, Gemini, and open-weight Llama options with their input and output rates, so you can see at a glance that identical workloads can differ by 10 to 50 times in price between frontier and small models. A context-window bar shows how far your text fills each model's context.

Who Should Use This Tool?

Developers budgeting an AI feature before launch estimate monthly spend by pricing representative prompts instead of waiting for a surprise invoice. Prompt engineers compare the token weight of verbose versus compressed instructions, since system prompts ride along on every single call. Product managers choosing between models see when the cheap model handles the job and where the frontier model earns its premium. Content teams feeding long documents learn where chunking becomes mandatory. Students and researchers estimating thesis-scale batch runs get order-of-magnitude budgets. Anyone switching providers after a price change re-prices their existing prompt library in one paste.

How Does It Work?

(1) Paste your text; live counts update as you type, showing characters, words, and estimated tokens per model family. (2) Add expected output tokens if you want full round-trip cost, output tokens typically cost 3 to 5 times input on the same model. (3) Set calls per day or month to scale unit cost into a budget. (4) Read the model table: each row shows that model's token estimate for your text, input and output price per million tokens, and your projected cost, sorted so the cheapest capable option surfaces. A context gauge marks what fraction of each model's window your prompt consumes, flagging where long-context degradation and cost both climb.

Why Do Token Counts Differ Between Models?

Each model family ships its own tokenizer, the byte-pair encoder that splits text into tokens, and the differences are not cosmetic. The same English paragraph can differ 10 to 20 percent in token count between GPT and Claude tokenizers, and the gaps widen on non-English text, where one CJK character may cost one token or fragment into multiple. Code tokenizes differently again, with whitespace-sensitive languages sometimes inflating counts. Vendors bill by their own tokenizer, so the number that matters is the provider's, and this tool reports per-family estimates for exactly that reason. Practical levers follow: compress system prompts, drop redundant JSON fields, batch short requests, cache repeated prefixes where the API supports prompt caching, and route easy traffic to small models, the five moves that typically cut LLM bills by half before touching quality.

Frequently Asked Questions

How many words are in a token for GPT and Claude?

For English text, roughly four characters or 0.75 words per token on both GPT and Claude tokenizers. Non-English text, especially CJK languages, can consume 1–3 tokens per character.

How do I calculate my LLM API cost?

Multiply input tokens by the input rate, output tokens by the output rate, and scale by call volume. Output tokens typically cost 3–5x input on the same model — paste your prompt into the calculator for exact figures across 12+ models.

Why do token counts differ between models?

Each model family uses its own tokenizer. The same paragraph can differ 10–20% between GPT and Claude tokenizers, and vendors bill by their own tokenizer — so budget with per-family estimates, not one universal count.

How can I reduce my LLM API bill?

Compress system prompts, cache repeated prefixes where supported, batch short requests, route easy traffic to small models, and strip redundant JSON fields. Together these typically cut spend by half before touching output quality.

How accurately does it count tokens for AI models?

It uses model-specific tokenization rules (GPT-4o uses o200k_base at ~4 chars/token; Claude uses a similar BPE at ~3.8 chars/token). Paste your text to get exact token counts for input and output, then multiply by current API rates. A 1,000-word document is roughly 1,300-1,400 tokens depending on the model.

How much will my AI API usage cost per month?

Enter your average prompt length, response length, and daily request volume. At GPT-4o rates ($2.50/1M input, $10/1M output tokens), 1,000 requests/day with 500-token prompts and 800-token responses costs approximately $117/month. The tool compares costs across GPT-4o, Claude, Gemini, and DeepSeek simultaneously.

Other names for this tool

This tool is also known by these tasks — each link opens the same tool with a focused guide:

Related tools

Joke of the Day
Sep 6

What do you call a crab that plays baseball?

100% Free, Forever

Keep Tools Free for Everyone

No paywalls, no signups, no data sold. Built by a solo developer who believes useful tools should be accessible to everyone.

Support me on Ko-fi— keep tools free

100% of proceeds go towards hosting & building more free tools.