This page runs the official tokenizer.json of zai-org/GLM-4.5 (revision cbb2c7c, mit license) in your browser with Hugging Face's tokenizers.js. Paste text above to see its token count, token ids and how the text is split.
Token counts for sample texts
| Text | Sample | Tokens |
|---|---|---|
| English | The quick brown fox jumps over the lazy dog. | 10 |
| Chinese | 你好,世界!今天天气很好。 | 8 |
| Code | def add(a, b): return a + b | 11 |
FAQ
Where does the GLM-4.5 tokenizer come from?
From the Hugging Face repository zai-org/GLM-4.5, pinned to revision cbb2c7cfb52fa128a9660cb1a7a78e017899e115 and verified by SHA-256 at build time. The files are served from this site, not fetched from Hugging Face by your browser.
How do I count GLM-4.5 tokens in Python?
With Hugging Face's tokenizers library. This page's token ids were compared with its output on more than 1,000 sample texts:
from tokenizers import Tokenizer
tok = Tokenizer.from_pretrained("zai-org/GLM-4.5")
print(len(tok.encode(text).ids))Is a chat template applied?
No. The text is tokenized exactly as pasted: no chat template is applied and no begin-of-text token is added for this model. A real chat request adds template tokens around your text.
Is my text sent to a server?
No. Tokenization runs in your browser and the text never leaves the page. For usage statistics the page only reports which tokenizer you pick and that you started typing, never the text itself.