LLM Token Calculator

Convert between tokens, words, and characters for any LLM. Instantly estimate API costs for GPT-4, Claude, Gemini, and Llama. Paste your prompt and see the cost before you send it.

Updated June 2026 · How this works

How It Works
The formula, explained simply

Large language models do not process words or characters — they process tokens, which are sub-word units generated by a tokeniser. Common words are usually one token; rare words are split into two or more. The word "figuring" might be one token, while "tokenisation" might be split into "token", "is", "ation".

This calculator uses the standard approximation: 1 token ≈ 4 characters ≈ 0.75 words for English prose. It is accurate to within 5–10% for typical prompts. Code, URLs, and non-English text may differ.

API providers charge separately for input tokens (your prompt, context, and system instructions) and output tokens (the model's response). Output tokens typically cost 3–5× more than input tokens.

When To Use This
Right tool, right situation

Use this calculator when: estimating API costs before building a product; comparing model pricing for a specific use case; checking whether a document fits in a context window; or planning your LLM budget for a given call volume.

When to use something else: For exact token counts in production, use the provider's official tokeniser. OpenAI's tiktoken library is free and accurate to the token. For cost tracking in production, use your provider's usage dashboard.

Common Mistakes
Why results sometimes look wrong

Ignoring system prompts in cost estimates. Your system prompt runs on every single API call. A 1,000-token system prompt on 10,000 daily calls adds 10M extra tokens — ~$25/day on GPT-4o.

Using GPT-4 class models for simple tasks. For classification, extraction, or simple Q&A, GPT-3.5 Turbo or Claude Haiku deliver 90% of the quality at 5–20% of the cost.

Not accounting for conversation history. Multi-turn chatbots resend the full conversation on every turn. A 10-turn conversation resends turns 1–9 as context for turn 10. Costs grow quadratically without a sliding window or summarisation strategy.

Treating token estimates as exact. This calculator approximates. For billing-critical production work, use the model provider's official tokeniser library (tiktoken for OpenAI).

The Math
Worked examples and deeper derivation

Token cost = (input_tokens / 1,000,000) × input_price + (output_tokens / 1,000,000) × output_price

Input tokens ≈ character_count / 4. Output tokens ≈ expected_words / 0.75.

Context window matters: every token in your context (system prompt, conversation history, documents) adds to input costs. A 128K context window can hold ~96,000 words — useful for long-document analysis, but filling it costs proportionally more.

At 10,000 API calls/day with a 500-word prompt, you consume ~6.67M input tokens daily. On GPT-4o at $2.50/MTok, that is $16.75/day ($508/month) in input costs alone — before output tokens. Model selection is the biggest cost lever at scale.

Short ChatGPT prompt
{'Prompt length': '~50 words', 'Model': 'GPT-4o', 'Expected output': '200 words'}
≈67 input tokens + 267 output tokens = ~$0.0028 total
Full document analysis
{'Prompt length': '~5,000 words', 'Model': 'Claude 3.5 Sonnet', 'Expected output': '500 words'}
≈6,667 input tokens + 667 output tokens = ~$0.030 total
High-volume batch processing
{'Prompt length': '~500 words', 'Model': 'GPT-3.5 Turbo', 'Expected output': '100 words'}
≈667 + 133 tokens ≈ $0.0005 per call → $5 per 10,000 calls

Common questions

How many tokens is 1000 words?
Roughly 1,333 tokens. The standard approximation for English prose is 1 token per 0.75 words, so 1,000 words ≈ 1,333 tokens. Technical content, code, and non-English text tokenise differently — code often runs higher, Chinese/Japanese characters lower.
How are LLM API costs calculated?
Most LLM APIs charge separately for input tokens (your prompt + context) and output tokens (the model's response). You pay per 1 million tokens (MTok). A typical GPT-4o call with a 500-word prompt and 300-word response would cost roughly $0.005 at current pricing.
Why do token counts vary between models?
Each model uses its own tokeniser (vocabulary of sub-word units). OpenAI uses tiktoken (cl100k_base for GPT-4), Claude uses a similar byte-pair encoding. The same text may tokenise slightly differently across models, but the 0.75 words-per-token approximation holds across most English-language models.

Need something this doesn't cover?

Suggest a tool — we'll build it →