AI Token Calculator
Estimate AI tokens, words, characters, context usage, and per-request cost for popular AI models.
Token counts are estimates. Actual tokenization varies by model.
Estimated tokens
78
42 input + 36 output
Estimated cost
$0.000074
Input $0.000017 + output $0.000058
Context usage
0.0%
Of 1,047,576 token window
Words
48
26 prompt + 22 response
Characters
312
Prompt + response, includes whitespace.
Input tokens
42
From prompt text.
Output tokens
36
From response sample.
Selected model
GPT-4.1 Mini
OpenAI
Input cost
$0.000017
$0.40 / 1M input tokens
Output cost
$0.000058
$1.60 / 1M output tokens
Context window
1,047,576 tokens
Maximum prompt + response size.
Context Window Usage
78 of 1,047,576 tokens used for this request.
Live token estimates
Tokens, words, characters, and per-request cost update as you type.
Model presets
OpenAI, Anthropic, Gemini, and custom pricing presets are included.
Local processing
Prompts never leave your browser. No API key required.
Dynamic Cost Insights
What Is an AI Token?
A token is the smallest unit of text a large language model processes.
One token usually corresponds to roughly 4 English characters or about 3/4 of a word.
Common words are a single token. Rare words, code, emoji, and non-Latin scripts often split into multiple tokens.
Providers bill per million tokens for both input prompt tokens and output response tokens.
How This Calculator Works
Token count is estimated from character count using a 4-characters-per-token heuristic.
Input tokens come from the prompt field. Output tokens come from the response field, or from the expected output override if set.
Cost is computed per million tokens using the price stored for the selected model.
Context usage compares total tokens against the model's published context window.
Token Estimation Formula
Why Token Counts Vary
Input vs Output Tokens
Input tokens are everything the model reads: system prompt, user message, retrieved context, and tool definitions.
Output tokens are everything the model writes back. Output rates are often higher than input rates.
Long retrieval-augmented prompts can make input the dominant cost. Long generations make output dominate.
Caching, batching, and prompt compression can reduce costs, but this calculator uses standard non-cached pricing only.
Understanding Context Windows
Limitations
Frequently Asked Questions
Related tools