Free tool · browser-only calculation
Token counter for GPT-style tokenizers
Count tokens, characters and words locally with cl100k_base and o200k_base, including highlighting and language comparison. With guided examples and shareable.
Token highlighting
The count is exact only for the selected encoding; other models use different tokenizers. Text is never sent to a server.
How the calculation works
Formula as plain text
R=\frac{N_{token}}{N_{words}}Tokenizers split text into the numerical units used by models. Tokens do not necessarily match words: they can be subwords, spaces, punctuation or UTF-8 sequences. Token-per-word ratio helps estimate the operational length of a prompt.
cl100k_base and o200k_base segment text differently and the count is exact only for the selected encoding. Other models use different tokenizers, so the value is not universal. The library loads only on this page and text never leaves the browser.
Highlighting exposes token boundaries, while characters, words and ratios provide complementary measures. An Italian and English example shows how similar meaning can require different token counts because of morphology and segmentation.