AI Token Counter & Cost Estimator
Estimate LLM token usage and API cost for any prompt across 20+ current models — GPT-5.5, o3/o4-mini, Claude Opus 4.8 / Sonnet / Haiku, Gemini 3, Grok 4, DeepSeek, and Llama — instantly and privately in your browser. Filter by provider, compare per-model token counts, input/output pricing, and context-window fit, then project cost across many calls.
About this ToolHow it works, benefits & use casesTap to collapse
Knowing how many tokens a prompt will cost is the difference between a predictable AI feature and a surprise invoice — and pasting text into a half-dozen provider playgrounds to find out is slow. This tool estimates token usage and dollar cost for any text across 20+ current models in one screen: GPT-5.5, GPT-5.4, o3, o4-mini and the GPT-4.1 family from OpenAI; Claude Opus 4.8, Sonnet 4.6, and Haiku 4.5 from Anthropic; Gemini 3.1 Pro and the Gemini 3 Flash line from Google; Grok 4.3 and 4.1 Fast from xAI; DeepSeek V3 and R1; and Llama 4 — with provider filters and a hide-legacy toggle so you can focus on the models you actually ship. As you type or paste, it shows estimated tokens for your chosen model alongside live character, word, line, and byte counts, then renders a side-by-side comparison table where each row gives that model’s token count, input cost, output cost, total cost, and a green/amber/red bar showing how much of its context window your prompt plus expected output consumes. An adjustable "expected output tokens" stepper drives the output-cost column, and a "number of calls" stepper projects total spend at scale so you can budget a batch job or a per-user feature. Everything runs locally with no network requests, so prompts never leave your browser. Counts are heuristic estimates that account for whitespace, punctuation and symbol density (code packs more tokens), and CJK characters (roughly one token each) — close enough to budget with, but not a substitute for a provider’s exact tokenizer.
How to Use
- 1Paste or type your prompt, document, or any text into the input box — the estimate updates live as you type.
- 2Pick a primary model from the dropdown; the large readout shows its estimated token count plus chars, words, lines, and chars-per-token.
- 3Set "Expected output tokens" to reflect a typical response length — this drives the output-cost column for every model.
- 4Read the comparison table to see estimated tokens, input cost, output cost, total cost, and context-window fit for all models at once.
- 5Adjust "Number of calls" to project total spend across a batch, a per-user feature, or a daily volume.
- 6Copy, download, share, or pipe the Markdown summary table into another tool to capture the full per-model breakdown.
Key Benefits
- Compare token counts and cost across 20+ models from OpenAI, Anthropic, Google, xAI, DeepSeek, and Meta in one view
- Live token, character, word, line, and byte counts update instantly as you edit
- Realistic 2026 context windows and published input/output pricing per million tokens
- Context-fit bars flag when a prompt plus its expected output overflows a model’s window
- Cost-at-scale projection multiplies a single call by the number of calls you expect
- Smarter heuristic that adjusts for code, punctuation density, whitespace, and CJK text
- Fully private — runs in your browser with zero network calls, so prompts never leave the page
Common Use Cases
- Budgeting an LLM feature before launch by comparing per-call cost across candidate models
- Deciding whether a long document fits a model’s context window before sending it
- Estimating the monthly bill for a batch or per-user workload at a known call volume
- Choosing the cheapest model that still fits your prompt for a high-volume task
- Sanity-checking a system prompt’s size while iterating, without burning real API credits
Estimated tokens
GPT-5.4Estimates only. Counts are computed instantly and privately in your browser with no network calls. Real tokenizers use BPE/unigram vocabularies, so actual usage typically differs by ±10–20% (more for code or non-English text).
Paste a prompt, document, or any text to estimate tokens and cost.
Model comparison
23 of 23 models · 500 output tokens| Model | Tokens | Input | Output | Total | Context fit |
|---|---|---|---|---|---|
| 49 | $0.000245 | $0.015 | $0.0152 | 0.1%1,000k | |
| 49 | $0.000123 | $0.0075 | $0.007623 | 0.1%1,000k | |
| 49 | $0.000098 | $0.004 | $0.004098 | 0.3%200k | |
| 49 | $0.000027 | $0.0011 | $0.001127 | 0.3%200k | |
| 49 | $0.000098 | $0.004 | $0.004098 | 0.1%1,047.576k | |
| 49 | $0.00002 | $0.0008 | $0.00082 | 0.1%1,047.576k | |
| 49 | $0.000005 | $0.0002 | $0.000205 | 0.1%1,047.576k | |
| 49 | $0.000123 | $0.005 | $0.005123 | 0.4%128k | |
| 49 | $0.000007 | $0.0003 | $0.000307 | 0.4%128k | |
| 52 | $0.00026 | $0.0125 | $0.0128 | 0.1%1,000k | |
| 52 | $0.000156 | $0.0075 | $0.007656 | 0.1%1,000k | |
| 52 | $0.000052 | $0.0025 | $0.002552 | 0.3%200k | |
| 49 | $0.000098 | $0.006 | $0.006098 | 0%2,000k | |
| 49 | $0.000025 | $0.0015 | $0.001525 | 0.1%1,048.576k | |
| 49 | $0.000012 | $0.00075 | $0.000762 | 0.1%1,048.576k | |
| 49 | $0.000061 | $0.005 | $0.005061 | 0.1%1,048.576k | |
| 49 | $0.000015 | $0.00125 | $0.001265 | 0.1%1,048.576k | |
| 49 | $0.000061 | $0.00125 | $0.001311 | 0.2%256k | |
| 49 | $0.00001 | $0.00025 | $0.00026 | 0%2,000k | |
| 52 | $0.000007 | $0.00014 | $0.000147 | 0.4%128k | |
| 52 | $0.000029 | $0.001095 | $0.001124 | 0.4%128k | |
| 52 | $0.00001 | $0.000425 | $0.000435 | 0.1%1,000k | |
| 52 | $0.00001 | $0.0002 | $0.00021 | 0.4%128k |
- 49 tokin $0.000245out $0.0150.1%1,000k
- 49 tokin $0.000123out $0.00750.1%1,000k
- 49 tokin $0.000098out $0.0040.3%200k
- 49 tokin $0.000027out $0.00110.3%200k
- 49 tokin $0.000098out $0.0040.1%1,047.576k
- 49 tokin $0.00002out $0.00080.1%1,047.576k
- 49 tokin $0.000005out $0.00020.1%1,047.576k
- 49 tokin $0.000123out $0.0050.4%128k
- 49 tokin $0.000007out $0.00030.4%128k
- 52 tokin $0.00026out $0.01250.1%1,000k
- 52 tokin $0.000156out $0.00750.1%1,000k
- 52 tokin $0.000052out $0.00250.3%200k
- 49 tokin $0.000098out $0.0060%2,000k
- 49 tokin $0.000025out $0.00150.1%1,048.576k
- 49 tokin $0.000012out $0.000750.1%1,048.576k
- 49 tokin $0.000061out $0.0050.1%1,048.576k
- 49 tokin $0.000015out $0.001250.1%1,048.576k
- 49 tokin $0.000061out $0.001250.2%256k
- 49 tokin $0.00001out $0.000250%2,000k
- 52 tokin $0.000007out $0.000140.4%128k
- 52 tokin $0.000029out $0.0010950.4%128k
- 52 tokin $0.00001out $0.0004250.1%1,000k
- 52 tokin $0.00001out $0.00020.4%128k
Copy, download, share, or pipe the full per-model breakdown.
# Token & Cost Estimate Input: **194 chars**, 31 words, 1 lines, 194 bytes. Assumed output: **500 tokens**. | Model | Provider | Est. input tokens | Input $ | Output $ | Total $ | Context fit | | --- | --- | ---: | ---: | ---: | ---: | ---: | | GPT-5.5 | OpenAI | 49 | $0.000245 | $0.015 | $0.0152 | 0% (fits) | | ★ GPT-5.4 | OpenAI | 49 | $0.000123 | $0.0075 | $0.007623 | 0% (fits) | | o3 | OpenAI | 49 | $0.000098 | $0.004 | $0.004098 | 0% (fits) | | o4-mini | OpenAI | 49 | $0.000027 | $0.0011 | $0.001127 | 0% (fits) | | GPT-4.1 | OpenAI | 49 | $0.000098 | $0.004 | $0.004098 | 0% (fits) | | GPT-4.1 mini | OpenAI | 49 | $0.00002 | $0.0008 | $0.00082 | 0% (fits) | | GPT-4.1 nano | OpenAI | 49 | $0.000005 | $0.0002 | $0.000205 | 0% (fits) | | GPT-4o | OpenAI | 49 | $0.000123 | $0.005 | $0.005123 | 0% (fits) | | GPT-4o mini | OpenAI | 49 | $0.000007 | $0.0003 | $0.000307 | 0% (fits) | | Claude Opus 4.8 | Anthropic | 52 | $0.00026 | $0.0125 | $0.0128 | 0% (fits) | | Claude Sonnet 4.6 | Anthropic | 52 | $0.000156 | $0.0075 | $0.007656 | 0% (fits) | | Claude Haiku 4.5 | Anthropic | 52 | $0.000052 | $0.0025 | $0.002552 | 0% (fits) | | Gemini 3.1 Pro | Google | 49 | $0.000098 | $0.006 | $0.006098 | 0% (fits) | | Gemini 3 Flash | Google | 49 | $0.000025 | $0.0015 | $0.001525 | 0% (fits) | | Gemini 3.1 Flash-Lite | Google | 49 | $0.000012 | $0.00075 | $0.000762 | 0% (fits) | | Gemini 2.5 Pro | Google | 49 | $0.000061 | $0.005 | $0.005061 | 0% (fits) | | Gemini 2.5 Flash | Google | 49 | $0.000015 | $0.00125 | $0.001265 | 0% (fits) | | Grok 4.3 | xAI | 49 | $0.000061 | $0.00125 | $0.001311 | 0% (fits) | | Grok 4.1 Fast | xAI | 49 | $0.00001 | $0.00025 | $0.00026 | 0% (fits) | | DeepSeek V3 | DeepSeek | 52 | $0.000007 | $0.00014 | $0.000147 | 0% (fits) | | DeepSeek R1 | DeepSeek | 52 | $0.000029 | $0.001095 | $0.001124 | 0% (fits) | | Llama 4 Maverick | Meta | 52 | $0.00001 | $0.000425 | $0.000435 | 0% (fits) | | Llama 3.3 70B | Meta | 52 | $0.00001 | $0.0002 | $0.00021 | 0% (fits) | > Estimates only — generated locally with no network calls. Real tokenizers use BPE/unigram vocabularies, so actual counts typically differ by ±10–20% (more for code or non-English text).
How the estimate works
Each model family has a typical characters-per-token ratio (≈3.8 for Claude, ≈4.0 for GPT and Gemini). This tool starts from that ratio and refines it for whitespace runs, punctuation/symbol density (code packs more tokens), and CJK characters (counted ≈1 token each). Cost is then derived from each model’s published input/output price per million tokens, and the context-fit bar compares your prompt plus expected output against the model’s window. Nothing leaves your browser.
Was this tool helpful?
Share Your Experience
Help others discover this tool!
Related tools
- JSON Schema ⇄ Zod ConverterConvert JSON Schema to Zod and back — with strict mode for OpenAI/Anthropic structured outputs and function calling
- llms.txt GeneratorBuild a spec-compliant llms.txt (and llms-full.txt) so AI crawlers like ChatGPT, Claude & Perplexity understand your site
- Bearer Token GeneratorGenerate Bearer authentication tokens
- Design Token GeneratorPerceptual colour ramps + light/dark semantic tokens, live preview, WCAG audit — export CSS, Tailwind v4, W3C DTCG & more
- JWT DecoderDecode and inspect JWT tokens
- MCP Server Config GeneratorGenerate valid Model Context Protocol server config for Claude Desktop, Claude Code, Cursor, VS Code, Windsurf & Zed
They are heuristic estimates, not exact counts. Real models use byte-pair-encoding (BPE) or unigram tokenizers with vocabularies of 100,000+ entries that this tool cannot replicate without bundling each provider’s tokenizer. For ordinary English prose the estimate is usually within ±10–20%; expect more variance for source code, structured data, or non-English text. Use it to budget and compare, and confirm exact counts with the provider’s API or tokenizer when precision matters.
Each model family tokenizes text differently, so the same string maps to a different number of tokens. This tool reflects that by using a per-family characters-per-token ratio — roughly 3.8 for Claude and about 4.0 for GPT and Gemini — then refining it for whitespace, symbol density, and CJK characters. A model that packs fewer characters per token will report more tokens for identical input.

