LLM Tokenizer Visualizer
See the real BPE tokens, token IDs, and character ratio for pasted text.
It shows how an AI breaks your text into the small pieces it reads.
What this tool does
AI models do not read whole words the way people do. They split text into tokens, then charge and enforce limits based on those tokens. This tool lets you inspect that split before you send text to a model.
- See why code, JSON, or unusual words use more tokens than expected
- Estimate how much room a prompt will take in a context window
- Compare tokenization across supported encodings
Your text never leaves the browser — no upload, no server. Prompt text is not stored in the URL.
Model caveat: Used by: . Token counts are exact for this encoding, not a rough char/4 estimate.
Loading encoding and tokenizing…
Enter text above to see token spans.
LLM APIs bill and truncate by tokens, not characters. BPE (byte-pair encoding) merges frequent byte sequences into token IDs. The same word can split differently across encodings or even positions in a prompt.
This tool uses the gpt-tokenizer library with real rank
tables — not a chars÷4 guess. Pick the encoding that matches your model
family; when unsure, o200k_base covers GPT-4o and newer
chat models.