Skip to main content
TokenCost logoTokenCost

Count tokens.
Compare costs.

Instant usage analysis and API cost estimation across OpenAI, Anthropic, Google, xAI, Meta, Mistral, and DeepSeek.

Try:System PromptRAG QueryChat MessageCode ReviewSummarize
0
Tokens
0
Characters
0
Words

How to Count Tokens

  1. 1

    Enter your text

    Paste or type your prompt into the text area. Pick a preset prompt if you want a quick start.

  2. 2

    View counts instantly

    Usage figures update in real time for every model. Sort by any column to find the cheapest or most cost-efficient option.

  3. 3

    Compare costs across providers

    See input and output cost for each model side by side. Filter by provider to narrow your comparison.

Why Use This Counter

  • Exact counts for OpenAI models using official cl100k_base and o200k_base tokenizers
  • 180+ models from 30 providers, OpenAI, Anthropic, Google, xAI, Meta, Mistral, DeepSeek, and more
  • Runs entirely in your browser. Your text never leaves your machine.
  • Sort by input cost, output cost, or prompt size to find the best deal
  • Shareable URLs, bookmark or send a link with your text and settings pre-filled

Common Use Cases

Prompt engineering

Check token counts as you iterate on prompts. Stay under context limits and optimize for cost.

Budget planning

Estimate API costs before committing to a provider. Compare per-token pricing across models.

Context window management

Make sure your system prompt, examples, and user input fit within the model's context limit.

Provider migration

Switching from GPT to Claude? See how token counts and costs compare before you migrate.

Related Tools

Frequently Asked Questions

Common questions about token counting and LLM pricing

What is a token in the context of LLMs?
A token is the smallest unit of text that a language model processes. In English, one token is roughly 4 characters or about 0.75 words. Different models use different tokenizers, so the same text can produce different token counts depending on the model.
How accurate is this token counter?
For OpenAI models, the counts are exact, this tool uses the same tokenizers (cl100k_base and o200k_base) that OpenAI uses internally. For other providers like Anthropic and Google, counts are close approximations based on similar tokenizer families.
Why do different models give different token counts?
Each model family has its own tokenizer with a unique vocabulary. GPT-4o and GPT-5 use o200k_base, while earlier GPT models use cl100k_base. Claude and Gemini have their own tokenizers. A word that's one token in one model might be split into two tokens in another.
Is this token counter free to use?
Yes, completely free with no signup or account needed. Token counting runs client-side in your browser, so your text is never sent to any server. There are no usage limits.
How is LLM API cost calculated from tokens?
LLM APIs charge separately for input tokens (your prompt) and output tokens (the model's response). Prices are quoted per million tokens. Total cost = (input tokens × input rate) + (output tokens × output rate).