DevTools Logo

LLM Token Counter

LLM Token Counter

Visual BPE tokens, model selector, and input cost estimate from the pricing catalog

Prompt text

Paste text to tokenize in a Web Worker

93 chars · 14 words · 1 lines

About this tool

Visual BPE token counter with model-aware encoding and catalog-based input cost estimate. Uses gpt-tokenizer in a Web Worker — no LLM inference.

How to use this tool

  1. Paste text

    Load sample or paste your prompt.

  2. Select model

    Pick a catalog model for encoding and cost.

  3. Inspect tokens

    Colored blocks show each token; count and cost update live.

Frequently asked questions

Does this upload my text?

No. Tokenization runs in a Web Worker with gpt-tokenizer entirely in your browser.

Why is encoding approximate for some models?

Only OpenAI o200k/cl100k encodings ship in gpt-tokenizer. Other models use cl100k_base as an approximation, labeled in the UI.