AI Tools

LLM Token Counter

Estimate tokens for ChatGPT, Claude and Gemini prompts — with cost math for popular models.

Tool

Estimate

—
Paste text and press Count.

About the LLM Token Counter

The LLM Token Counter runs entirely in your browser — your ideas and text never leave your machine. Fill in the fields, generate, copy the result.

Tokens are how LLMs count — roughly ¾ of an English word, and the unit every API bill and context window is measured in. A 120,000-word contract is ~160,000 tokens: over most models' context limits and several dollars per pass. This estimator gives you a fast answer (~words × 1 ÷ chars-per-token) plus the dollar cost of sending it.

How to use this tool

  1. Paste the full text you plan to send.
  2. Select the model — pricing per million tokens updates the cost rows.
  3. Adjust words-per-token if you paste code or non-English text (it tokenizes denser).
  4. Read tokens, context usage and estimated cost for one call.

Why exact counts differ

Tokenizers are model-specific: GPT-4 uses cl100k_base, newer models use o200k, Claude and Gemini have their own. Common English words merge into single tokens; rare words, emoji and other scripts split into several. This tool's estimate is within a few percent for English prose — good for budgeting, not for writing tests against an API limit.

Context math that matters

Text size≈ TokensWhat fits
1 page (500 words)≈ 650Trivial — fine anywhere
This guide (~800 words)≈ 1,100Fine even on free tiers
300-page book≈ 120,000Needs a 200k context model
Codebase dump, 50 files300k–1MWon't fit — summarize first

Remember the output counts too: a long answer can double your bill, and reasoning models (o3, DeepSeek-R1) bill the hidden thinking tokens separately — often 10× the visible reply.

Who is this tool for?

Developers budgeting API costs before shipping a feature, power users hitting context limits, and teams estimating monthly LLM spend.

Prompt tip

For cost control, the biggest lever is not token price — it is prompt caching. Re-sending the same system prompt repeatedly? Cache it and cut input cost by up to 90% on supporting providers.

Frequently asked questions

No — it is an estimate calibrated for English. For exact counts use each provider's tokenizer (tiktoken for OpenAI) or a one-token API probe.
Output tokens, reasoning tokens, retries and cached-token pricing all add up. Estimate input and output separately — output is typically 4–10× the input price.
Yes — image tokens depend on resolution (roughly 85–1,100+ tokens per image for GPT-4o vision). Text-only estimates won't include them.

Related tools

Guides for this tool