AI Token Counter (GPT-4 / Claude)

Real-Time Token Counts & Cost Estimates • Runs Entirely in Your Browser

GPT counts are exact — calculated with the same BPE algorithm OpenAI's own tiktoken library uses. Claude counts are an estimate — Anthropic doesn't publish an open tokenizer, so this uses their own documented rule of thumb (~3.5 characters per token). For cost-critical or large requests, verify Claude counts with Anthropic's count_tokens API.
Your Text
0 characters
0 words
Optional — add an expected response length to also estimate output cost.
Token Counts & Estimated Cost

Prices per 1M tokens — editable if rates have changed since these were last checked.

Model Tokens Input $/1M Output $/1M Estimated Cost
Prices last checked August 2026 — AI API pricing changes frequently. Verify current rates on OpenAI's pricing page or Anthropic's pricing page before budgeting, or edit the price fields above with current figures.
About
Accuracy Notes
Contact

About the AI Token Counter

This tool counts tokens and estimates API cost for GPT and Claude models as you type, entirely in your browser. GPT token counts (for the o200k_base and cl100k_base encodings used by GPT-4o and GPT-4/GPT-3.5 respectively) are calculated using a genuine JavaScript port of OpenAI's own tiktoken BPE algorithm — the count you see matches what OpenAI's API would actually bill you for. Claude does not have a publicly available tokenizer, so Claude counts here use Anthropic's own documented estimation rule of thumb (roughly 3.5 characters per token) — clearly labeled as an estimate, not an exact count. Pricing is editable per model in case rates have changed since they were last checked. Nothing you type is ever uploaded anywhere; both the tokenizer and the cost math run using your device's own processing.