RoRoTo
On-device

Token counter — tiktoken in your browser, the text never leaves it

Count tokens locally, without sending the text

Never sent to a server Runs in the browser Output: Token count, character and byte stats, per-token highlighting
Workbench on-device

Loading tool…

About this tool

Paste some text and see how many tokens it will actually cost. This is a practical question: APIs bill per token and context windows are measured in tokens, yet nobody can work out "how many tokens is a thousand Chinese characters" in their head. This runs the same BPE algorithm as OpenAI with the three official vocabularies (cl100k_base, o200k_base, p50k_base) — the implementation was checked token-by-token against js-tiktoken, so this is not an estimate. Beyond the number, it splits the text into tokens and colours each block, which makes the shape visible: one Chinese character is often one token while an English word may split into two or three. Everything is computed in the browser and the vocabulary is a one-off static download — the text itself goes nowhere, so draft contracts, internal documents and tender submissions are safe to measure before you decide to send them to a model.

FAQ

Is the count accurate?
The algorithm is a BPE port of tiktoken and the vocabularies are exported straight from the official data. It was compared against js-tiktoken on 249 samples and matched token for token, including the edges that usually break: Chinese, emoji, code and very long runs of one character.
Why does another tool give a different number for the same model?
Because this counts the message content alone, while the API also bills for role markers and separators. Expect a handful of extra tokens per message in a real call, more as the conversation grows.
Does it support Claude, Qwen or DeepSeek?
No. They have their own tokenizers and completely different vocabularies, so running tiktoken over them produces wrong numbers. As a rough guide, Claude tends to use fewer tokens than cl100k on Chinese text, but treat that as a hint, not an invoice.
Is the text uploaded?
No. Everything runs in browser memory. The only request is for the vocabulary — a 1.1–2.4 MB static JSON — and your text is not part of it.