This page runs the official tokenizer.json of deepseek-ai/DeepSeek-R1 (revision 56d4cbb, 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 DeepSeek-R1 tokenizer come from?
From the Hugging Face repository deepseek-ai/DeepSeek-R1, pinned to revision 56d4cbbb4d29f4355bab4b9a39ccb717a14ad5ad 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 DeepSeek-R1 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("deepseek-ai/DeepSeek-R1")
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.