Word Counter
Count words, characters, sentences, and reading time.
Before you send a prompt to an API, you usually want to know two things: how many tokens it is, and what it will cost. This tool counts tokens for GPT, Claude, Grok, and Gemini models and estimates the API price as you type. OpenAI counts are exact — it runs the real tiktoken BPE tokenizer in your browser, the same <code>o200k_base</code> encoding GPT-5 and Codex use — while Claude, Grok, and Gemini counts are clearly-labeled estimates, because those providers publish no client-side tokenizer. Nothing is uploaded; your prompt never leaves the page.
Large language models do not read characters or words — they read tokens, the sub-word units produced by a byte-pair-encoding (BPE) tokenizer. Every API charges by the token, and every model has a context-window limit measured in tokens, so knowing the token count of a prompt is the first step in both budgeting and staying within limits. A rough rule of thumb for English is about four characters per token, or three-quarters of a word, but the only way to get an exact number is to run the model's actual tokenizer.
OpenAI open-sourced its tokenizer (tiktoken), so an exact GPT token count can be computed anywhere, including in the browser. GPT-4o, GPT-4o mini, and GPT-4.1 use the newer o200k_base encoding; GPT-4, GPT-4 Turbo, and GPT-3.5 use cl100k_base. This tool loads the correct encoding for the model you pick and counts byte-for-byte the same way the API will.
Anthropic, by contrast, does not publish Claude's tokenizer. The only exact Claude token count comes from the count_tokens API endpoint, which needs an API key and a network round-trip. For sizing a prompt in the browser, a character-based estimate is the best available approximation — and this tool labels it clearly as an estimate rather than pretending otherwise. If you see another site reporting an exact Claude count client-side, it is almost certainly running OpenAI's tokenizer against Claude, which produces the wrong number.
tiktoken byte-pair encoding (the o200k_base encoding for GPT-5, Codex, GPT-4o and GPT-4.1, and cl100k_base for GPT-4, GPT-4 Turbo and GPT-3.5) entirely in your browser via the open-source gpt-tokenizer library. For Claude, Grok and Gemini the count is an estimate (about 3.6 characters per token for Claude, about 4 for Grok and Gemini), because none of those providers publishes a client-side tokenizer — see the next question./v1/messages/count_tokens API endpoint, which requires an API key. This tool gives a character-based approximation (about 3.6 characters per token for typical English) so you can size a prompt; for billing-critical numbers, call the count_tokens API. Beware of any tool that claims an exact Claude count client-side — it is almost certainly using OpenAI's tokenizer, which is wrong for Claude.