AI Token Calculator (Words to Tokens & LLM API Cost)
Estimate tokens for any text, price input and output tokens per request with editable model rates, and project the monthly API bill โ everything runs locally in your browser.
AI Token Calculator โ interactive calculator, computed instantly in your browser.
AI Tokens Explained: Counting Tokens, Pricing Models, and Cutting API Bills
What 100 Requests a Day Actually Cost
| Component | Math | Cost |
|---|---|---|
| Input: 800 tokens ร $3 / 1M | 800 รท 1,000,000 ร 3 | $0.00240 |
| Output: 400 tokens ร $15 / 1M | 400 รท 1,000,000 ร 15 | $0.00600 |
| Per request | $0.0024 + $0.0060 | $0.0084 |
| Monthly at 100 requests/day | $0.0084 ร 100 ร 30 | $25.20 |
Key Takeaway: Text nears one token per four characters โ a thousand words is about 1,330 tokens. Multiply tokens by the per-million rate for each half of the request, and small per-call costs become visible monthly bills long before they hurt.
Large language models do not read words โ they read tokens, the subword units a tokenizer carves text into, and every provider bills per million of them. An AI token calculator estimates those units from your text, prices input and output separately at editable rates, and projects what a request pattern costs across a month. Everything runs locally; no text leaves the browser.
1. What a Token Actually Is
Tokenizers use byte-pair encoding: common sequences like "the" or "ation" merge into single tokens, rare fragments split apart. For ordinary English the averages are stable โ one token covers about four characters or three-quarters of a word, so a thousand words run roughly 1,330 tokens. Punctuation splits cost extra, code tokenizes denser than prose, and Chinese or Japanese characters often map closer to one or two characters per token.
2. Input vs Output Pricing: Why the Two Numbers Differ
Providers price each direction separately. Input tokens โ your prompt, documents, history โ are processed in parallel and cost less; output tokens are decoded one at a time with full model compute, so completions typically run three to five times the input rate. A request of 800 input plus 400 output tokens at $3 and $15 per million costs 0.84 cents: trivial alone, $25 a month at a hundred calls a day.
3. Prompt Bloat, Context Windows, and Why Bills Climb
Every turn of a chat resends the conversation so far, so long threads grow quadratically โ a session that starts at 800 tokens can carry 20,000 by turn twenty. System prompts, tool definitions and attached documents stack on top inside the context window (128,000 to 200,000 tokens on mainstream models). Summarize a ten-page document into a call and you pay about 13,000 input tokens each time โ which is exactly where caching earns its keep.
- Measure first: paste real prompts here instead of estimating from word counts in your head.
- Watch the ratio: output tokens usually dominate the bill โ cap answer length where quality allows.
- Resend less: trim stale history and send only the turns the next request needs.
4. Six Reliable Ways to Cut an API Bill
Prompt caching discounts repeated context โ up to 90% off cached input tokens on major providers. Batch endpoints accept async jobs at half price. Swapping simple classification tasks to a small model cuts those calls by an order of magnitude. Beyond that: compress system prompts, use structured outputs instead of prose, and set per-key budgets so a runaway loop cannot silently spend. Count the source text accurately first with the ๐ Word Counter before pricing any request.
๐ AI Writing & Text Tool Cross-References
Tokens are the metered unit of every AI request โ start from an honest word count in the ๐ Word Counter, then price the result inside the ๐ Tech & Network Hub.
Drafting speed matters when output tokens are billed by the request: keep pace with the โจ Typing Speed Test.
Frequently Asked Questions (AI Token Calculator)
About 1,330 tokens for ordinary prose, since one token averages roughly three-quarters of a word or four characters. Code, URLs and non-English text tokenize more densely, so the calculator shows both character-based and word-based estimates for a sanity check.
It depends on the model and request size: at $3 per million input tokens an 800-token prompt costs under a tenth of a cent, and a 400-token answer at $15 per million adds six cents of a cent. Long documents plus verbose answers multiplied by daily volume is where real bills build.
Generation is the expensive half โ every output token is decoded sequentially with full model compute, while prompts are processed in parallel once. Providers therefore price completions roughly three to five times above prompts, which makes answer length the primary lever on your bill.
Yes โ each turn resends the conversation so far, so long chats grow quadratically and dominate input counts late in a session. Streaming changes nothing about billing: tokens count as they are produced whether you watch them arrive or collect them at the end.
Enable prompt caching for repeated context, move background work to batch endpoints at half price, route simple tasks to a small model, trim system prompt padding, cap output length, and keep only the history turns you need โ the calculator's editable rates let you model each change before shipping it.