Built in Lahore, PakistanHow we check the math
AI text tools

AI Token Counter

Count tokens in your text with per-model rules of thumb for GPT, Claude, Gemini and Llama. Shows cost estimate and how much of the context window remains.

Runs in your browser. Your text is not uploaded.

From your provider’s pricing page, to estimate cost.

Token count

≈ 0Estimated tokens (range from two rules of thumb)

Characters0
Words0
Lines0
Estimate: characters ÷ 40
Estimate: words × 1.330

Claude, Gemini, Llama and other models use their own tokenizers, so the same text gives a different count on each. Use the range as a planning figure.

How this calculator works

A token is a unit of text processed by a language model — roughly 0.75 words of English on average, or 4 characters. "ChatGPT" is 1 token. "unbelievable" might be 2–3 tokens. "a" is 1 token. Punctuation marks are usually 1 each.

Different models use different tokenizers but the ratios are similar: GPT-4/GPT-5 use tiktoken (BPE-based), Claude uses a similar BPE, Gemini has its own. English counts can differ by 5%–10% between providers for the same text.

Non-English languages tokenize at different rates. Chinese and Japanese characters are often 1 token each — "你好" is 2 tokens. Code tokens more heavily — a Python docstring compresses well but variable names and operators each cost a token.

Cost math at Oct 2026 pricing: GPT-5 ($2.50/million input, $10/million output), Claude 4.x Sonnet ($3/million input, $15/million output), Gemini 2 Pro ($1.25/million input, $5/million output). A 10K-token document processed by Claude Sonnet costs $0.03 input; 2K-token response costs $0.03 output. Full task: ~$0.06.

Context window math: Claude 4.x handles 200K tokens; GPT-5 handles 128K–400K depending on tier; Gemini 2 Pro handles up to 2M. The input + model response share the same budget, so a 190K-token input on a 200K model leaves only 10K for the output.

Worked example

A 2,000-word document fed to Claude 4.x Sonnet

  1. Word count: 2,000.
  2. Token estimate (English): 2,000 × 1.33 = 2,660 tokens.
  3. Input cost: 2,660 × $3 ÷ 1,000,000 = $0.008.
  4. A 500-word model response: 500 × 1.33 = 665 tokens output cost: 665 × $15 ÷ 1,000,000 = $0.010.
  5. Total: ~$0.018 per task. 1,000 tasks = $18.
  6. Context used: 2,660 + 665 = 3,325 / 200,000 = 1.7% of Claude's window.

Common mistakes

  • Treating word count as token count. Underestimates by 25%–50%.
  • Forgetting the model response counts against the window on single-turn APIs. 190K input on a 200K model leaves 10K output.
  • Not accounting for conversation history. Multi-turn chats accumulate — tokens for prior turns stay in context.
  • Ignoring the system prompt. Framing can be hundreds to thousands of tokens.

Limitations of this calculator

  • Uses an average English ratio; actual tokens depend on content type.
  • Pricing changes often; always verify at the provider's current rate page.
  • Does not count special tokens or model-added framing.
  • Does not model prompt caching discounts.

For your specific situation, consult a tax professional or financial advisor.

Questions people ask

How many tokens is 1,000 words?

About 1,300 tokens for English prose, 1,500 for code, 2,000+ for languages like Chinese or Japanese. Rules of thumb; the actual tokenizer is the final word.

Is the Claude tokenizer the same as GPT?

Both use BPE (Byte-Pair Encoding) but with different training sets, so the vocabulary differs. Counts for the same text can be 5%–10% apart.

Does whitespace cost tokens?

Yes. Each space, newline and formatting character is tokenized. Minifying JSON before sending can save 10%–20% on tokens if format isn't needed.

Do I pay for the system prompt?

Yes, every token in the system message counts toward input. On Anthropic's API you can enable system prompt caching to reduce cost for repeat prompts.

Sources

Last reviewed October 19, 2026