Token counter

Paste text to count tokens and see what the input would cost.

Characters
0
Words
0
Tokens (exact for GPT-6 Astra)
0

$0

Exact count with GPT-6 Astra's tokenizer. Input only; output tokens are billed separately.

Runs in your browser. Your files never leave your device.

How tokens are counted

For OpenAI models the count is exact: the page loads the tokenizer the model uses (o200k_base for GPT-4o and newer models, cl100k_base for GPT-4, GPT-4 Turbo and GPT-3.5) through the open-source gpt-tokenizer library, and runs it on your text.

Anthropic, Google and most other providers do not publish a tokenizer that runs in the browser. For those models the number shown is an estimate: it is the o200k_base count, so the real number of billed tokens can be higher or lower. Treat it as a rough guide.

What the cost means

Input cost = tokens × the model's input price per 1M tokens. It does not include output tokens, which depend on the response.