Developer · Free Tool

LLM Token Counter

Count tokens in any prompt or document with OpenAI's tokenizer, see how text splits into tokens, and estimate its input cost on Claude, GPT, and Gemini models.

Tokens
0
Characters
0
Words
0
Chars / token
-

Exact counts use OpenAI's o200k_base tokenizer (GPT-4o onward), loaded on first use (about 2 MB). Claude and Gemini use their own tokenizers, so treat the count as a close estimate for them.

Model Input $/1M This text × 1,000 requests

About this tool

Paste any prompt, system message, document, or JSON payload to see exactly how many tokens it uses, along with characters, words, and the characters-per-token ratio. Switch to "Show tokens" to see how the text is split, which is the quickest way to understand why code, JSON, and non-English text cost more tokens than plain English.

Counts use OpenAI's o200k_base tokenizer (GPT-4o onward), which runs entirely in your browser. Claude and Gemini use their own tokenizers, so for them the count is a close estimate; for budgeting, the difference is usually small next to how much your prompt length varies. A cost table prices the text as input on popular models, per request and per thousand requests.

Common uses

  • Check a system prompt or document fits within a model's context window
  • Estimate what a prompt costs per call before shipping it to production
  • Compare how compact JSON, YAML, or Markdown versions of the same data are in tokens

Frequently asked questions

How many words is 1,000 tokens?

For ordinary English prose, roughly 750 words: a token averages about four characters. Code, JSON, numbers, and most other languages use more tokens per word, so measure rather than assume.

Are Claude tokens the same as OpenAI tokens?

No. Each provider trains its own tokenizer, so the same text produces slightly different counts. Anthropic's newer models also count somewhat more tokens for the same text than older ones. Use this count as an estimate for Claude, or the token-counting endpoint in Anthropic's API when you need the exact figure.

Why does the count jump when I paste JSON?

Braces, quotes, and repeated key names each take tokens. Minifying JSON, shortening keys, or sending data as a compact table can cut token usage noticeably for large payloads.

Is my data uploaded to a server?

No. This tool runs entirely in your browser using JavaScript, so nothing you type is transmitted, logged, or stored anywhere. You can even use it offline once the page has loaded.