AI Token Counter100% client-side

Count tokens with the exact GPT encoders, estimate API cost, and check context limits. Nothing you type ever leaves your browser.

0tokens · o200k_base (GPT-4o / 4.1 / o3)
0tokens · cl100k_base (GPT-4 / 3.5)
0characters
0words

Loading exact encoders…

Estimated API input cost

ModelTokenizerList input price / 1M tokensCost for your text

Prices are list prices as of Nov 2026 — always verify with the provider (openai.com/pricing, anthropic.com/pricing, ai.google.dev/pricing) before budgeting. Claude and Gemini use their own tokenizers; rows marked ≈ are approximations, not exact counts.

Context windows (as of 2026-11)

ModelContext window≈ tokens of your text

Output limits, beta extensions (e.g. 1M-token Claude beta) and pricing tiers differ per model — check the official docs.

What is a token?

Language models don't read text character by character — they read tokens: chunks of text produced by a tokenizer. A token is roughly 4 characters or 0.75 words of English, but the ratio varies: code, numbers and rare words split into more tokens, while common words ("the", "and") are single tokens. Chinese, Japanese and Korean text usually costs around one token per character, which makes CJK prompts significantly more expensive than English ones.

Each model family uses its own tokenizer. OpenAI models currently ship two encoders: o200k_base (GPT-4o, GPT-4.1, o-series) and cl100k_base (GPT-4, GPT-3.5). This counter uses those exact encoders locally in your browser, so the counts match what the OpenAI API will bill you for.

Why count tokens?

Three practical reasons: budgeting (API bills are per-token, and long system prompts multiply across every request), context limits (exceeding the window gets your text truncated or rejected), and engineering (RAG pipelines, caching and batching all depend on accurate token math). Counting before you send is the cheapest way to avoid surprise bills and silent truncation.

Read the full guide: What are tokens & how do they map to API cost?

FAQ

How many characters is one token?

For English, roughly 4 characters or 0.75 words. For Chinese/Japanese/Korean it's closer to 1 token per character. The exact split depends on the tokenizer — paste your text above for a precise count.

Which tokenizer does my model use?

GPT-4o, GPT-4.1 and o-series use o200k_base. GPT-4 and GPT-3.5 use cl100k_base. Claude and Gemini run proprietary tokenizers — this tool approximates them with cl100k_base, which is usually close but not exact.

Is my text uploaded anywhere?

No. Both encoders run entirely in your browser as static JavaScript. Your text never leaves your device — you can even disconnect from the network after the page loads.

How accurate are the cost estimates?

They use public list prices (input tokens) as of November 2026. Providers change prices and add caching/batch discounts frequently — always confirm on the official pricing page before making budget decisions.