TC
TokenCost
Free · No signup · 35+ models

Count tokens.
Compare costs.

Instant token counting and API cost estimation across OpenAI, Anthropic, Google, xAI, Meta, Mistral, and DeepSeek.

What are tokens?

Tokens are the basic units that LLMs process. A token can be a word, part of a word, or a single character. In English, one token is roughly 4 characters or 0.75 words. Different models use different tokenizers, producing different counts for the same text.

How is cost calculated?

LLM APIs charge per token with separate rates for input (your prompt) and output (the response). Prices are quoted per million tokens. Total cost = (input tokens × input rate) + (output tokens × output rate).

Why do counts differ?

Each model family uses its own tokenizer. OpenAI's GPT-4o and GPT-5 use o200k_base, while earlier models use cl100k_base. This tool uses exact tokenizers for OpenAI and close approximations for other providers.

Supported models

GPT-5.4, GPT-5.2, GPT-4.1, o3, o4-mini, Claude Opus 4.6, Claude Sonnet 4.6, Gemini 3.1 Pro, Gemini 2.5 Pro, Grok 4, Llama 4 Maverick, Mistral Large 3, DeepSeek V3.2, and many more.