piko

Prompt Tokenizer

Count and inspect the tokens a prompt uses with the GPT-4o o200k_base tokenizer.

Runs on your device. Nothing you add is uploaded.

The first run loads a 9.7 MB tokenizer dictionary from piko.tools.
Your result shows here after you press “Count tokens · first download 9.7 MB”. Nothing leaves your device.

How to use Prompt Tokenizer

  1. Paste a prompt or use the example.
  2. Load the tokenizer and count the tokens.
  3. Inspect the token IDs and text fragments.

Questions

This tool uses the o200k_base tokenizer associated with GPT-4o. Other tokenizers can split the same prompt differently.

How this works

Transformers.js reads Xenova/gpt-4o’s o200k_base tokenizer (MIT, 9.7 MB) in a Web Worker. The vocabulary is served by piko.tools. No generative model or GPU is needed.

Everything happens in this browser tab. What you type or add stays on your device, and the page has no tracking. Your last settings are kept in this browser so the tool opens the way you left it. Privacy