LLM Token Counter
Estimate tokens and context usage locally.
Estimate LLM tokens and context usage
Paste a prompt and get a live estimate of how many tokens it uses and what fraction of each model's context window that fills — for GPT-4o, GPT-4, Claude, Gemini, and Llama. Because it runs entirely in your browser, you can size and trim a prompt before pasting anything sensitive into a hosted AI. The count is a calibrated estimate, not a vendored multi-megabyte tokenizer: it is typically within a few percent for ordinary prose and code, which is what you need to judge cost and context budget. Nothing you type is uploaded.
Common questions
Is the token count exact?
It is a close estimate, not the output of each vendor's exact tokenizer. The real BPE rank tables are several megabytes per model, which would be a heavy download and defeats the privacy purpose of checking a prompt locally first. The estimate is usually within a few percent for normal prose and code — accurate enough to judge context-window usage and rough cost.
Why estimate locally instead of calling an API?
So you can measure a prompt that contains confidential data without sending it anywhere. The whole point is to size and trim before you paste into a hosted model, so everything is computed in your browser with no network call.
Which models are covered?
GPT-4o / 4.1 / o-series and GPT-4 / 3.5 (OpenAI), Claude 3.5 / 3.7 / 4 (Anthropic), Gemini 1.5 / 2.x (Google), and Llama 3.x (Meta). Each uses that family's typical token density and context-window size for the usage bar.
What is the context window percentage?
It shows your estimated tokens as a share of the selected model's maximum context — for example 128K for GPT-4o, 200K for Claude, and up to 1M for Gemini. It helps you see whether a long document plus your prompt will fit.
Does the character count help too?
Yes. The tool also shows characters and words. A common rule of thumb is roughly four characters or about ¾ of a word per token for English, which the estimate refines per model.
Is my text uploaded anywhere?
No. The estimate is computed in your browser from the text you paste. Nothing is sent to a server, so it is safe for prompts containing private or proprietary content.