Skip to main content
Home/Tools/Token Counter

Free AI Token Counter

Count tokens for GPT-4.1, Claude, Gemini, and Llama. Exact counts for OpenAI models. Estimated within 2-3% for others. No signup, no API key.

Context window0 / 128K tokens (< 0.01%)
OpenAI·128K ctx·Exact
Tokens
Words
Characters
Chars / token
Cost estimate
Input cost
Output (same length)
$2.5/M input · $10/M output

Model Comparison

ModelContextInput / 1MOutput / 1M
GPT-4.1OpenAI
1M$2$8
GPT-4.1 MiniOpenAI
1M$0.4$1.6
GPT-4.1 NanoOpenAI
1M$0.1$0.4
GPT-4oOpenAI
128K$2.5$10
GPT-4o MiniOpenAI
128K$0.15$0.6
o3OpenAI
200K$10$40
o4-miniOpenAI
200K$1.1$4.4
Claude Opus 4.7Anthropic
200K$15$75
Claude Sonnet 4.6Anthropic
200K$3$15
Claude Haiku 4.5Anthropic
200K$0.8$4
Gemini 2.5 ProGoogle
1M$1.25$10
Gemini 2.5 FlashGoogle
1M$0.3$1.5
Gemini 2.0 FlashGoogle
1M$0.1$0.4
Llama 4 ScoutMeta
10MFreeFree
Llama 4 MaverickMeta
1MFreeFree

Pricing as of April 2026. Click any row to select that model. Verify current rates at each provider's pricing page before estimating production costs.

How AI Tokenization Works

AI models don't read words. They read tokens. A token is a chunk of text, typically 3-4 characters for English prose. "unbelievable" becomes three tokens: "un", "belie", "vable". Common words like "the" are a single token. Numbers, punctuation, and whitespace each become their own tokens.

OpenAI's GPT-4o and GPT-4.1 use the o200k_base tokenizer with a 200,000-token vocabulary. GPT-4 used cl100k_base with 100,000 tokens. Anthropic and Google use their own tokenizers, so the same text produces slightly different counts. That's why this tool shows exact counts for OpenAI models and estimates for Claude and Gemini.

Context windows matter because every API call has a hard limit on combined input and output tokens. GPT-4o's 128,000-token context fits about 96,000 English words. If your prompt plus expected output exceeds that limit, the model truncates or errors. Llama 4 Scout's 10 million token context window can fit entire codebases.