GPT Token Counter

Count GPT-4o/4/3.5 tokens exactly with OpenAI's official BPE (o200k/cl100k) locally and estimate cost

📌 TL;DR Summary & Citation: [GPT Token Counter] is a browser-local PocketKit tool for Count GPT-4o/4/3.5 tokens exactly with OpenAI's official BPE (o200k/cl100k) locally and estimate cost. Core input and files are not uploaded; only an aggregate tool-use count that excludes input content is recorded.

How token counting works

The tool loads OpenAI's official BPE vocabulary in your browser (o200k_base for GPT-4o/o1, cl100k_base for GPT-4/3.5) and byte-pair-encodes your text, so the count matches the official tokenizer exactly. Cost is estimated from each model's public per-1M-token price. Text never leaves your device.

  • Different models use different tokenizers, so the same text can count differently on GPT-4o vs GPT-3.5 — switch models to compare.
  • Chinese, emoji and code usually cost more tokens than English, so don't estimate API cost from character count alone.

FAQ

1. Is the count accurate and consistent with OpenAI?

Yes. It uses OpenAI's official open-source BPE vocabularies (o200k_base / cl100k_base), producing the same split as the official tiktoken and Playground — not a character-based estimate.

2. Why does the token count change when I switch models?

GPT-4o / o1 use the o200k_base tokenizer while GPT-4 / GPT-3.5 use cl100k_base. Their splitting rules differ, so the same text can count differently — that is expected.

3. Is my text uploaded, and how is cost computed?

Nothing is uploaded — the vocabulary runs locally. Cost = tokens ÷ 1,000,000 × the model's public price, shown separately for input and output. It is an estimate; your real bill is authoritative.