Text & data
Count tokens
Paste a prompt or a document and see its token count from OpenAI’s own tokenizer, not a “characters ÷ 4” guess. The table below says whether it fits each model.
This tool didn't load
Nothing was sent anywhere — whatever you added stayed on your device. Open the full tool, or reload the page.
Save and continue on the desktop
Download or copy your result here first. Open the free desktop to save to Files or use more features.
- Keep writing in Notes — it counts words and characters as you type
- Save to Files when you continue on the desktop
- Every tool in one place, no new tabs
After you download, continue on the desktop for Files or the full app.
What Token Counter can do
Exact where exact is possible, marked where it is not
OpenAI publishes its tokenizers, so the count for GPT-5, GPT-4.1, GPT-4o and the older GPT-4 and 3.5 models is exact: the same byte-pair vocabulary the API uses, running here. Those are the only vocabularies this page carries. So the Claude, Gemini and Llama rows are marked with ≈ and counted with OpenAI’s vocabulary standing in for theirs. That makes it an estimate, not their number. For Claude it runs low: Claude’s own tokenizer turns the same text into more tokens, and more still for code and non-English text, so leave a real margin there.
Why "characters ÷ 4" keeps letting you down
The rule of thumb is calibrated on English prose, and even there it runs high: a plain English paragraph comes in about a quarter under it on GPT-5’s tokenizer. Greek, Hebrew or Thai run roughly half again over it, and on the older GPT-4 Turbo and GPT-3.5 tokenizer they cost close to a token per character. JSON lands over it too. Near a limit, that gap decides whether the call goes through.
Only the vocabulary downloads
The tokenizer’s vocabulary is fetched from nopa the first time you type, and character and word counts show while it lands. Your text is not part of that: it is tokenized in this tab and never sent anywhere. That is the reason to count a confidential prompt here rather than on somebody’s server.
Related apps
Questions
Which tokenizer does it use?
o200k_base for GPT-5, GPT-4.1 and GPT-4o, and cl100k_base for GPT-4 Turbo, GPT-3.5 and OpenAI embeddings. These are the same vocabularies those models use. The Claude, Gemini and Llama rows borrow o200k_base.
Are the Claude and Gemini numbers exact?
No, and they are marked ≈ for that reason. This page carries only OpenAI’s vocabularies, so those rows count with OpenAI’s as a stand-in. For Claude the estimate usually comes out low (more so for code and non-English text), so leave a real margin instead of filling up to the limit.
Why does the number take a moment the first time?
The first count needs OpenAI’s vocabulary: about 1.1 MB, then 0.5 MB more for the GPT-4 Turbo, GPT-3.5 and embeddings rows. Your browser keeps it, so later visits only check that it is current. Characters and words count straight away.
Does it count tokens for code and JSON?
Yes, it is the same tokenizer either way. JSON runs well over the characters-over-four guess and code somewhat over it, so count them rather than estimate.