cheapaimodelSearch

LLM token counter

0 characters · 0 bytesStays in your browser
Tokens · input cost

≈ estimated as UTF-8 bytes ÷ 4 where no official tokenizer is loaded. Chat formatting adds a few tokens per request.

How the token counter works

What a token is

Models read text, and bill for it, in tokens: whole words, word pieces, single characters or raw bytes. Each vendor trains its own tokenizer, so the same text comes out as a different number of tokens on different models. Text that isn't English usually takes more tokens.

Exact counts

For open-weight models we use the tokenizer file the vendor published on Hugging Face, pinned to one version. Your browser downloads it once, keeps it, and counts in a background worker, so the number is what that model's own tokenizer gives for the same text.

Estimates

When a vendor hasn't published its tokenizer, or before the files are loaded, the count is UTF-8 bytes ÷ 4, rounded up. That works out to about four letters per token for English and about 0.75 tokens per Chinese or Japanese character (three bytes each). Use it as a rough guide.

What isn't counted

Only the text you paste. A real request also carries chat formatting such as role markers, plus any tool definitions or images, so the input tokens on your bill are a little higher. The usage field in each API response shows the billed numbers.

Input cost

The cost is what this text costs as input, at the price you pay on cheapaimodel. A struck-through amount is the same text at the vendor's list price.

cost = tokens ÷ 1,000,000 × input price per 1M tokens

Privacy

Counting happens on your device. The only network requests are for the tokenizer files, and they don't contain your text.