LLM Token Counter

Estimate how many tokens your prompt uses in GPT-4, GPT-4o, o1/o3 and Claude — with character ratios and context limit capacity checks.

0 tokens (est.)
0 characters · 0.00 chars/token
Estimated in your browser — no vocabulary file is downloaded.
Model context limitToken countFit percentage

🔒 Runs entirely in your browser — nothing you type is uploaded or stored on a server.

The LLM Token Counter estimates how many tokens your text, prompt or document will consume across major AI model architectures. Paste any text to see an estimated token count, the character-to-token ratio, and how much of each model's context window it would fill.

Also on Txtset: count standard words and reading stats · measure exact character limits.

Large language models do not process whole words or single characters; they process tokens (fragments of words and punctuation). This page estimates rather than tokenizes: it applies a ratio calibrated per model family — one for the cl100k family (GPT-4, GPT-3.5-Turbo) and a slightly denser one for o200k (GPT-4o, o1, o3-mini) — instead of downloading a multi-megabyte vocabulary into your browser. On ordinary English prose it lands within roughly 10-15% of the real count; heavy code, tables or non-Latin scripts drift further.

If you need an exact number — for a billing estimate or a prompt that sits right on a context limit — use OpenAI's tiktoken library or Anthropic's count-tokens API endpoint. What this page is for is the everyday question of whether a draft is anywhere near a limit, answered instantly and without sending your text anywhere. A context limit table shows what percentage of each model window (from 8k to 200k tokens) your input would fill.

How to use

  1. Select the model family you are writing for: GPT-4 / 3.5, GPT-4o / o-series, or Claude.
  2. Paste your prompt, code, system message or document into the text box.
  3. Read the estimated token total, the character count, and the characters-per-token ratio.
  4. Check the Context Limit table to see how much of each model's memory window is used.

Examples

Measuring prompt size
Paste a 500-word prompt to see that it costs roughly 650-700 tokens in GPT-4 — close enough to know it fits.
Comparing model families
o200k (GPT-4o) packs text more densely than cl100k, so the same prompt is estimated a little cheaper there.
Context window budgeting
Check whether a 50,000-character document fits comfortably inside a 128k context model.
Budgeting API usage
Estimate token totals before submitting large batches of text to commercial LLM APIs.

Frequently asked questions

What is a token in AI models?
A token is a chunk of text that an AI model reads and generates. In English, 1 token is roughly 4 characters or 0.75 words on average.
How accurate is this estimate?
It is a ratio calibrated per model family, not a tokenizer: expect within about 10-15% on English prose, and a wider margin on code, tables, emoji or non-Latin scripts. Nothing here downloads a vocabulary file, which is the trade — instant and private, approximate rather than exact.
What is the difference between cl100k and o200k?
cl100k_base is the 100k-token vocabulary used by GPT-4 and GPT-3.5; o200k_base is the 200k vocabulary introduced with GPT-4o, which encodes non-English text and code more efficiently. This page reflects that difference in its ratios rather than by running either vocabulary.
How do I get an exact token count?
Run OpenAI's tiktoken library locally, or call Anthropic's count-tokens endpoint for Claude. Anthropic publishes no offline tokenizer at all, so an exact Claude count always needs their API.
How does code tokenize compared to prose?
Code typically tokenizes with fewer characters per token (approx. 2.5–3 chars/token) due to indentation, punctuation, and camelCase variable names.
Is my text or API key uploaded?
No. The token calculations run entirely on your local machine; no text is sent to any server and no API key is needed.