AI Token Counter

0
Tokens (est.)
0
Words
0
Characters
0
Sentences

Estimated API cost by model (input tokens only):

ModelProviderPrice per 1M tokensYour cost (est.)
GPT-4oOpenAI$2.50$0.000000
GPT-4o miniOpenAI$0.15$0.000000
GPT-3.5 TurboOpenAI$0.50$0.000000
Claude SonnetAnthropic$3.00$0.000000
Claude HaikuAnthropic$0.25$0.000000
Gemini 1.5 FlashGoogle$0.075$0.000000
Gemini 1.5 ProGoogle$1.25$0.000000

Token count is an approximation using the ~4 characters per token rule. Actual counts may vary slightly by model. Prices are approximate and subject to change — check provider pricing pages for current rates.

About This Tool

This token counter estimates how many tokens your text uses when sent to AI models like GPT-4, Claude, or Gemini. It also shows you the approximate cost for each major model so you can budget your API usage before you run a request.

What is a token?

AI language models don't read text the way humans do — they break it into chunks called tokens. A token is roughly 4 characters of English text, though this varies. Common short words like "the" or "is" are usually one token. Longer or rarer words may split into two or three tokens. Punctuation often counts as its own token.

As a general rule of thumb: 100 tokens ≈ 75 words. A typical paragraph is around 50–80 tokens. A full page of text is roughly 500–700 tokens.

Why this matters: AI API providers charge per token. If you're building an application that calls an AI API thousands of times per day, small prompt optimizations can add up to significant cost savings. Knowing your token count before you run a request helps you stay within context limits and control costs.

Context window limits

Every AI model has a maximum number of tokens it can process in a single request — called the context window. If your prompt plus the expected response exceeds this limit, the model will either truncate your input or return an error. Common limits:

  • GPT-4o: 128,000 tokens
  • GPT-3.5 Turbo: 16,385 tokens
  • Claude 3.5 Sonnet: 200,000 tokens
  • Gemini 1.5 Pro: 1,000,000 tokens

How to reduce token usage

If you're optimizing prompts for cost or context limits, a few practical approaches help. Remove filler phrases that don't add meaning — "Please could you kindly" can simply be "Please." Use bullet points instead of full paragraphs where possible, since they convey information more compactly. Avoid repeating context in every message in a multi-turn conversation — models retain prior messages automatically. For system prompts, be specific but concise: one clear sentence is usually better than three vague ones.

Frequently asked questions

Why doesn't my token count exactly match OpenAI's tokenizer?

This tool uses the standard approximation of 4 characters per token, which is accurate for most English text within about 5–10%. OpenAI's exact tokenizer (tiktoken) uses a specific byte-pair encoding algorithm that varies by model. For precise counts, use OpenAI's Tokenizer Playground — but for budgeting and planning, this approximation is reliable.

Do different languages use more tokens?

Yes — non-Latin languages like Chinese, Japanese, Arabic, and Korean typically use more tokens per word than English. A Chinese character may use 1–3 tokens, making text in those languages significantly more expensive to process through AI APIs than equivalent English text.

Does this tool send my text anywhere?

No. All counting happens locally in your browser using JavaScript. Your text is never sent to any server. This makes the tool safe for counting tokens in confidential documents or internal prompts.