AI Token Counter

Count AI tokens and estimate what a call will cost

Runs in your browserUtility05Text & Diff

What is AI Token Counter?

An AI token counter runs your text through the same tokenizer the model uses — o200k_base or cl100k_base — reports the exact token count, estimates the cost as either input or output tokens at published prices, and shows what share of a 128K context window the text takes up. Counting happens locally in your browser.

How to use AI Token Counter

  1. 1Pick a model; the matching tokenizer is selected for you automatically.
  2. 2Paste your prompt or document.
  3. 3Read the token count, the characters-per-token ratio, and the cost estimate.

Frequently asked questions

Why does Chinese text have a lower characters-per-token ratio than English?+

BPE tokenizer vocabularies are built mostly from English corpora, so a common English word is usually a single token while one Chinese character typically costs one or two. A Chinese prompt therefore burns noticeably more budget than an English prompt of the same character count. The o200k tokenizer compresses Chinese considerably better than cl100k does.

How accurate is the cost estimate?+

The order of magnitude is right, but do not treat it as a bill. A real call also carries the system prompt, function definitions, conversation history, and the model output, and vendors adjust prices over time. The rates used here are the public numbers as of July 2026 — always check the provider current pricing page.

Why is the first count noticeably slow?+

The tokenizer has to download its vocabulary data, which is several megabytes, the first time you use it. After that counting is instant, and switching between models that share the same tokenizer will not trigger another download.

Related tools

All tools