Token Counter & Cost Estimator
Count tokens and estimate API costs for GPT-4, Claude, and Gemini
0 characters | 0 words
Maximum 500,000 characters. All processing happens in your browser.
Total Tokens (GPT-4)
0
Using cl100k_base encoding
Estimated Cost (Input)
$0.00
GPT-5 pricing ($1.25/1M tokens)
Model Comparison
Model
Tokens
Input Cost
Context Window
GPT-5
0
$0.00
128K
GPT-4o
0
$0.00
128K
Claude Opus 4.5
0
$0.00
200K
Claude Sonnet 4
0
$0.00
200K
Gemini 2.5 Pro
0
$0.00
1M
Gemini 2.0 Flash
0
$0.00
1M
Context Window Usage
About Token Counting
Tokens are the basic units that AI models use to process text. A token can be a word, part of a word, or punctuation.
- English text: ~1 token per 4 characters or ~0.75 tokens per word
- Code: Often more tokens due to special characters and syntax
- Other languages: May use more tokens per character
Note: This tool uses OpenAI's tiktoken (cl100k_base) encoding. Claude and Gemini use different tokenizers, so counts are estimates based on typical ratios.