Token Counter
Count exact GPT/ChatGPT tokens with tiktoken (cl100k & o200k), plus characters, words and Claude/Gemini estimates. Free, accurate, runs in your browser.
Token Counter
GPT counts are exact (OpenAI's tiktoken, cl100k/o200k). Claude and Gemini numbers are estimates — those vendors don't publish a browser tokenizer, so we approximate from character length. Use them as a guide, not a billing figure.
How to Use the Token Counter
Pick the model encoding
Choose o200k_base for GPT-5, GPT-4o and GPT-4.1, or cl100k_base for GPT-4, GPT-3.5 and the embedding models. The encoding determines exactly how text is split into tokens.
Paste your text
Type or paste any prompt, document or code. The token, word and character counts update live as you edit — the exact GPT tokenizer runs entirely in your browser.
Read the counts
The headline number is the exact GPT token count. Alongside it you get quick Claude and Gemini estimates plus word and character totals, so you can size a prompt at a glance.
Check it fits the context window
Compare the token count against your model's context window and leave room for the response. Trim or chunk long inputs before sending to avoid truncation or higher costs.
Tokens: The Unit LLMs Actually Read and Bill
Why tokens, not words, are what matter
Large language models don't read words or characters — they read tokens, chunks of text produced by a tokenizer. A token is often a whole common word, but longer or rarer words split into several pieces, and spaces and punctuation count too. As a rough rule of thumb, English runs about 4 characters per token, or roughly 0.75 tokens per word — so 1,000 tokens is around 750 words. But that's only an average; the only way to know the real count is to run the actual tokenizer, which is exactly what this tool does for GPT models using OpenAI's open-source tiktoken encodings.
Tokens are also the unit you are billed in and the unit that fills the context window. Every API call is priced per input and output token, and every model has a hard ceiling on how many tokens a single request can hold. Underestimate and your prompt gets truncated or rejected; overestimate and you pay for headroom you don't need. Counting tokens before you send is how you keep prompts inside the window, control cost, and design reliable chunking for long documents.
"Words are how you write the prompt. Tokens are how the model reads it — and how you pay for it."
Different models, different tokenizers
There is no single universal tokenizer. OpenAI's newer models (GPT-5, GPT-4o, GPT-4.1) use the o200k_base encoding, while GPT-4 and GPT-3.5 use cl100k_base — the same text can produce slightly different counts under each. Anthropic's Claude and Google's Gemini use their own tokenizers, which are not published as browser libraries, so for those this tool shows a clearly-labelled character-based estimate rather than pretending to an exactness it can't deliver. For GPT models the count here is the genuine article, computed locally from the same encoding tables the API uses. Pick your encoding, paste your text, and size your prompt with confidence.
10 Facts About Tokens
A token is a chunk of text — often a whole word, but longer words split into several pieces.
English averages about 4 characters per token, or roughly 0.75 tokens per word.
So 1,000 tokens ≈ 750 words — handy for sizing a prompt quickly.
OpenAI's tokenizer is called tiktoken, and it is open source — this tool runs it locally.
GPT-5, GPT-4o and GPT-4.1 use the o200k_base encoding; GPT-4 and GPT-3.5 use cl100k_base.
You are billed per token — both the tokens you send and the tokens the model generates.
The context window is measured in tokens; exceed it and your input is truncated or rejected.
Spaces and punctuation are tokens too — and a leading space changes how a word is tokenised.
Other languages and code tokenise differently — non-English text often uses more tokens per word.
This counter runs entirely in your browser — your text is never sent to any server or model.
Frequently Asked Questions
- A token is the unit of text a language model actually reads. The tokenizer splits your text into tokens — often a whole common word, but longer or rarer words break into several pieces, and spaces and punctuation count too. Models are priced and limited by tokens, not words.
- For GPT models the count is exact — it runs OpenAI's own tiktoken encodings (cl100k_base and o200k_base) in your browser, the same tables the API uses. The Claude and Gemini figures are clearly-labelled estimates, because those vendors don't publish a browser tokenizer.
- Use o200k_base for GPT-5, GPT-4o and GPT-4.1. Use cl100k_base for GPT-4, GPT-3.5-Turbo and the text-embedding models. The same text can produce slightly different counts under each, so match the encoding to the model you'll actually call.
- Anthropic and Google use their own tokenizers, and unlike OpenAI's tiktoken these aren't released as a library you can run locally in a browser. Rather than show a falsely precise number, we approximate from character length and label it as an estimate. For exact Claude or Gemini counts, use those providers' official token-counting endpoints.
- Roughly 750 words of English, since English averages about 0.75 tokens per word (or about 4 characters per token). It varies with punctuation, formatting and language — code and non-English text often use more tokens — so treat it as a guideline and count the real text when it matters.
- No. The tokenizer runs entirely in your browser with a locally-served library. Your text is never uploaded to any server, model, or third party, and nothing is stored. The only network request is your browser fetching the tokenizer file from our own domain.
- The exact tokenizer table is loaded on first use to keep the page fast. While it loads you'll briefly see a character-based estimate, then the exact GPT count snaps in. After that first load it's instant for the rest of your session.
- Yes. API pricing is per token for both the prompt you send (input) and the text the model generates (output), and output is usually priced higher. This tool counts the text you paste; to estimate a full request's cost, pair it with our LLM Cost Calculator.
- Yes — paste code just like any other text. Note that code often tokenises less efficiently than prose because of symbols, indentation and identifiers, so a block of code can use more tokens than the same number of characters of English.
- Completely free, with no account or sign-up, and no limit on use. It runs in your browser and collects no data.
Related News
You may be interested in these recent stories from our newsroom.
No related news yet for this tool. Our editorial team publishes new pieces every week.
Browse all news →75 more free tools
Calculators, converters, security tools — no signup.