DevTools Logo

Multi-Tokenizer Comparator

Multi-Tokenizer Comparator

Compare how tokenizers split the same text: exact OpenAI counts, labelled estimates, token IDs and boundary diffs.

Runs in your browser0 encodings compared
Try an example

Text to tokenize

171 characters

Encodings

size disclosed before load

Results

0 encodings

No comparison yet

Choose encodings and press Compare tokenizers.

Examples

Migration check

Input
A paragraph of English prose
Output
cl100k vs o200k counts and delta

Exact counts reveal the size of the change before you migrate.

Boundary divergence

Input
Code with punctuation
Output
Highlighted character regions

Shows where one vocabulary merges tokens that the other splits.

Cost comparison

Input
Custom cents per million
Output
Cost in integer cents per request

Prices are user-supplied; no vendor price list is bundled.

About this tool

Multi-Tokenizer Comparator shows why token counts differ between models. The same text is encoded under several vocabularies, with counts, deltas against a selected baseline, unique-token counts and characters-per-token ratios in one table.

cl100k_base and o200k_base are exact counts from the locally loaded gpt-tokenizer BPE tables, with their approximate download size disclosed before use. Llama and Mistral rows are clearly labelled estimates because their vendor vocabularies are gated or cannot be redistributed; the tool never pretends a heuristic is an official count.

The boundary view aligns token boundaries by character offset and marks regions where segmentations disagree. Token IDs and pieces are shown with whitespace made visible, prices in cents per million tokens produce a per-request cost estimate, and the whole comparison exports as JSON.

What this tool does not do

  • Vendor vocabularies for Llama and Mistral are not bundled, so those rows are deterministic estimates.
  • Boundary alignment is positional, not semantic: it highlights offset differences, not meaning differences.
  • Cost figures use your own price inputs and round to whole cents per request.

How to use this tool

  1. Paste or pick sample text

    English prose, code, CJK plus emoji and numbers are available as presets; the input limit is 500,000 characters.

  2. Select encodings

    Choose two or more rows. The exact OpenAI encodings load BPE ranks on demand; estimated families need no download.

  3. Compare

    Review counts and deltas, switch to the boundary view to find divergent splits, and expand the token ID strip.

  4. Estimate cost and export

    Enter your own $/1M-token price per encoding and copy the versioned JSON comparison.

Use cases

Model migration decisions

Understand how a prompt's token count changes when switching model families.

Prompt engineering

Inspect token IDs and boundaries to see why a formatting change affects cost.

Teaching and writing

Illustrate tokenization with aligned, visually distinct segment strips.

Encoding families

EncodingStatus
o200k_baseExact — GPT-4o, GPT-4.1 and o-series; local BPE ranks.
cl100k_baseExact — GPT-4 and GPT-3.5; local BPE ranks.
Llama 3 / MistralLabelled estimates — deterministic segmentation, not vendor tokenizer output.

Special-token spellings such as <|endoftext|> are treated as ordinary text.

Common mistakes

Mistake:Treating the Llama and Mistral rows as exact.

Fix:They are labelled estimates; use the vendor tokenizer for billing or capacity planning.

Mistake:Comparing counts from different baselines without noticing.

Fix:The delta column recalculates whenever you change the baseline encoding.

Mistake:Pasting an entire book into the input.

Fix:The 500,000-character cap keeps the browser responsive; compare an excerpt instead.

Frequently asked questions

Why do token counts differ between models?

Each model family trains its own vocabulary and merge rules. Common English words may be one token in one vocabulary and three in another, while non-English text and numbers often split very differently. The boundary view shows exactly which character regions diverge.

What's the difference between cl100k and o200k?

cl100k_base is the tiktoken encoding used by GPT-4 and GPT-3.5; o200k_base is the larger encoding used by GPT-4o, GPT-4.1 and the o-series. It adds many more multilingual tokens, so counts can change even for text that looks simple.

How do I see token IDs?

After comparing, the Token IDs & pieces panel lists each token's text and numeric ID for every encoding, with the first 500 tokens shown. Whitespace is rendered with visible glyphs so boundaries are unambiguous.

How much do the tokenizer files weigh?

The exact OpenAI encodings load local BPE ranks of roughly 4 MB each on first use, and the tool discloses that before selection. Llama and Mistral estimates need no download because they do not ship vendor vocabulary files.

Is the Llama tokenizer identical to tiktoken?

No. Llama uses a different SentencePiece-style vocabulary, and its files are gated by the model provider. This tool labels those rows as estimates rather than redistributing files it cannot legally include; use the vendor tokenizer for exact billing numbers.

Is my text uploaded to compare encodings?

No. Text stays in the browser tab. Exact encodings load rank tables locally; estimated families are pure JavaScript. Nothing is sent to a server and no text is persisted.