tokenmath

How many tokens is that, and what will it cost you?

Paste a prompt below. See the exact token count for OpenAI models and close estimates for everything else, then compare API cost across six providers at once.

Characters
0
Words
0
Input tokens
0
loading tokenizer…
Expected output tokens
0
— of input
Expected output size or exact:

Cost by provider

Pick a model per provider — the cost updates instantly using the token counts above.

Current rates, per 1M tokens

Reference table for every model in the calculator above. Figures are USD.

Provider Model Context Input Cached input Output

Frequently asked questions

What does this tool actually calculate?

It counts the tokens in the text you paste, estimates how many tokens a typical reply will use based on the output size you pick, and multiplies both by each provider's published per-token rate to show an approximate API cost.

What is a token?

A token is a chunk of text a language model reads at a time — often a word, part of a word, or a punctuation mark. English text averages roughly four characters per token, so a 1,000-word document is usually somewhere around 1,300–1,500 tokens.

How accurate is the token count?

OpenAI counts are computed with the same tokenizer OpenAI's models use, so they're exact. Other providers don't publish a tokenizer that runs in a browser, so those figures are close estimates based on character density — usually within a few percent of the real count.

Why does output cost more than input?

Generating new text takes more computation than reading existing text, so most providers price output tokens several times higher than input tokens — often 3 to 6 times as much on flagship models.

How current is the pricing?

Rates are entered manually from provider documentation and reviewed periodically. Providers change pricing without much notice, so confirm against the provider's own pricing page before budgeting a production workload.

Does this work for code or non-English text?

You can paste anything. Code and non-English text often tokenize less predictably than English prose, so treat the estimate as directional rather than exact for those cases.