Tiktokenizer

Standalone tool · Text splitting rules

Text Encoding Tokenizer

Choose an encoding to see how it splits plain text into tokens. An encoding is a set of text-splitting rules, not a model. No model selection is needed.

Accuracy note

Counts apply only to the selected raw encoding and text. Chat roles, message wrappers, tools, images and provider-specific processing are excluded. These are not complete API request or billing counts.

What is an encoding?

An encoding defines how text is split into tokens and which numeric ID is assigned to each token. It is a vocabulary and a set of rules, rather than a language model. Multiple models can share an encoding.

This tool lets you choose those rules directly. The model tokenizer tool instead selects a supported tokenizer or reference encoding for the model you choose. You do not need to combine the two selectors.

How to use this tool

Choose an encoding, paste your text and inspect the count, colored token boundaries and numeric IDs. Enable Show whitespace to reveal spaces and line endings. Switch encodings to compare the same text without changing the input.

Use this view for plain-text analysis and debugging. For a particular model, use its model page and check the stated support level. Complete API usage can include chat formatting and other inputs that are outside a raw text count.

Available text splitting rules

EncodingWhat this tool counts
o200k_basePlain text using the selected vocabulary; no chat wrapper
cl100k_basePlain text using the selected vocabulary; no chat wrapper
p50k_basePlain text using the selected vocabulary; no chat wrapper
p50k_editPlain text using the selected vocabulary; no chat wrapper
r50k_basePlain text using the selected vocabulary; no chat wrapper
gpt2Plain text using the selected vocabulary; no chat wrapper

Tiktokenizer Reference Sources

Tokenizer behavior and model limits change. Verify production decisions with current provider documentation:

Frequently asked questions

Do I need to choose a model as well?

No. This is a standalone plain-text tool. Choose an encoding here, or choose a model in the model tokenizer tool; there is no second selection to pair with it.

Why can the same text have different counts?

Different encodings use different vocabularies and splitting rules, so the same passage can produce different token boundaries, IDs and totals.

Does this include chat message overhead?

No. Raw encoding counts exclude chat roles, message separators, tools and other request-level inputs. Verify complete usage with the provider.