Estimate tokens and API cost for GPT, Claude, and Gemini prompts.
⚠️ This is an estimate, not an exact count. Real billing uses each provider's tokenizer (GPT-4o uses o200k_base); this heuristic averages the 4-chars-per-token rule of thumb (≈0.75 tokens per CJK character) with a word/punctuation split. Prices are listed as of 2026-08 and change often — always confirm on the provider's pricing page.
The GPT Token Counter is based on the following formula:
tokens ≈ characters / 4
Variables: characters: number of characters in the text (count) tokens: estimated token count of the text (tokens) 4: rule-of-thumb average characters per token for English text
A rule-of-thumb estimate: English text averages roughly 4 characters per token, refined by splitting on words and punctuation. Real counts depend on the model's exact tokenizer.
Worked example: Step 1: Take a 1,200-character paragraph of English text. Step 2: Apply the rule of thumb: tokens ≈ 1200 / 4 = 300. Step 3: A real tokenizer may return 280-320 because punctuation, code, and rare words split differently. Result: about 300 tokens (estimate).
Every LLM API bill is measured in tokens — the chunks of text a model actually reads and writes. This counter estimates how many tokens your prompt or document contains and what that input would cost on popular GPT and Claude models. It runs 100% in your browser: nothing you paste is ever uploaded, which makes it safe for unreleased drafts, customer data, and API keys.
Tokenizers such as cl100k_base (used by GPT-4 and GPT-3.5) split text into sub-word units, so a token is roughly 4 characters or 0.75 words of English. This tool starts from that classic chars÷4 rule of thumb, then refines it by splitting your text into word runs and punctuation: short words count as about one token, long words as roughly one per five characters, and each punctuation mark as its own token. The two heuristics are averaged. Expect the result to land within about 10–20% of the real count — close enough for budgeting, not for billing disputes.
The heuristic is tuned for English prose. Source code tokenizes worse (dense symbols and indentation), non-English text— especially CJK — often costs 1–2 characters per token instead of 4, and emoji or rare Unicode can cost several tokens each. If you need an exact figure, run the provider's own tokenizer (tiktoken for OpenAI, or the token-count endpoint in the Anthropic SDK) on the same text and compare.
The dropdown lists per-million-token prices for the current flagship models from OpenAI, Anthropic, Google, DeepSeek and others — for example GPT-5.6, Claude Sonnet 5 and Gemini 3.6 Flash — as of 2026. Providers change pricing frequently, so verify before committing. A quick sanity check: a 1,000-word prompt is roughly 1,300 tokens, which at the input prices in the dropdown costs at most a cent or two. Costs only become meaningful at scale, so multiply by your real request volume — and remember that output tokens are billed separately, usually at several times the input rate.
More tools you might find useful
Rescue malformed LLM JSON — truncated, trailing commas, fences.
Paste JSON, get a typed Zod schema — AI output validation ready.
Rank every major model by your real monthly API bill.
Per-request and monthly API costs across 17 models, side by side.