Skip to main content

Token counter with prompt cost and context-window check

Count tokens, words and characters, see what a prompt would cost with 12 API models, and check whether it fits each model's context window.

Private by design: your text stays in your browser. The tokenizer is downloaded once from this site (about 1 MB compressed) when you start typing, and no text is ever sent to a server.

Paste or type. Counting happens on your device; nothing is uploaded.

Tokens
0
Estimate (≈ 4 characters per token)
Words
0
Characters
0

How long you expect the model reply to be (1 token ≈ ¾ of an English word).

GPT-6.1 Sol: about $0.005 for 0 input + 500 output tokens.

Estimated cost of one request (input tokens = token count above; USD, excl. tax).
ModelInputOutputTotalContext window
OpenAI GPT-6 Astra$0.00$0.025$0.025Not published
OpenAI GPT-6.1 Sol$0.00$0.005$0.005Not published
OpenAI GPT-6 Luna$0.00$0.00025$0.00025Not published
Anthropic Claude Fable 5.1$0.00$0.025$0.025Fits (0.1% of 1,000,000)
Anthropic Claude Opus 5.5$0.00$0.01$0.01Fits (0.1% of 1,000,000)
Anthropic Claude Sonnet 5.5$0.00$0.005$0.005Fits (0.1% of 1,000,000)
Anthropic Claude Haiku 5.5$0.00$0.00025$0.00025Not published
Google Gemini 4 Argon
New price announced from 2026-12-01
Only an introductory price is published (enable promo prices above)Not published
Google Gemini 3.8 Flash
New price announced from 2027-01-01
Only an introductory price is published (enable promo prices above)Not published
Google Gemini 3.5 Flash-Lite$0.00$0.00125$0.00125Not published
xAI Grok 4.7$0.00$0.003$0.003Fits (0.1% of 500,000)
xAI Grok 4.3$0.00$0.00125$0.00125Fits (0.1% of 1,000,000)

Token counts use OpenAI's open o200k_base tokenizer. For other vendors (and for models whose tokenizer is not public) the count is an estimate; their own tokenizers can produce noticeably more or fewer tokens. Costs exclude per-request or tool fees, caching discounts, batch pricing and tax.

How the token counter works

Language models don't read characters or words; they read tokens, chunks of text that are often a word, part of a word or a punctuation mark. API pricing and context limits are both measured in tokens, so the token count of your text drives both cost and fit.

This page counts tokens with o200k_base, the open tokenizer OpenAI publishes for its recent models, running locally in a Web Worker so typing stays fast even on long documents. Until the tokenizer has loaded, you see a quick estimate based on about four characters per token.

Prompt cost

Cost per request = input tokens × input price + output tokens × output price, with prices quoted per 1 million tokens. Where a vendor charges more for long prompts (for example above 272K or 200K tokens), the tier that matches your prompt length is applied automatically.

Prices come from our verified dataset (see the full LLM API pricing table). Introductory prices are excluded unless you switch them on, and if we could not confirm a price on an official page the table says "Price not verified" instead of showing a number. To estimate a month of traffic rather than one prompt, use the LLM API cost calculator.

Context window check

The context window is the maximum number of tokens a model can handle in one request, counting your input and its output. The table shows input + expected output as a share of each model's published window. Some vendors don't publish a window for every model; those show "Not published".

Tokens to words

For typical English prose, 1 token is roughly ¾ of a word, so 1,000 tokens ≈ 750 words. Code, numbers, non-English text and unusual formatting usually need more tokens per word; Japanese and other CJK text often needs about one token per character or more. Paste a sample of your real text above for an accurate ratio.

FAQ

Are Claude, Gemini and Grok counts exact?
No. Those vendors don't publish a tokenizer that runs in the browser, so we use the o200k_base count as an estimate. Anthropic, for example, notes that its newest models use a tokenizer that produces more tokens than earlier ones. Treat those costs as estimates and confirm with the vendor's own token-counting API for billing-critical work.
Is my text stored or sent anywhere?
No. All counting happens in your browser. You can verify this in your browser's network panel: typing triggers no requests.
Why don't costs include caching or batch discounts?
This tool prices a single standard request. Workload-level maths (caching share, batch share, requests per month) will be in the upcoming API cost calculator.