LLM Token Counter & Cost Calculator
Count tokens and estimate API costs for GPT-4o, Claude, Gemini, and other LLMs. Uses BPE tokenization (cl100k_base).
Model Pricing Comparison
| Model | Input $/1M | Output $/1M | Context |
|---|---|---|---|
| $2.00 | $8.00 | 1M | |
| $0.40 | $1.60 | 1M | |
| $0.10 | $0.40 | 1M | |
| $2.50 | $10.00 | 128K | |
| $0.15 | $0.60 | 128K | |
| $2.00 | $8.00 | 200K | |
| $1.10 | $4.40 | 200K | |
| $1.10 | $4.40 | 200K | |
| $15.00 | $75.00 | 200K | |
| $3.00 | $15.00 | 200K | |
| $0.80 | $4.00 | 200K | |
| $1.25 | $10.00 | 1M | |
| $0.15 | $0.60 | 1M | |
| $0.10 | $0.40 | 1M | |
| $0.50 | $0.50 | 1M | |
| $0.20 | $0.20 | 524K | |
| $2.00 | $6.00 | 128K | |
| $0.27 | $1.10 | 131K | |
| $0.55 | $2.19 | 131K |
About Token Counting
This tool uses BPE tokenization (cl100k_base encoding), which is the tokenizer used by GPT-4, GPT-4o, and GPT-4.1 models. Token counts for other providers (Anthropic, Google, Meta) are approximations — typically within 5-15% of actual counts.
Pricing reflects publicly listed API prices as of March 2026. Actual costs may vary with batch pricing, prompt caching, fine-tuned models, or volume discounts. Output tokens are estimated using your selected output:input ratio.
What is a token? Tokens are the basic units LLMs process text in. A token is roughly 3-4 characters or ¾ of a word in English. Code, non-English text, and special characters typically use more tokens per character.
Related Inspect Tools
Docker Compose Validator
Validate and format Docker Compose files — check services, networks, volumes, and dependencies
HTTP Status Codes
Complete HTTP status code reference — 1xx, 2xx, 3xx, 4xx, 5xx with detailed explanations and use cases
Date Format Tester
Test date format patterns for strftime, date-fns, Moment.js, Go, and Java with live preview and token reference
Dockerfile Validator
Validate and lint Dockerfiles for syntax errors, security issues, best practices, and layer optimization