Skip to main content

OpenAI tokenizer: count tokens in your browser

Count exact OpenAI o200k_base tokens in your browser with js-tiktoken. Text never leaves the page. Older encodings are not counted.

Counts tokens with the o200k_base encoding that tiktoken maps to OpenAI GPT-4o and GPT-4.1 models (js-tiktoken, in your browser). Text never leaves this page. Older encodings (p50k, cl100k) are not counted here. See also the token counter.

0 tokens

0 words · 0 characters · quick estimate 0

Count tokens with the o200k_base encoding, which the tiktoken library maps to OpenAI GPT-4o and GPT-4.1 models. Other OpenAI models may use a different encoding; check the model documentation if exact billing counts matter. Counting runs in your browser with js-tiktoken; text never leaves the page. Older encodings (p50k, cl100k) are not counted here. While the tokenizer worker loads, or if it fails, a character-based estimate is shown instead of the exact count.

How to use

  1. Paste text into the box. There is no file upload.
  2. Read the exact o200k_base token count when the worker is ready, plus word and character counts and the quick estimate.

Token counter · Methodology

How we check

The paste-only UI, o200k_base worker, and estimate fallback were checked against the island and existing tokenizer tests on 2026-11-11 (Asia/Colombo).

More free tools